update_key.keys_will_be_updated_as_follows=The resources will be updated as follows (updated keys in bold):
update_key.duplicate_key=Duplicate key
update_key.bulk_update_confirmation_page=Do you really want to perform the bulk update on project keys?
+update_key.bulk_update_impossible=Bulk update can not be performed
+update_key.no_key_to_update=No key contains the string to replace ("{0}").
#------------------------------------------------------------------------------
redirect_to :action => 'key', :id => @project.id
else
@key_check_results = java_facade.checkModuleKeysBeforeRenaming(@project.id, @old_prefix, @new_prefix)
- @can_update = true
+ @can_update = false
+ @duplicate_key_found = false
@key_check_results.each do |key, value|
- @can_update = false if value=="#duplicate_key#"
+ if value=="#duplicate_key#"
+ @duplicate_key_found = true
+ else
+ @can_update = true
+ end
end
+ @can_update = false if @duplicate_key_found
end
end
<%= message('update_key.current_key_for_project_x_is_x', :params => [@project.name, @project.key]) -%>
</p>
<br/>
- <% form_tag( {:action => 'prepare_key_bulk_update', :id => @project.id }) do -%>
+ <% form_tag( {:action => 'prepare_key_bulk_update', :id => @project.id }, :onsubmit => "update_launched();$('loading_bulk_update').show();") do -%>
<table>
<tr>
<td style="padding-right: 20px"><%= message('update_key.replace') -%>:</td>
<tr>
<td></td>
<td style="padding-top: 5px">
- <%= submit_tag message('update_key.rename'), :id => 'bulk_update_button', :class => 'action',
- :onclick => "update_launched();$('loading_bulk_update').show();" %>
+ <%= submit_tag message('update_key.rename'), :id => 'bulk_update_button', :class => 'action' -%>
<span class="loading" id="loading_bulk_update" style="display: none; padding: 3px 10px;"></span>
</td>
<td></td>
}
</script>
- <h1><%= message('update_key.bulk_update_confirmation_page') -%></h1>
+ <h1><%= @can_update ? message('update_key.bulk_update_confirmation_page') : message('update_key.bulk_update_impossible') -%></h1>
<br/>
<p>
- <%= @can_update ? message('update_key.keys_will_be_updated_as_follows') : message('update_key.cant_update_because_duplicate_keys', :params => [@old_prefix, @new_prefix]) -%>
+ <% if @can_update %>
+ <%= message('update_key.keys_will_be_updated_as_follows') -%>
+ <% else %>
+ <% if @duplicate_key_found %>
+ <%= message('update_key.cant_update_because_duplicate_keys', :params => [@old_prefix, @new_prefix]) -%>
+ <% else %>
+ <%= message('update_key.no_key_to_update', :params => @old_prefix) -%>
+ <% end %>
+ <% end %>
</p>
<table class="data" style="width:1%; margin-top: 10px">
</table>
<% if @can_update %>
- <% form_tag( {:action => 'perform_key_bulk_update', :id => @project.id }) do -%>
+ <% form_tag( {:action => 'perform_key_bulk_update', :id => @project.id }, :onsubmit => "update_launched();$('loading_bulk_update').show();") do -%>
<input type="hidden" value="<%= @project.id -%>" name="id" id="project_id">
<input type="hidden" value="<%= @old_prefix -%>" name="old_prefix" id="old_prefix">
<input type="hidden" value="<%= @new_prefix -%>" name="new_prefix" id="new_prefix">
<br/>
- <%= submit_tag message('update_key.rename'), :id => 'bulk_update_button', :class => 'action',
- :onclick => "update_launched();$('loading_bulk_update').show();" %>
+ <%= submit_tag message('update_key.rename'), :id => 'bulk_update_button', :class => 'action' -%>
<a href="<%= url_for :action => 'key', :id => @project.key -%>"><%= message('cancel') -%></a>
<span class="loading" id="loading_bulk_update" style="display: none; padding: 3px 10px;"></span>
<% end %>