Use aria-label in admin table actions

This way screen reader users will know which record they're going to
access when focusing on a link to a certain action. Otherwise they'd
hear something like "Edit, link", and they wouldn't know which record
they'll end up editing if they follow the link.
This commit is contained in:
Javi Martín
2021-08-17 22:29:11 +02:00
parent 6a2c01b119
commit 2b4b2f3442
13 changed files with 189 additions and 5 deletions

View File

@@ -3,6 +3,8 @@ class Poll
belongs_to :booth
belongs_to :poll
delegate :name, to: :booth
before_destroy :destroy_poll_shifts, only: :destroy
has_many :officer_assignments, dependent: :destroy

View File

@@ -16,6 +16,10 @@ class Poll
after_create :create_officer_assignments
before_destroy :destroy_officer_assignments
def title
"#{I18n.t("admin.poll_shifts.#{task}")} #{officer_name} #{I18n.l(date.to_date, format: :long)}"
end
def persist_data
self.officer_name = officer.name
self.officer_email = officer.email