From b84407ef466a1803df4ed3f17663fc9a0eb6d2b0 Mon Sep 17 00:00:00 2001 From: Romano Licker Date: Fri, 16 Dec 2011 17:02:37 +0100 Subject: [PATCH] [accessibility] adding hidden labels for invited and attended user checkboxes --- app/views/meetings/_form.html.erb | 22 +++++++++++++++++----- config/locales/de.yml | 4 +++- config/locales/en.yml | 4 +++- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/app/views/meetings/_form.html.erb b/app/views/meetings/_form.html.erb index 5d7b703921..b36677dbb2 100644 --- a/app/views/meetings/_form.html.erb +++ b/app/views/meetings/_form.html.erb @@ -18,12 +18,24 @@ "> <%=h user %> <% if @meeting.participants.present? && participant = @meeting.participants.detect{|p| p.user_id == user.id} -%> - <%= hidden_field_tag "meeting[participants_attributes][][id]", participant.id %> - <%= check_box_tag "meeting[participants_attributes][][invited]", 1, participant.invited? %> - <%= check_box_tag "meeting[participants_attributes][][attended]", 1, participant.attended? %> + <%= hidden_field_tag "meeting[participants_attributes][][id]", participant.id %> + + <%= label_tag "checkbox_invited_#{user.id}", user.name + " " + l(:description_invite), :class => "hidden-for-sighted" %> + <%= check_box_tag "meeting[participants_attributes][][invited]", 1, participant.invited?, :id => "checkbox_invited_#{user.id}" %> + + + <%= label_tag "checkbox_attended_#{user.id}", user.name + " " + l(:description_attended), :class => "hidden-for-sighted" %> + <%= check_box_tag "meeting[participants_attributes][][attended]", 1, participant.attended?, :id => "checkbox_attended_#{user.id}" %> + <% else -%> - <%= check_box_tag "meeting[participants_attributes][][invited]" %> - <%= check_box_tag "meeting[participants_attributes][][attended]" %> + + <%= label_tag "checkbox_invited_#{user.id}", user.name + " " + l(:description_invite), :class => "hidden-for-sighted" %> + <%= check_box_tag "meeting[participants_attributes][][invited]", value = "1", checked = false, :id => "checkbox_invited_#{user.id}" %> + + + <%= label_tag "checkbox_attended_#{user.id}", user.name + " " + l(:description_attended), :class => "hidden-for-sighted" %> + <%= check_box_tag "meeting[participants_attributes][][attended]", value = "1", checked = false, :id => "checkbox_attended_#{user.id}" %> + <% end -%> <% end -%> diff --git a/config/locales/de.yml b/config/locales/de.yml index 4be6a6ff32..9a52ca5c5d 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -32,4 +32,6 @@ de: text_agenda_for_meeting: 'Agenda für das Meeting "%{meeting}"' text_review_minutes: "%{author} hat das %{link} zur Einsicht freigegeben." text_minutes_for_meeting: 'Protokoll für das Meeting "%{meeting}"' - notice_successful_notification: "Benachrichtigung erfolgreich gesendet" \ No newline at end of file + notice_successful_notification: "Benachrichtigung erfolgreich gesendet" + description_invite: eingeladen + description_attended: teilgenommen diff --git a/config/locales/en.yml b/config/locales/en.yml index 4d5d13abcb..b618397902 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -32,4 +32,6 @@ en: text_agenda_for_meeting: 'agenda for the meeting "%{meeting}"' text_review_minutes: "%{author} has put the %{link} up for review." text_minutes_for_meeting: 'minutes for the meeting "%{meeting}"' - notice_successful_notification: "Notification sent successfully" \ No newline at end of file + notice_successful_notification: "Notification sent successfully" + description_invite: invited + description_attended: attended