aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2014-11-20 16:12:10 +0000
committerGareth Rees <gareth@mysociety.org>2014-11-20 16:15:25 +0000
commit5635a4671f6bbdf3cdbe4fc9c95e53da6ff39800 (patch)
tree070fc7265f30ae987c62e911d091ce8e7aa96809
parent02f74da1378365aee177d94ecae1ebe841132ee8 (diff)
Add JS confirmation for deleting heading/category
-rw-r--r--app/views/admin_public_body_categories/edit.html.erb3
-rw-r--r--app/views/admin_public_body_headings/edit.html.erb3
2 files changed, 4 insertions, 2 deletions
diff --git a/app/views/admin_public_body_categories/edit.html.erb b/app/views/admin_public_body_categories/edit.html.erb
index fc2b1591c..f83d0768d 100644
--- a/app/views/admin_public_body_categories/edit.html.erb
+++ b/app/views/admin_public_body_categories/edit.html.erb
@@ -23,7 +23,8 @@
<%= form_for @category, :url => admin_category_path(@category), :method => 'delete', :class => "form form-inline" do |f| %>
<%= f.submit "Destroy #{ @category.title }",
:title => @category.title,
- :class => "btn btn-danger" %>
+ :class => "btn btn-danger",
+ :confirm => 'Are you sure?' %>
<span class="help-block">
Destroying a category does not destroy the public authorities
associated with the category.
diff --git a/app/views/admin_public_body_headings/edit.html.erb b/app/views/admin_public_body_headings/edit.html.erb
index 66b95cabe..d4bc02562 100644
--- a/app/views/admin_public_body_headings/edit.html.erb
+++ b/app/views/admin_public_body_headings/edit.html.erb
@@ -23,7 +23,8 @@
<%= form_for @heading, :url => admin_heading_path(@heading), :method => 'delete', :class => "form form-inline" do |f| %>
<%= f.submit "Destroy #{ @heading.name }",
:name => @heading.name,
- :class => "btn btn-danger" %>
+ :class => "btn btn-danger",
+ :confirm => 'Are you sure?' %>
<span class="help-block">
<ul>
<li>Destroying a category heading only destroys the heading itself.</li>