Fix failing cuke

/openproject-costs/features/cost_types/deletion.feature:34
pull/6827/head
Hagen Schink 10 years ago
parent 041ec6a51b
commit ff74543a65
  1. 8
      app/assets/javascripts/costs/cost_types.js
  2. 4
      app/views/cost_types/_list.html.erb
  3. 2
      app/views/cost_types/_list_deleted.html.erb
  4. 2
      app/views/hooks/costs/_view_projects_settings_members_table_row.html.erb

@ -17,11 +17,13 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//++
function submitForm(el) {
submitFormWithConfirmation(el, true);
function submitForm(event, el) {
submitFormWithConfirmation(event, el, true);
}
function submitFormWithConfirmation(el, withConfirmation) {
function submitFormWithConfirmation(event, el, withConfirmation) {
event.preventDefault();
if (!withConfirmation || confirm(I18n.t("js.text_are_you_sure"))) {
jQuery(el).parent().submit();
}

@ -45,7 +45,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<%= 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'] %>
<a href="#" onclick="submitFormWithConfirmation(this, false);" class="submit_cost_type"><%= icon_wrapper('icon icon-save1', I18n.t(:caption_save_rate)) %></a>
<a href="#" onclick="submitFormWithConfirmation(event, this, false);" class="submit_cost_type"><%= icon_wrapper('icon icon-save1', I18n.t(:caption_save_rate)) %></a>
<% end %>
</td>
<%= content_tag :td, cost_type.is_default? ? icon_wrapper('icon icon-yes', I18n.t(:general_text_Yes)) : "" %>
@ -53,7 +53,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<%= 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| %>
<a href="#" onclick="submitForm(this);" class="submit_cost_type"><%= icon_wrapper('icon icon-locked', I18n.t(:button_lock)) %></a>
<a href="#" onclick="submitForm(event, this);" class="submit_cost_type"><%= icon_wrapper('icon icon-locked', I18n.t(:button_lock)) %></a>
<% end %>
</td>
</tr>

@ -45,7 +45,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<%= 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| %>
<a href="#" onclick="submitForm(this);" class="submit_cost_type"><%= icon_wrapper('icon icon-unlocked', I18n.t(:button_unlock)) %></a>
<a href="#" onclick="submitForm(event, this);" class="submit_cost_type"><%= icon_wrapper('icon icon-unlocked', I18n.t(:button_unlock)) %></a>
<% end %>
</td>
</tr>

@ -43,7 +43,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<%= remote_form_for :rate, :url => { :controller => '/hourly_rates', :action => 'set_rate', :id => member.user, :project_id => project}, :method => :posts do |f| %>
<label class="hidden-for-sighted", for="rate_text_field_for_<%= member.user.id %>"><%= l(:caption_set_rate) %></label>
<%= f.text_field :rate, :value => "", :name => :rate, :size => 7, :id => "rate_text_field_for_#{member.user.id}"%> <%= Setting.plugin_openproject_costs['costs_currency'] %>
<a href="#" onclick="submitFormWithConfirmation(this, false);" class="set_current_rate no-decoration-on-hover"><%= icon_wrapper('icon icon-save1', I18n.t(:button_save)) %></a>
<a href="#" onclick="submitFormWithConfirmation(event, this, false);" class="set_current_rate no-decoration-on-hover"><%= icon_wrapper('icon icon-save1', I18n.t(:button_save)) %></a>
<% end %>
</td>
<% else %>

Loading…
Cancel
Save