Skip to content

Commit

Permalink
Issue #81. Implement mobile version of pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
kalashnikovisme committed Nov 20, 2024
1 parent 88e29f6 commit 9368c3f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion app/views/kaminari/_first_page.html.haml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- unless current_page.first?
= link_to t('views.pagination.first').html_safe, url, remote:, class: pagination_classes(klass: 'first')
= link_to t('views.pagination.first').html_safe, url, remote:, class: pagination_classes(klass: 'first hidden sm:flex')
= link_to '⭰', url, remote:, class: pagination_classes(klass: 'first sm:hidden font-bold')
2 changes: 1 addition & 1 deletion app/views/kaminari/_gap.html.haml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
%span.page.gap.px-3.py-2.text-sm.font-medium.text-purple-700.dark:text-white
%span.page.gap.px-3.py-2.text-sm.font-medium.text-purple-700.dark:text-white.sm:flex.hidden
= t('views.pagination.truncate').html_safe
3 changes: 2 additions & 1 deletion app/views/kaminari/_last_page.html.haml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- unless current_page.last?
= link_to t('views.pagination.last').html_safe, url, remote:, class: pagination_classes(klass: 'last')
= link_to t('views.pagination.last').html_safe, url, remote:, class: pagination_classes(klass: 'last hidden sm:flex')
= link_to '⭲', url, remote:, class: pagination_classes(klass: 'last sm:hidden font-bold')
3 changes: 2 additions & 1 deletion app/views/kaminari/_next_page.html.haml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- unless current_page.last?
= link_to t('views.pagination.next').html_safe, url, rel: 'next', remote:, class: pagination_classes(klass: 'next')
= link_to t('views.pagination.next').html_safe, url, rel: 'next', remote:, class: pagination_classes(klass: 'next hidden sm:flex')
= link_to '🠖', url, rel: 'next', remote:, class: pagination_classes(klass: 'next sm:hidden font-bold')
2 changes: 1 addition & 1 deletion app/views/kaminari/_page.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
%span.px-3.py-2.font-medium.rounded-md.bg-purple-500.text-white.dark:text-gray-800.dark:bg-white
= page
- else
= link_to page, url, remote:, rel: page.rel, class: pagination_classes
= link_to page, url, remote:, rel: page.rel, class: pagination_classes(klass: 'hidden sm:flex')
3 changes: 2 additions & 1 deletion app/views/kaminari/_prev_page.html.haml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- unless current_page.first?
= link_to t('views.pagination.previous').html_safe, url, rel: 'prev', remote:, class: pagination_classes(klass: 'prev')
= link_to t('views.pagination.previous').html_safe, url, rel: 'prev', remote:, class: pagination_classes(klass: 'prev hidden sm:flex')
= link_to '🠔', url, rel: 'prev', remote:, class: pagination_classes(klass: 'prev sm:hidden font-bold')

0 comments on commit 9368c3f

Please sign in to comment.