Skip to content

Commit

Permalink
With the new version of Pagy, the 'gap' has a different I18n reference.
Browse files Browse the repository at this point in the history
The 'gap' refers to the three dots that are rendered if there are more
pages in the index than can be rendered on the screen at once.
  • Loading branch information
koetsier committed Feb 27, 2024
1 parent db3b3fe commit c5c0da0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/helpers/pagy_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def pagy_nav_govuk(pagy)
html << case item
when Integer then %(<li class="govuk-pagination__item"><a>#{link.call item}</a></li>) # page link
when String then %(<li class="govuk-pagination__item govuk-pagination__item--current"><a>#{item}</a></li>) # current page
when :gap then %(<li class="govuk-pagination__item">#{pagy_t('pagy.nav.gap')}</li>) # page gap
when :gap then %(<li class="govuk-pagination__item">#{pagy_t('pagy.gap')}</li>) # page gap
end
end
html << %(</ul>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
100.times { organisation.locations << create(:location, organisation:) }
sign_in_user create(:user, :super_admin)
visit super_admin_organisation_path(organisation)
expect(page.body).to include(Pagy::I18n.translate(nil, "pagy.nav.gap"))
expect(page.body).to include(Pagy::I18n.translate(nil, "pagy.gap"))
end
end

Expand Down

0 comments on commit c5c0da0

Please sign in to comment.