mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-28 05:57:58 +01:00
100 lines
3 KiB
Text
100 lines
3 KiB
Text
- params = assigns[:params] || []
|
|
|
|
= if @page.total_pages > 1 do
|
|
nav.pagination.hidden--mobile
|
|
= if not first_page?(@page) do
|
|
= link to: first_page_path(@page, @route, params), class: "with-icon" do
|
|
i.fa.fa-angles-left>
|
|
' First
|
|
.separator--vertical.separator--secondary
|
|
= link to: prev_page_path(@page, @route, params), class: "js-prev with-icon" do
|
|
i.fa.fa-angle-left>
|
|
' Prev
|
|
.separator--vertical.separator--secondary
|
|
|
|
= if left_gap?(@page) do
|
|
span
|
|
' …
|
|
|
|
= for number <- left_page_numbers(@page) do
|
|
= link(number, to: page_path(@route, params, number))
|
|
|
|
span = @page.page_number
|
|
|
|
= for number <- right_page_numbers(@page) do
|
|
= link(number, to: page_path(@route, params, number))
|
|
|
|
= if right_gap?(@page) do
|
|
span
|
|
' …
|
|
|
|
= if not last_page?(@page) do
|
|
.separator--vertical.separator--secondary
|
|
= link to: next_page_path(@page, @route, params), class: "js-next with-icon" do
|
|
' Next
|
|
i.fa.fa-angle-right
|
|
.separator--vertical.separator--secondary
|
|
= link to: last_page_path(@page, @route, params), class: "with-icon" do
|
|
' Last
|
|
i.fa.fa-angles-right
|
|
|
|
nav.pagination.hidden--desktop
|
|
= if first_page?(@page) do
|
|
span.with-icon
|
|
i.fa.fa-angles-left>
|
|
' First
|
|
.separator--vertical.separator--secondary
|
|
span.with-icon
|
|
i.fa.fa-angle-left>
|
|
' Prev
|
|
.separator--vertical.separator--secondary
|
|
- else
|
|
= link to: first_page_path(@page, @route, params), class: "with-icon" do
|
|
i.fa.fa-angles-left>
|
|
' First
|
|
.separator--vertical.separator--secondary
|
|
= link to: prev_page_path(@page, @route, params), class: "js-prev with-icon" do
|
|
i.fa.fa-angle-left>
|
|
' Prev
|
|
.separator--vertical.separator--secondary
|
|
|
|
.dropdown
|
|
a.with-icon.page-current.pagination__dropdown
|
|
=> @page.page_number
|
|
i.fa.fa-caret-down
|
|
|
|
.dropdown__content
|
|
= if left_gap?(@page) do
|
|
span
|
|
' …
|
|
|
|
= for number <- left_page_numbers(@page) do
|
|
= link(number, to: page_path(@route, params, number))
|
|
|
|
span = @page.page_number
|
|
|
|
= for number <- right_page_numbers(@page) do
|
|
= link(number, to: page_path(@route, params, number))
|
|
|
|
= if right_gap?(@page) do
|
|
span
|
|
' …
|
|
|
|
= if last_page?(@page) do
|
|
.separator--vertical.separator--secondary
|
|
span.with-icon
|
|
' Next
|
|
i.fa.fa-angle-right
|
|
.separator--vertical.separator--secondary
|
|
span.with-icon
|
|
' Last
|
|
i.fa.fa-angles-right
|
|
- else
|
|
.separator--vertical.separator--secondary
|
|
= link to: next_page_path(@page, @route, params), class: "js-next with-icon" do
|
|
' Next
|
|
i.fa.fa-angle-right
|
|
.separator--vertical.separator--secondary
|
|
= link to: last_page_path(@page, @route, params), class: "with-icon" do
|
|
' Last
|
|
i.fa.fa-angles-right
|