diff options
author | Guillermo Ramos | 2020-02-11 18:21:12 +0100 |
---|---|---|
committer | Guillermo Ramos | 2020-02-11 18:21:12 +0100 |
commit | 6ce840b8d9155170b54277c83b1363d4eb42ab34 (patch) | |
tree | 929fac520861acb34c054443d73d0ca34a2b26d5 /lib/waev_web/views/exports_view.ex | |
parent | c8961cafed719ae0e3113b1cc4bb1e5dac5d62d1 (diff) | |
download | waev-6ce840b8d9155170b54277c83b1363d4eb42ab34.tar.gz |
Pagination
Diffstat (limited to 'lib/waev_web/views/exports_view.ex')
-rw-r--r-- | lib/waev_web/views/exports_view.ex | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/waev_web/views/exports_view.ex b/lib/waev_web/views/exports_view.ex index 680454c..f0cfa0d 100644 --- a/lib/waev_web/views/exports_view.ex +++ b/lib/waev_web/views/exports_view.ex @@ -38,4 +38,17 @@ defmodule WaevWeb.ExportsView do |> raw() end) end + + def pagination_bar(assigns, page, size) do + prev = if page == 0, do: 0, else: page - 1 + # TODO max + next = page + 1 + + ~E""" + <div> + <a href="<%= Routes.exports_path(@conn, :show, @id, page: prev, size: size) %>">Left</a> + <a href="<%= Routes.exports_path(@conn, :show, @id, page: next, size: size) %>">Right</a> + </div> + """ + end end |