Skip to content

Commit

Permalink
removed redundant role="navigation" attribute from nav tags; removed …
Browse files Browse the repository at this point in the history
…illegal aria-label="pager" from semantic div
  • Loading branch information
ddnexus committed May 8, 2021
1 parent 0467d32 commit f5e3482
Show file tree
Hide file tree
Showing 12 changed files with 117 additions and 117 deletions.
6 changes: 3 additions & 3 deletions lib/pagy/extras/bootstrap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def pagy_bootstrap_nav(pagy, pagy_id: nil, link_extra: '')
p_id = %( id="#{pagy_id}") if pagy_id
link = pagy_link_proc(pagy, link_extra: %(class="page-link" #{link_extra}))

html = +%(<nav#{p_id} class="pagy-bootstrap-nav" role="navigation" aria-label="pager"><ul class="pagination">)
html = +%(<nav#{p_id} class="pagy-bootstrap-nav" aria-label="pager"><ul class="pagination">)
html << pagy_bootstrap_prev_html(pagy, link)
pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
html << case item
Expand All @@ -35,7 +35,7 @@ def pagy_bootstrap_nav_js(pagy, deprecated_id=nil, pagy_id: nil, link_extra: '',
'gap' => %(<li class="page-item gap disabled"><a href="#" class="page-link">#{pagy_t 'pagy.nav.gap'}</a></li>),
'after' => %(#{pagy_bootstrap_next_html pagy, link}</ul>) }

html = %(<nav#{p_id} class="pagy-njs pagy-bootstrap-nav-js" role="navigation" aria-label="pager"></nav>)
html = %(<nav#{p_id} class="pagy-njs pagy-bootstrap-nav-js" aria-label="pager"></nav>)
html << pagy_json_tag(pagy, :nav, tags, pagy.sequels(steps))
end

Expand All @@ -48,7 +48,7 @@ def pagy_bootstrap_combo_nav_js(pagy, deprecated_id=nil, pagy_id: nil, link_extr
p_pages = pagy.pages
input = %(<input type="number" min="1" max="#{p_pages}" value="#{p_page}" class="text-primary" style="padding: 0; border: none; text-align: center; width: #{p_pages.to_s.length+1}rem;">)

%(<nav#{p_id} class="pagy-bootstrap-combo-nav-js pagination" role="navigation" aria-label="pager"><div class="btn-group" role="group">#{
%(<nav#{p_id} class="pagy-bootstrap-combo-nav-js pagination" aria-label="pager"><div class="btn-group" role="group">#{
if (p_prev = pagy.prev)
link.call p_prev, pagy_t('pagy.nav.prev'), 'aria-label="previous" class="prev btn btn-primary"'
else
Expand Down
6 changes: 3 additions & 3 deletions lib/pagy/extras/bulma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def pagy_bulma_nav(pagy, pagy_id: nil, link_extra: '')
p_id = %( id="#{pagy_id}") if pagy_id
link = pagy_link_proc(pagy, link_extra: link_extra)

html = +%(<nav#{p_id} class="pagy-bulma-nav pagination is-centered" role="navigation" aria-label="pagination">)
html = +%(<nav#{p_id} class="pagy-bulma-nav pagination is-centered" aria-label="pagination">)
html << pagy_bulma_prev_next_html(pagy, link)
html << %(<ul class="pagination-list">)
pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
Expand All @@ -34,7 +34,7 @@ def pagy_bulma_nav_js(pagy, deprecated_id=nil, pagy_id: nil, link_extra: '', ste
'gap' => %(<li><span class="pagination-ellipsis">#{pagy_t 'pagy.nav.gap' }</span></li>),
'after' => '</ul>' }

html = %(<nav#{p_id} class="pagy-njs pagy-bulma-nav-js pagination is-centered" role="navigation" aria-label="pagination"></nav>)
html = %(<nav#{p_id} class="pagy-njs pagy-bulma-nav-js pagination is-centered" aria-label="pagination"></nav>)
html << pagy_json_tag(pagy, :nav, tags, pagy.sequels(steps))
end

Expand All @@ -47,7 +47,7 @@ def pagy_bulma_combo_nav_js(pagy, deprecated_id=nil, pagy_id: nil, link_extra: '
p_pages = pagy.pages
input = %(<input class="input" type="number" min="1" max="#{p_pages}" value="#{p_page}" style="padding: 0; text-align: center; width: #{p_pages.to_s.length+1}rem; margin:0 0.3rem;">)

%(<nav#{p_id} class="pagy-bulma-combo-nav-js" role="navigation" aria-label="pagination"><div class="field is-grouped is-grouped-centered" role="group">#{
%(<nav#{p_id} class="pagy-bulma-combo-nav-js" aria-label="pagination"><div class="field is-grouped is-grouped-centered" role="group">#{
if (p_prev = pagy.prev)
%(<p class="control">#{link.call p_prev, pagy_t('pagy.nav.prev'), 'class="button" aria-label="previous page"'}</p>)
else
Expand Down
6 changes: 3 additions & 3 deletions lib/pagy/extras/foundation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def pagy_foundation_nav(pagy, pagy_id: nil, link_extra: '')
p_id = %( id="#{pagy_id}") if pagy_id
link = pagy_link_proc(pagy, link_extra: link_extra)

html = +%(<nav#{p_id} class="pagy-foundation-nav" role="navigation" aria-label="Pagination"><ul class="pagination">)
html = +%(<nav#{p_id} class="pagy-foundation-nav" aria-label="Pagination"><ul class="pagination">)
html << pagy_foundation_prev_html(pagy, link)
pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
html << case item
Expand All @@ -35,7 +35,7 @@ def pagy_foundation_nav_js(pagy, deprecated_id=nil, pagy_id: nil, link_extra: ''
'gap' => %(<li class="ellipsis gap" aria-hidden="true"></li>),
'after' => %(#{pagy_foundation_next_html pagy, link}</ul>) }

html = %(<nav#{p_id} class="pagy-njs pagy-foundation-nav-js" role="navigation" aria-label="Pagination"></nav>)
html = %(<nav#{p_id} class="pagy-njs pagy-foundation-nav-js" aria-label="Pagination"></nav>)
html << pagy_json_tag(pagy, :nav, tags, pagy.sequels(steps))
end

Expand All @@ -48,7 +48,7 @@ def pagy_foundation_combo_nav_js(pagy, deprecated_id=nil, pagy_id: nil, link_ext
p_pages = pagy.pages
input = %(<input class="input-group-field cell shrink" type="number" min="1" max="#{p_pages}" value="#{p_page}" style="width: #{p_pages.to_s.length+1}rem; padding: 0 0.3rem; margin: 0 0.3rem;">)

%(<nav#{p_id} class="pagy-foundation-combo-nav-js" role="navigation" aria-label="Pagination"><div class="input-group">#{
%(<nav#{p_id} class="pagy-foundation-combo-nav-js" aria-label="Pagination"><div class="input-group">#{
if (p_prev = pagy.prev)
link.call p_prev, pagy_t('pagy.nav.prev'), 'style="margin-bottom: 0" aria-label="previous" class="prev button primary"'
else
Expand Down
4 changes: 2 additions & 2 deletions lib/pagy/extras/navs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def pagy_nav_js(pagy, deprecated_id=nil, pagy_id: nil, link_extra: '', steps: ni
'gap' => %(<span class="page gap">#{pagy_t 'pagy.nav.gap'}</span> ),
'after' => pagy_nav_next_html(pagy, link) }

html = %(<nav#{p_id} class="pagy-njs pagy-nav-js pagination" role="navigation" aria-label="pager"></nav>)
html = %(<nav#{p_id} class="pagy-njs pagy-nav-js pagination" aria-label="pager"></nav>)
html << pagy_json_tag(pagy, :nav, tags, pagy.sequels(steps))
end

Expand All @@ -30,7 +30,7 @@ def pagy_combo_nav_js(pagy, deprecated_id=nil, pagy_id: nil, link_extra: '')
p_pages = pagy.pages
input = %(<input type="number" min="1" max="#{p_pages}" value="#{p_page}" style="padding: 0; text-align: center; width: #{p_pages.to_s.length+1}rem;">)

%(<nav#{p_id} class="pagy-combo-nav-js pagination" role="navigation" aria-label="pager">#{
%(<nav#{p_id} class="pagy-combo-nav-js pagination" aria-label="pager">#{
pagy_nav_prev_html pagy, link
}<span class="pagy-combo-input" style="margin: 0 0.6rem;">#{
pagy_t 'pagy.combo_nav_js', page_input: input, count: p_page, pages: p_pages
Expand Down
6 changes: 3 additions & 3 deletions lib/pagy/extras/semantic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def pagy_semantic_nav(pagy, pagy_id: nil, link_extra: '')
p_id = %( id="#{pagy_id}") if pagy_id
link = pagy_link_proc(pagy, link_extra: %(class="item" #{link_extra}))

html = +%(<div#{p_id} class="pagy-semantic-nav ui pagination menu" aria-label="pager">)
html = +%(<div#{p_id} class="pagy-semantic-nav ui pagination menu">)
html << pagy_semantic_prev_html(pagy, link)
pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
html << case item
Expand All @@ -35,7 +35,7 @@ def pagy_semantic_nav_js(pagy, deprecated_id=nil, pagy_id: nil, link_extra: '',
'gap' => %(<div class="disabled item">#{pagy_t('pagy.nav.gap')}</div>),
'after' => pagy_semantic_next_html(pagy, link) }

html = %(<div#{p_id} class="pagy-njs pagy-semantic-nav-js ui pagination menu" role="navigation" aria-label="pager"></div>)
html = %(<div#{p_id} class="pagy-njs pagy-semantic-nav-js ui pagination menu" role="navigation"></div>)
html << pagy_json_tag(pagy, :nav, tags, pagy.sequels(steps))
end

Expand All @@ -48,7 +48,7 @@ def pagy_semantic_combo_nav_js(pagy, deprecated_id=nil, pagy_id: nil, link_extra
p_pages = pagy.pages
input = %(<input type="number" min="1" max="#{p_pages}" value="#{p_page}" style="padding: 0; text-align: center; width: #{p_pages.to_s.length+1}rem; margin: 0 0.3rem">)

%(<div#{p_id} class="pagy-semantic-combo-nav-js ui compact menu" role="navigation" aria-label="pager">#{
%(<div#{p_id} class="pagy-semantic-combo-nav-js ui compact menu" role="navigation">#{
pagy_semantic_prev_html pagy, link
}<div class="pagy-combo-input item">#{
pagy_t 'pagy.combo_nav_js', page_input: input, count: p_page, pages: p_pages
Expand Down
2 changes: 1 addition & 1 deletion lib/pagy/frontend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def pagy_nav(pagy, pagy_id: nil, link_extra: '')
p_prev = pagy.prev
p_next = pagy.next

html = +%(<nav#{p_id} class="pagy-nav pagination" role="navigation" aria-label="pager">)
html = +%(<nav#{p_id} class="pagy-nav pagination" aria-label="pager">)
html << if p_prev
%(<span class="page prev">#{link.call p_prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"'}</span> )
else
Expand Down
Loading

0 comments on commit f5e3482

Please sign in to comment.