diff options
author | stephenbroyer <stephen.broyer@sonarsource.com> | 2013-10-16 15:40:57 +0200 |
---|---|---|
committer | stephenbroyer <stephen.broyer@sonarsource.com> | 2013-10-23 17:53:44 +0200 |
commit | a997da1cf0e1890c7cb73c030d7af31bc8fd39d8 (patch) | |
tree | 4c9002f707202d1e5e4f44540a3c0a602e5dc024 /sonar-server/src | |
parent | ee5fe9ad9530ac5a63be6f8916df67bf778fb869 (diff) | |
download | sonarqube-a997da1cf0e1890c7cb73c030d7af31bc8fd39d8.tar.gz sonarqube-a997da1cf0e1890c7cb73c030d7af31bc8fd39d8.zip |
SONAR-4760 Use modal windows in Manual Rules pages
(delete rule with link_to_action)
Diffstat (limited to 'sonar-server/src')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/manual_rules_controller.rb | 4 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/manual_rules/index.html.erb | 12 |
2 files changed, 12 insertions, 4 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/manual_rules_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/manual_rules_controller.rb index 29f2ab1b8bd..2883246c6bb 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/manual_rules_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/manual_rules_controller.rb @@ -20,7 +20,6 @@ class ManualRulesController < ApplicationController before_filter :admin_required - verify :method => :delete, :only => [:delete], :redirect_to => {:action => :index} SECTION=Navigation::SECTION_CONFIGURATION @@ -81,6 +80,7 @@ class ManualRulesController < ApplicationController end def delete + verify_post_request access_denied unless is_admin? rule=Rule.manual_rule(params['id'].to_i) bad_request('Missing rule id') unless rule @@ -90,4 +90,4 @@ class ManualRulesController < ApplicationController end redirect_to :action => 'index' end -end
\ No newline at end of file +end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/manual_rules/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/manual_rules/index.html.erb index 1c7ad51f159..cd7a063581f 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/manual_rules/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/manual_rules/index.html.erb @@ -34,8 +34,16 @@ </td> <td class="right thin nowrap"> <a id="edit-<%= u(rule.key) -%>" class="open-modal link-action" href="<%=ApplicationController.root_context-%>/manual_rules/edit_form/<%= h rule.id -%>">Edit</a> - - <%= link_to 'Delete', {:action => 'delete', :id => rule.id}, {:confirm => message('are_you_sure'), :id => "delete_#{u(rule.key)}", :class => 'link-action link-red', :method => 'delete'} %> + </td> + <td> + <%= link_to_action message('deleteNew'), "#{ApplicationController.root_context}/manual_rules/delete/#{rule.id}", + :class => 'link-action link-red', + :id => "delete_#{rule.id}", + :confirm_button => message('delete'), + :confirm_title => 'Delete rule '+rule.name, + :confirm_msg => 'Warning : are you sure to delete this rule?', + :confirm_msg_params => [rule.name] + -%> </td> </tr> <% end %> |