[accessibility] labels, alt tags for rate edit views

pull/6827/head
Romano Licker 13 years ago
parent 40a17fc0b0
commit 0e9b82a807
  1. 10
      app/views/cost_types/_rate.rhtml
  2. 1
      app/views/cost_types/edit.rhtml
  3. 22
      app/views/hourly_rates/_rate.rhtml
  4. 1
      app/views/hourly_rates/edit.rhtml
  5. 1
      config/locales/de.yml
  6. 1
      config/locales/en.yml

@ -15,8 +15,14 @@
<% unless error_messages.blank? %><tr><td colspan="3"><%= error_messages %></td></tr><% end %>
<% fields_for prefix, rate do |rate_form| %>
<tr class="<%= classes %>" id="<%= id_prefix %>">
<td><%= rate_form.text_field :valid_from, :size => 10, :class => 'date', :index => id_or_index %><%= calendar_for("#{id_prefix}_valid_from") %></td>
<td class="currency"><%= rate_form.text_field :rate, :size => 7, :index => id_or_index, :value => rate.rate ? rate.rate.round(2) : "" %> <%= Setting.plugin_redmine_costs['costs_currency'] %></td>
<td>
<label class="hidden-for-sighted", for="<%= "#{id_prefix}_valid_from" %>"><%= l(:caption_valid_from) %></label>
<%= rate_form.text_field :valid_from, :size => 10, :class => 'date', :index => id_or_index %><%= calendar_for("#{id_prefix}_valid_from") %>
</td>
<td class="currency">
<label class="hidden-for-sighted", for="<%= "#{id_prefix}_rate" %>"><%= l(:caption_rate) %></label>
<%= rate_form.text_field :rate, :size => 7, :index => id_or_index, :value => rate.rate ? rate.rate.round(2) : "" %> <%= Setting.plugin_redmine_costs['costs_currency'] %>
</td>
<td><%= image_to_function 'delete.png', "var e = $('#{id_prefix}');parent=e.up();e.remove();recalculate_even_odd(parent)", {:alt => l(:button_delete), :title => l(:button_delete)}%></td>
</tr>
<% end %>

@ -37,6 +37,7 @@
</table>
<div>
<div>
<label class="hidden-for-sighted", for="add_rate_date" %>"><%= l(:description_date_for_new_rate) %></label>
<%= text_field_tag :add_rate_date, "", :size => 10, :value => Date.today %><%= calendar_for("add_rate_date") %>
<%= link_to_function l(:button_add_rate), "addRate($('add_rate_date'))", {:class => "icon icon-add"} %>
</div>

@ -1,7 +1,7 @@
<%-
index ||= "INDEX"
<%-
index ||= "INDEX"
new_or_existing = rate.new_record? ? 'new' : 'existing'
id_or_index = rate.new_record? ? index : rate.id
id_or_index = rate.new_record? ? index : rate.id
prefix = "user[#{new_or_existing}_rate_attributes][]"
id_prefix = "user_#{new_or_existing}_rate_attributes_#{id_or_index}"
name_prefix = "user[#{new_or_existing}_rate_attributes][#{id_or_index}]"
@ -9,14 +9,20 @@
@rate = rate
error_messages = error_messages_for 'rate'
-%>
-%>
<% unless error_messages.blank? %><tr><td colspan="3"><%= error_messages %></td></tr><% end %>
<% fields_for prefix, rate do |rate_form| %>
<tr class="<%= classes %>" id="<%= id_prefix %>">
<td><%= rate_form.text_field :valid_from, :size => 10, :class => 'date', :index => id_or_index %><%= calendar_for("#{id_prefix}_valid_from") %></td>
<td class="currency"><%= rate_form.text_field :rate, :size => 7, :index => id_or_index, :value => rate.rate ? rate.rate.round(2) : "" %> <%= Setting.plugin_redmine_costs['costs_currency'] %></td>
<td><%= image_to_function 'delete.png', "var e = $('#{id_prefix}');parent=e.up();e.remove();recalculate_even_odd(parent)"%></td>
<td>
<label class="hidden-for-sighted", for="<%= "#{id_prefix}_valid_from" %>"><%= l(:caption_valid_from) %></label>
<%= rate_form.text_field :valid_from, :size => 10, :class => 'date', :index => id_or_index %><%= calendar_for("#{id_prefix}_valid_from") %>
</td>
<td class="currency">
<label class="hidden-for-sighted", for="<%= "#{id_prefix}_rate" %>"><%= l(:caption_rate) %></label>
<%= rate_form.text_field :rate, :size => 7, :index => id_or_index, :value => rate.rate ? rate.rate.round(2) : "" %> <%= Setting.plugin_redmine_costs['costs_currency'] %>
</td>
<td><%= image_to_function 'delete.png', "var e = $('#{id_prefix}');parent=e.up();e.remove();recalculate_even_odd(parent)", :alt => l(:button_delete) %></td>
</tr>
<% end %>
<% end %>

@ -26,6 +26,7 @@
</table>
<div>
<div>
<label class="hidden-for-sighted", for="add_rate_date" %>"><%= l(:description_date_for_new_rate) %></label>
<%= text_field_tag :add_rate_date, "", :size => 10, :value => Date.today %><%= calendar_for("add_rate_date") %>
<%= link_to_function l(:button_add_rate), "addRate($('add_rate_date'))", {:class => "icon icon-add"} %>
</div>

@ -165,3 +165,4 @@ de:
caption_locked_on: "Gesperrt am"
caption_show_locked: "Gesperrte Typen anzeigen"
button_cancel_edit_budget: "Budget bearbeiten abbrechen"
description_date_for_new_rate: "Datum für neuen Satz"

@ -163,3 +163,4 @@ en:
caption_locked_on: "Locked on"
caption_show_locked: "Show locked types"
button_cancel_edit_budget: "Cancel editing budget"
description_date_for_new_rate: "Date for new rate"

Loading…
Cancel
Save