From 86fb20e64786018e4bb65d7a96215d1d60a55004 Mon Sep 17 00:00:00 2001 From: Domizio Demichelis Date: Tue, 27 Apr 2021 17:24:03 +0700 Subject: [PATCH] fixed pagy_semantic_nav hellips --- lib/pagy/extras/semantic.rb | 2 +- test/pagy/extras/semantic_test.rb | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/pagy/extras/semantic.rb b/lib/pagy/extras/semantic.rb index 7c1d5f8e9..26ddf2de6 100644 --- a/lib/pagy/extras/semantic.rb +++ b/lib/pagy/extras/semantic.rb @@ -17,7 +17,7 @@ def pagy_semantic_nav(pagy, pagy_id: nil, link_extra: '') html << case item when Integer then link.call item # page link when String then %(#{item}) # current page - when :gap then %(
...
) # page gap + when :gap then %(
#{pagy_t 'pagy.nav.gap'}
) # page gap end end html << pagy_semantic_next_html(pagy, link) diff --git a/test/pagy/extras/semantic_test.rb b/test/pagy/extras/semantic_test.rb index 46a4e706e..b30c53e79 100644 --- a/test/pagy/extras/semantic_test.rb +++ b/test/pagy/extras/semantic_test.rb @@ -10,23 +10,23 @@ it 'renders first page' do pagy = Pagy.new(count: 1000, page: 1) _(view.pagy_semantic_nav(pagy)).must_equal \ - "
12345
...
50
" + "
12345
50
" _(view.pagy_semantic_nav(pagy, pagy_id: 'test-nav-id', link_extra: 'link-extra')).must_equal \ - "
12345
...
50
" + "
12345
50
" end it 'renders intermediate page' do pagy = Pagy.new(count: 1000, page: 20) _(view.pagy_semantic_nav(pagy)).must_equal \ - "
1
...
161718192021222324
...
50
" + "
1
161718192021222324
50
" _(view.pagy_semantic_nav(pagy, pagy_id: 'test-nav-id', link_extra: 'link-extra')).must_equal \ - "
1
...
161718192021222324
...
50
" + "
1
161718192021222324
50
" end it 'renders last page' do pagy = Pagy.new(count: 1000, page: 50) _(view.pagy_semantic_nav(pagy)).must_equal \ - "
1
...
4647484950
" + "
1
4647484950
" _(view.pagy_semantic_nav(pagy, pagy_id: 'test-nav-id', link_extra: 'link-extra')).must_equal \ - "
1
...
4647484950
" + "
1
4647484950
" end end