Fix screen reader classes for Bootstrap 5

This commit is contained in:
Andreas Nedbal 2023-01-04 11:12:40 +01:00 committed by Andreas Nedbal
parent 34dbaad28e
commit ec5dda9f66
12 changed files with 13 additions and 13 deletions

View File

@ -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")

View File

@ -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?

View File

@ -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

View File

@ -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" } }

View File

@ -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

View File

@ -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")

View File

@ -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" }

View File

@ -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

View File

@ -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

View File

@ -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') }

View File

@ -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

View File

@ -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' } }