Skip to content

Commit

Permalink
Use pagy_nav instead of template for pagy 8.x compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
excid3 committed May 2, 2024
1 parent 2472566 commit 4eb3b41
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 27 deletions.
15 changes: 9 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ GEM
i18n (1.14.4)
concurrent-ruby (~> 1.0)
io-console (0.7.2)
irb (1.12.0)
rdoc
irb (1.13.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
json (2.7.2)
language_server-protocol (3.17.0.3)
Expand Down Expand Up @@ -143,6 +143,8 @@ GEM
nokogiri (1.16.4)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.16.4-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.4-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.4-x86_64-linux)
Expand Down Expand Up @@ -203,9 +205,9 @@ GEM
rdoc (6.6.3.1)
psych (>= 4.0.0)
regexp_parser (2.9.0)
reline (0.5.3)
reline (0.5.5)
io-console (~> 0.5)
request_store (1.6.0)
request_store (1.7.0)
rack (>= 1.4)
rexml (3.2.6)
rubocop (1.62.1)
Expand All @@ -219,8 +221,8 @@ GEM
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.2)
parser (>= 3.3.0.4)
rubocop-ast (1.31.3)
parser (>= 3.3.1.0)
rubocop-performance (1.20.2)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
Expand All @@ -233,6 +235,7 @@ GEM
simplecov_json_formatter (0.1.4)
sqlite3 (1.7.3)
mini_portile2 (~> 2.8.0)
sqlite3 (1.7.3-arm64-darwin)
sqlite3 (1.7.3-x86_64-darwin)
sqlite3 (1.7.3-x86_64-linux)
standard (1.35.1)
Expand Down
31 changes: 31 additions & 0 deletions app/views/madmin/application/_javascript.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,37 @@
<%= stylesheet_link_tag "https://unpkg.com/flatpickr/dist/flatpickr.min.css", "data-turbo-track": "reload" %>
<%= stylesheet_link_tag "https://unpkg.com/trix/dist/trix.css", "data-turbo-track": "reload" %>
<%= stylesheet_link_tag "https://unpkg.com/tom-select/dist/css/tom-select.min.css", "data-turbo-track": "reload" %>
<style type="text/tailwindcss">
.pagy {
@apply isolate inline-flex rounded-md;

a:first-child {
@apply rounded-l-md;
}
a:last-child {
@apply rounded-r-md;
}

a {
@apply relative -ml-px inline-flex items-center bg-white px-3 py-2 text-sm font-semibold text-gray-900 ring-1 ring-inset ring-gray-300 hover:bg-gray-100 focus:z-10;

&:not([href]) {
@apply text-gray-300 cursor-default;
}

&.current {
@apply text-white bg-blue-500 ring-blue-500;
}
}

label {
@apply inline-block whitespace-nowrap bg-gray-200 rounded-lg px-3 py-0.5;
input {
@apply bg-gray-100 border-none rounded-md;
}
}
}
</style>

<script type="importmap" data-turbo-track="reload">
{
Expand Down
2 changes: 1 addition & 1 deletion app/views/madmin/application/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@
</tbody>
</table>
</div>
<%== render(partial: 'madmin/pagy/nav', locals: { pagy: @pagy }) if @pagy.pages > 1 %>
<%== pagy_nav @pagy %>
20 changes: 0 additions & 20 deletions app/views/madmin/pagy/_nav.html.erb

This file was deleted.

0 comments on commit 4eb3b41

Please sign in to comment.