diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2012-07-17 14:42:52 +0200 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2012-07-17 14:42:52 +0200 |
commit | 271bfcbb46f87cddac93072edcfeeae41e633aa6 (patch) | |
tree | 421ca46f9b806027b7ed270ed7fa51433c515c48 /sonar-server | |
parent | e2f4d95803eb6b63ddfeb323caa18660be56f013 (diff) | |
download | sonarqube-271bfcbb46f87cddac93072edcfeeae41e633aa6.tar.gz sonarqube-271bfcbb46f87cddac93072edcfeeae41e633aa6.zip |
SONAR-2614 Improve bulk deletion page
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/bulk_deletion/index.html.erb | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/bulk_deletion/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/bulk_deletion/index.html.erb index 0223f1fd039..37e2d4c06bd 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/bulk_deletion/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/bulk_deletion/index.html.erb @@ -29,14 +29,14 @@ <% form_remote_tag( :url => {:action => 'delete_resources'}, :loading => "window.location='#{url_for :action => 'pending_deletions'}';") do %> - <table class="data"> + <table class="data" id="resources-to-delete"> <tfoot> <tr> <td colspan="2"><%= paginate @resources, {:page_size => page_size} %></td> </tr> <tr> <td colspan="2"> - <%= submit_tag message('delete'), :id => 'delete_resources', :class => 'action red-button', :confirm => message('bulk_deletion.sure_to_delete_the_resources') %> + <input id="delete_resources" class="action red-button" type="submit" value="<%= message('delete') -%>" onclick="return checkBeforeDeleting();" name="commit"> </td> </tr> </tfoot> @@ -68,6 +68,23 @@ <% end %> <script> + function checkBeforeDeleting() { + var resource_selected = false; + $$("#resources-to-delete input[type='checkbox']").each(function(input) { + if (input.checked) resource_selected = true; + }); + if (!resource_selected) { + alert("<%= message('bulk_deletion.please_select_at_least_one_resource') -%>"); + return false; + } + + if (!confirm("<%= message('bulk_deletion.sure_to_delete_the_resources') -%>")) { + return false; + } + + return true; + } + function selectOrDeselect() { var status = $('r-all').checked; $$('tbody input').each(function(input) { |