From 183f289e17f7dbda1c63774572a65c244768f292 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Tue, 19 Aug 2025 15:39:14 +0200 Subject: [PATCH] fix: change implementation of sr-only spans so that they are read --- .../header/_main_links_desktop.html.erb | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/decidim-core/app/views/layouts/decidim/header/_main_links_desktop.html.erb b/decidim-core/app/views/layouts/decidim/header/_main_links_desktop.html.erb index ebc5b96eadec5..71e1d1a898265 100644 --- a/decidim-core/app/views/layouts/decidim/header/_main_links_desktop.html.erb +++ b/decidim-core/app/views/layouts/decidim/header/_main_links_desktop.html.erb @@ -30,12 +30,6 @@ <% unread_data = current_user_unread_data %> <% if unread_data[:unread_items] %> <%= content_tag :span, "", class: "main-bar__notification", data: unread_data %> - <% if unread_data[:unread_notifications] %> - <%= content_tag :span, t("layouts.decidim.user_menu.unread_notifications"), class: "sr-only" %> - <% end %> - <% if unread_data[:unread_conversations] %> - <%= content_tag :span, t("layouts.decidim.user_menu.unread_conversations"), class: "sr-only" %> - <% end %> <% end %> <% if current_user.avatar.attached? %> @@ -44,11 +38,23 @@ current_user.attached_uploader(:avatar).variant_url(:thumb), alt: t("decidim.author.avatar", name: decidim_sanitize(current_user.avatar.name)) ) %> + <% if unread_data[:unread_notifications] %> + <%= content_tag :span, t("layouts.decidim.user_menu.unread_notifications"), class: "sr-only" %> + <% end %> + <% if unread_data[:unread_conversations] %> + <%= content_tag :span, t("layouts.decidim.user_menu.unread_conversations"), class: "sr-only" %> + <% end %> <% else %> <%= text_initials(current_user.name) %> + <% if unread_data[:unread_notifications] %> + <%= content_tag :span, t("layouts.decidim.user_menu.unread_notifications"), class: "sr-only" %> + <% end %> + <% if unread_data[:unread_conversations] %> + <%= content_tag :span, t("layouts.decidim.user_menu.unread_conversations"), class: "sr-only" %> + <% end %> <% end %>