Makes cost type list icons accessible

pull/6827/head
Hagen Schink 11 years ago committed by Till Breuer
parent 90b43ce696
commit 994fdfe354
  1. 11
      app/assets/javascripts/costs/cost_types.js
  2. 1
      app/assets/javascripts/costs/costs.js
  3. 6
      app/views/cost_types/_list.html.erb
  4. 2
      app/views/cost_types/_list_deleted.html.erb

@ -0,0 +1,11 @@
function submitForm(el) {
submitFormWithConfirmation(el, true);
}
function submitFormWithConfirmation(el, withConfirmation) {
if (!withConfirmation || confirm(I18n.t("js.text_are_you_sure"))) {
jQuery(el).parent().submit();
}
return false;
}

@ -1,4 +1,5 @@
//= require costs/cost_objects
//= require costs/cost_types
//= require costs/subform
//= require costs/rates
//= require costs/editinplace

@ -25,15 +25,15 @@
<%= form_for cost_type, :url => { :controller => '/cost_types', :action => 'set_rate', :id => cost_type } do |f| %>
<label class="hidden-for-sighted" for="<%= "rate_field_#{cost_type.id}" %>"><%= l(:caption_set_rate) %></label>
<%= f.text_field :rate, :value => "", :name => :rate, :size => 7, :id => "rate_field_#{cost_type.id}" %> <%= Setting.plugin_openproject_costs['costs_currency'] %>
<%= image_submit_tag "webalys/save.png", :alt => l(:caption_save_rate), :title => l(:caption_save_rate) %>
<a href="#" onclick="submitFormWithConfirmation(this, false);" class="submit_cost_type"><%= icon_wrapper('icon icon-save1', I18n.t(:button_save_rate)) %></a>
<% end %>
</td>
<%= content_tag :td, cost_type.is_default? ? image_tag('webalys/check.png', :alt => l(:general_text_Yes)) : "" %>
<%= content_tag :td, cost_type.is_default? ? icon_wrapper('icon icon-yes', I18n.t(:general_text_Yes)) : "" %>
<td>
<%= form_for cost_type, :url => toggle_delete_cost_type_path(cost_type),
:html => { :id => "delete_cost_type_#{cost_type.id}",
:class => "delete_cost_type" } do |f| %>
<%= image_submit_tag "webalys/locked.png", :alt => l(:button_lock), :title => l(:button_lock), :onclick => "return confirm('#{escape_javascript(l(:text_are_you_sure))}')" %>
<a href="#" onclick="submitForm(this);" class="submit_cost_type"><%= icon_wrapper('icon icon-locked', I18n.t(:button_lock)) %></a>
<% end %>
</td>
</tr>

@ -25,7 +25,7 @@
<%= form_for cost_type, :url => toggle_delete_cost_type_path(cost_type),
:html => { :id => "restore_cost_type_#{cost_type.id}",
:class => "restore_cost_type" } do |f| %>
<%= image_submit_tag "webalys/locked_un.png" , :alt => l(:button_unlock), :title => l(:button_unlock) %>
<a href="#" onclick="submitForm(this);" class="submit_cost_type"><%= icon_wrapper('icon icon-unlocked', I18n.t(:button_unlock)) %></a>
<% end %>
</td>
</tr>

Loading…
Cancel
Save