2019-10-09 01:19:57 +02:00
|
|
|
- params = assigns[:params] || []
|
|
|
|
|
|
|
|
= if @page.total_pages > 1 do
|
2023-11-23 17:07:49 +01:00
|
|
|
nav.pagination.hidden--mobile
|
2019-10-09 01:19:57 +02:00
|
|
|
= if not first_page?(@page) do
|
2023-11-23 17:07:49 +01:00
|
|
|
= link to: first_page_path(@page, @route, params) do
|
|
|
|
i.fa.fa-backward>
|
|
|
|
' First
|
|
|
|
.separator--vertical.separator--secondary
|
|
|
|
= link to: prev_page_path(@page, @route, params), class: "js-prev" do
|
|
|
|
i.fa.fa-chevron-left>
|
|
|
|
' Prev
|
|
|
|
.separator--vertical.separator--secondary
|
2019-10-09 01:19:57 +02:00
|
|
|
|
2020-12-10 07:22:44 +01:00
|
|
|
= if left_gap?(@page) do
|
2023-11-23 17:07:49 +01:00
|
|
|
span
|
2020-12-10 07:22:44 +01:00
|
|
|
' …
|
2019-10-09 01:19:57 +02:00
|
|
|
|
2020-12-10 07:22:44 +01:00
|
|
|
= for number <- left_page_numbers(@page) do
|
|
|
|
= link(number, to: page_path(@route, params, number))
|
2019-10-09 01:19:57 +02:00
|
|
|
|
2023-11-23 17:07:49 +01:00
|
|
|
span = @page.page_number
|
2019-10-09 01:19:57 +02:00
|
|
|
|
2020-12-10 07:22:44 +01:00
|
|
|
= for number <- right_page_numbers(@page) do
|
|
|
|
= link(number, to: page_path(@route, params, number))
|
2019-10-09 01:19:57 +02:00
|
|
|
|
2020-12-10 07:22:44 +01:00
|
|
|
= if right_gap?(@page) do
|
2023-11-23 17:07:49 +01:00
|
|
|
span
|
2020-12-10 07:22:44 +01:00
|
|
|
' …
|
2019-10-09 01:19:57 +02:00
|
|
|
|
|
|
|
= if not last_page?(@page) do
|
2023-11-23 17:07:49 +01:00
|
|
|
.separator--vertical.separator--secondary
|
|
|
|
= link to: next_page_path(@page, @route, params), class: "js-next" do
|
|
|
|
' Next
|
|
|
|
i.fa.fa-chevron-right
|
|
|
|
.separator--vertical.separator--secondary
|
|
|
|
= link to: last_page_path(@page, @route, params) do
|
|
|
|
' Last
|
|
|
|
i.fa.fa-fast-forward
|
2020-12-10 07:22:44 +01:00
|
|
|
|
2023-11-23 17:07:49 +01:00
|
|
|
nav.pagination.hidden--desktop
|
2020-12-10 07:22:44 +01:00
|
|
|
= if first_page?(@page) do
|
2023-11-23 17:07:49 +01:00
|
|
|
span
|
|
|
|
i.fa.fa-backward>
|
|
|
|
' First
|
|
|
|
.separator--vertical.separator--secondary
|
|
|
|
span
|
|
|
|
i.fa.fa-chevron-left>
|
|
|
|
' Prev
|
|
|
|
.separator--vertical.separator--secondary
|
2020-12-10 07:22:44 +01:00
|
|
|
- else
|
2023-11-23 17:07:49 +01:00
|
|
|
= link to: first_page_path(@page, @route, params) do
|
|
|
|
i.fa.fa-backward>
|
|
|
|
' First
|
|
|
|
= link to: prev_page_path(@page, @route, params), class: "js-prev" do
|
|
|
|
i.fa.fa-chevron-left>
|
|
|
|
' Prev
|
2020-12-10 07:22:44 +01:00
|
|
|
|
|
|
|
.dropdown
|
|
|
|
a.page-current.pagination__dropdown
|
|
|
|
=> @page.page_number
|
|
|
|
i.fa.fa-caret-down
|
|
|
|
|
|
|
|
.dropdown__content
|
|
|
|
= if left_gap?(@page) do
|
2023-11-23 17:07:49 +01:00
|
|
|
span
|
2020-12-10 07:22:44 +01:00
|
|
|
' …
|
|
|
|
|
|
|
|
= for number <- left_page_numbers(@page) do
|
|
|
|
= link(number, to: page_path(@route, params, number))
|
|
|
|
|
2023-11-23 17:07:49 +01:00
|
|
|
span = @page.page_number
|
2020-12-10 07:22:44 +01:00
|
|
|
|
|
|
|
= for number <- right_page_numbers(@page) do
|
|
|
|
= link(number, to: page_path(@route, params, number))
|
|
|
|
|
|
|
|
= if right_gap?(@page) do
|
2023-11-23 17:07:49 +01:00
|
|
|
span
|
2020-12-10 07:22:44 +01:00
|
|
|
' …
|
|
|
|
|
|
|
|
= if last_page?(@page) do
|
2023-11-23 17:07:49 +01:00
|
|
|
.separator--vertical.separator--secondary
|
|
|
|
span
|
|
|
|
' Next
|
|
|
|
i.fa.fa-chevron-right
|
|
|
|
.separator--vertical.separator--secondary
|
|
|
|
span
|
|
|
|
' Last
|
|
|
|
i.fa.fa-fast-forward
|
2020-12-10 07:22:44 +01:00
|
|
|
- else
|
2023-11-23 17:07:49 +01:00
|
|
|
.separator--vertical.separator--secondary
|
|
|
|
= link to: next_page_path(@page, @route, params), class: "js-next" do
|
|
|
|
' Next
|
|
|
|
i.fa.fa-chevron-right
|
|
|
|
.separator--vertical.separator--secondary
|
|
|
|
= link to: last_page_path(@page, @route, params) do
|
|
|
|
' Last
|
|
|
|
i.fa.fa-fast-forward
|