Avoid rendenring an empty list in top links

We've had an accessibility error reported by the Spanish "Portal
Administración electrónica" (PAe). While I can't find any accessibility
rule saying empty lists should be avoided, it looks like some screen
readers report finding lists with 0 items, which is annoying.
This commit is contained in:
Javi Martín
2021-05-06 20:24:21 +02:00
parent 6d999559b3
commit dae4aae328
3 changed files with 30 additions and 1 deletions

View File

@@ -1,3 +1,3 @@
<ul class="no-bullet external-links">
<%= raw content_block("top_links", I18n.locale) %>
<%= raw top_links_content_block %>
</ul>

View File

@@ -1,3 +1,13 @@
class Layout::TopLinksComponent < ApplicationComponent
delegate :content_block, to: :helpers
def render?
top_links_content_block.present?
end
private
def top_links_content_block
content_block("top_links", I18n.locale)
end
end