From ec5dda9f66f22f5de925332567fe524fbc978efb Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Wed, 4 Jan 2023 11:12:40 +0100 Subject: [PATCH] Fix screen reader classes for Bootstrap 5 --- app/views/inbox/_actions.html.haml | 4 ++-- app/views/inbox/_entry.html.haml | 2 +- app/views/layouts/_messages.html.haml | 2 +- app/views/modal/_ask.html.haml | 2 +- app/views/modal/_ban.html.haml | 2 +- app/views/modal/_comment_smiles.html.haml | 2 +- app/views/modal/_list.html.haml | 2 +- app/views/modal/_password.html.haml | 2 +- app/views/modal/_privileges.html.haml | 2 +- app/views/navigation/_desktop.html.haml | 2 +- app/views/navigation/_guest.html.haml | 2 +- app/views/navigation/_mobile.html.haml | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/views/inbox/_actions.html.haml b/app/views/inbox/_actions.html.haml index 5e4f22c9..69adbec0 100644 --- a/app/views/inbox/_actions.html.haml +++ b/app/views/inbox/_actions.html.haml @@ -10,7 +10,7 @@ .button-group.ms-1 %button.btn.btn-default{ title: t(".share.heading"), data: { toggle: :dropdown }, aria: { expanded: false } } %i.fa.fa-fw.fa-share-alt - %span.sr-only= t(".share.heading") + %span.visually-hidden= t(".share.heading") .dropdown-menu.dropdown-menu-right{ role: :menu } %a.dropdown-item{ href: "https://twitter.com/intent/tweet?text=Ask%20me%20anything%21&url=#{user_url(current_user)}", target: "_blank" } %i.fa.fa-fw.fa-twitter @@ -20,4 +20,4 @@ = t(".share.button", service: "Tumblr") %button.btn.btn-danger.ms-1{ type: :button, title: t(".actions.delete"), id: delete_id, disabled: (disabled ? :disabled : nil), data: { ib_count: inbox_count } } %i.fa.fa-fw.fa-trash-o - %span.sr-only= t(".actions.delete") + %span.visually-hidden= t(".actions.delete") diff --git a/app/views/inbox/_entry.html.haml b/app/views/inbox/_entry.html.haml index 91e010b2..100c8e30 100644 --- a/app/views/inbox/_entry.html.haml +++ b/app/views/inbox/_entry.html.haml @@ -30,7 +30,7 @@ = t("voc.delete") %button.btn.btn-default{ name: "ib-options", data: { ib_id: i.id, state: :hidden } } %i.fa.fa-cog - %span.sr-only= t(".options") + %span.visually-hidden= t(".options") .card-footer.d-none{ id: "ib-options-#{i.id}" } %h4= t(".sharing.heading") - if current_user.services.count.positive? diff --git a/app/views/layouts/_messages.html.haml b/app/views/layouts/_messages.html.haml index 413d2925..f226d3ab 100644 --- a/app/views/layouts/_messages.html.haml +++ b/app/views/layouts/_messages.html.haml @@ -6,5 +6,5 @@ .alert.alert-dismissible{ class: "alert-#{bootstrap_color key}", role: :alert } %button.close{ type: :button, data: { dismiss: :alert } } %span{ aria: { hidden: true } } × - %span.sr-only= t("voc.close") + %span.visually-hidden= t("voc.close") = value diff --git a/app/views/modal/_ask.html.haml b/app/views/modal/_ask.html.haml index 2589ed7b..c468c45e 100644 --- a/app/views/modal/_ask.html.haml +++ b/app/views/modal/_ask.html.haml @@ -5,7 +5,7 @@ %h5.modal-title#modal-ask-followers-label= t(".title") %button.close{ data: { dismiss: :modal }, type: :button } %span{ aria: { hidden: true } } × - %span.sr-only= t("voc.close") + %span.visually-hidden= t("voc.close") .modal-body .form-group.has-feedback %textarea.form-control{ name: "qb-all-question", placeholder: t(".placeholder"), data: { "character-count-target": "input" } } diff --git a/app/views/modal/_ban.html.haml b/app/views/modal/_ban.html.haml index 5c143ceb..dfd14b02 100644 --- a/app/views/modal/_ban.html.haml +++ b/app/views/modal/_ban.html.haml @@ -7,7 +7,7 @@ = t '.title' %button.close{ data: { dismiss: :modal }, type: :button } %span{ aria: { hidden: true } } × - %span.sr-only= t("voc.close") + %span.visually-hidden= t("voc.close") = bootstrap_form_tag(url: '/mod/ban', html: { method: :post, novalidate: :novalidate }) do |f| = f.hidden_field :user, value: user.screen_name - if user.bans.count > 1 diff --git a/app/views/modal/_comment_smiles.html.haml b/app/views/modal/_comment_smiles.html.haml index 04a4772e..db41a41b 100644 --- a/app/views/modal/_comment_smiles.html.haml +++ b/app/views/modal/_comment_smiles.html.haml @@ -5,7 +5,7 @@ %h5.modal-title#modal-commentsmile-label= t(".title") %button.close{ data: { dismiss: :modal }, type: :button } %span{ aria: { hidden: true } } × - %span.sr-only Close + %span.visually-hidden Close .modal-body - if comment.smiles.all.count.zero? = t(".none") diff --git a/app/views/modal/_list.html.haml b/app/views/modal/_list.html.haml index 5cf1d966..2c21a8e0 100644 --- a/app/views/modal/_list.html.haml +++ b/app/views/modal/_list.html.haml @@ -5,7 +5,7 @@ %h5.modal-title#modal-list-memberships-label= t(".title") %button.close{ data: { dismiss: :modal }, type: :button } %span{ aria: { hidden: true } } × - %span.sr-only= t("voc.close") + %span.visually-hidden= t("voc.close") %div{ role: :tabpanel } %ul.nav.nav-tabs.mt-1{ role: :tablist } %li.nav-item{ role: "presentation" } diff --git a/app/views/modal/_password.html.haml b/app/views/modal/_password.html.haml index 70e22835..5174cab6 100644 --- a/app/views/modal/_password.html.haml +++ b/app/views/modal/_password.html.haml @@ -5,7 +5,7 @@ %h5.modal-title#modal-passwd-label= t(".title") %button.close{ data: { dismiss: :modal }, type: :button } %span{ aria: { hidden: true } } × - %span.sr-only= t("voc.close") + %span.visually-hidden= t("voc.close") .modal-body = f.password_field :current_password, autocomplete: "current-password" .modal-footer diff --git a/app/views/modal/_privileges.html.haml b/app/views/modal/_privileges.html.haml index d03f9c6b..c8397c90 100644 --- a/app/views/modal/_privileges.html.haml +++ b/app/views/modal/_privileges.html.haml @@ -6,7 +6,7 @@ = t(".title", user: user.screen_name) %button.close{ data: { dismiss: :modal }, type: :button } %span{ aria: { hidden: true } } × - %span.sr-only= t("voc.close") + %span.visually-hidden= t("voc.close") %ul.list-group - if current_user.has_cached_role?(:administrator) = render "modal/privileges/item", privilege: "moderator", description: t(".role.moderator"), user: user diff --git a/app/views/navigation/_desktop.html.haml b/app/views/navigation/_desktop.html.haml index a1937d5d..0db52825 100644 --- a/app/views/navigation/_desktop.html.haml +++ b/app/views/navigation/_desktop.html.haml @@ -23,7 +23,7 @@ %i.fa.fa-bell-o - else %i.fa.fa-bell - %span.sr-only= t("navigation.notifications") + %span.visually-hidden= t("navigation.notifications") %span.badge= notification_count = render 'navigation/dropdown/notifications', notifications: notifications, size: "desktop" %li.nav-item.d-none.d-sm-block{ data: { toggle: 'tooltip', placement: 'bottom' }, title: t('.ask_question') } diff --git a/app/views/navigation/_guest.html.haml b/app/views/navigation/_guest.html.haml index cc76123b..50c89072 100644 --- a/app/views/navigation/_guest.html.haml +++ b/app/views/navigation/_guest.html.haml @@ -6,7 +6,7 @@ - else = APP_CONFIG["site_name"] %button.navbar-toggler{ data: { target: '#j2-main-navbar-collapse', toggle: :collapse }, type: :button } - %span.sr-only= t("navigation.toggle") + %span.visually-hidden= t("navigation.toggle") %span.navbar-toggler-icon .collapse.navbar-collapse#j2-main-navbar-collapse %ul.nav.navbar-nav.ms-auto diff --git a/app/views/navigation/_mobile.html.haml b/app/views/navigation/_mobile.html.haml index 37bec6d4..d2e666bc 100644 --- a/app/views/navigation/_mobile.html.haml +++ b/app/views/navigation/_mobile.html.haml @@ -13,7 +13,7 @@ %li.nav-item %a.nav-link{ href: '#', data: { toggle: 'dropdown', target: '#rs-mobile-nav-notifications' }, aria: { controls: 'rs-mobile-nav-notifications', expanded: 'false' } } %i.fa{ class: "fa-#{notifications_icon}" } - %span.sr-only= t("navigation.notifications") + %span.visually-hidden= t("navigation.notifications") %span.badge.badge-pill.badge-primary= notification_count %li.nav-item.profile--image-dropdown %a.nav-link{ href: '#', data: { toggle: 'dropdown', target: '#rs-mobile-nav-profile' }, aria: { controls: 'rs-mobile-nav-profile', expanded: 'false' } }