mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2025-04-20 07:11:33 +02:00
Add pagination via kaminari
This commit is contained in:
parent
f71c083722
commit
40eeac2021
13 changed files with 57 additions and 5 deletions
3
app/views/kaminari/_first_page.html.slim
Normal file
3
app/views/kaminari/_first_page.html.slim
Normal file
|
@ -0,0 +1,3 @@
|
|||
li
|
||||
= link_to_unless(current_page.first?,
|
||||
raw(t 'views.pagination.first'), url, :remote => remote)
|
2
app/views/kaminari/_gap.html.slim
Normal file
2
app/views/kaminari/_gap.html.slim
Normal file
|
@ -0,0 +1,2 @@
|
|||
li.unavailable
|
||||
= link_to raw(t 'views.pagination.truncate'), '#'
|
3
app/views/kaminari/_last_page.html.slim
Normal file
3
app/views/kaminari/_last_page.html.slim
Normal file
|
@ -0,0 +1,3 @@
|
|||
li
|
||||
= link_to_unless(current_page.last?,
|
||||
raw(t 'views.pagination.last'), url, { :remote => remote })
|
4
app/views/kaminari/_next_page.html.slim
Normal file
4
app/views/kaminari/_next_page.html.slim
Normal file
|
@ -0,0 +1,4 @@
|
|||
li
|
||||
= link_to_unless(current_page.last?,
|
||||
raw(t 'views.pagination.next'),
|
||||
url, :rel => 'next', :remote => remote)
|
4
app/views/kaminari/_page.html.slim
Normal file
4
app/views/kaminari/_page.html.slim
Normal file
|
@ -0,0 +1,4 @@
|
|||
li{class="#{'current' if page.current?}"}
|
||||
= link_to(page, page.current? ? '#' : url,
|
||||
{ :remote => remote,
|
||||
:rel => page.next? ? 'next' : page.prev? ? 'prev' : nil })
|
12
app/views/kaminari/_paginator.html.slim
Normal file
12
app/views/kaminari/_paginator.html.slim
Normal file
|
@ -0,0 +1,12 @@
|
|||
= paginator.render do
|
||||
.pagination-centered
|
||||
ul.pagination
|
||||
= first_page_tag unless current_page.first?
|
||||
= prev_page_tag unless current_page.first?
|
||||
- each_page do |page|
|
||||
- if page.left_outer? || page.right_outer? || page.inside_window?
|
||||
= page_tag page
|
||||
- elsif !page.was_truncated?
|
||||
= gap_tag
|
||||
= next_page_tag unless current_page.last?
|
||||
= last_page_tag unless current_page.last?
|
4
app/views/kaminari/_prev_page.html.slim
Normal file
4
app/views/kaminari/_prev_page.html.slim
Normal file
|
@ -0,0 +1,4 @@
|
|||
li
|
||||
= link_to_unless(current_page.first?,
|
||||
raw(t 'views.pagination.previous'),
|
||||
url, :rel => 'prev', :remote => remote)
|
Loading…
Add table
Add a link
Reference in a new issue