From 8a842913bbcb26ce7d4e539bc006ae5d270a86bc Mon Sep 17 00:00:00 2001 From: Jake Dahn Date: Mon, 20 Jun 2011 12:59:06 -0500 Subject: [PATCH] adding confirmation for all actions --- .../dashboard/templates/_delete_flavor.html | 2 +- .../dashboard/templates/_delete_image.html | 2 +- .../dashboard/templates/_delete_keypair.html | 2 +- .../dashboard/templates/_reboot.html | 2 +- .../templates/_service_toggle_enabled.html | 4 ++-- .../dashboard/templates/_tenant_delete.html | 2 +- .../dashboard/templates/_user_delete.html | 2 +- .../dashboard/templates/_user_toggle_enabled.html | 4 ++-- .../media/dashboard/js/application.js | 13 +++++++++++-- 9 files changed, 21 insertions(+), 12 deletions(-) diff --git a/openstack-dashboard/dashboard/templates/_delete_flavor.html b/openstack-dashboard/dashboard/templates/_delete_flavor.html index 58abf00da..f55a41ffe 100644 --- a/openstack-dashboard/dashboard/templates/_delete_flavor.html +++ b/openstack-dashboard/dashboard/templates/_delete_flavor.html @@ -4,5 +4,5 @@ {{hidden}} {% endfor %} - + diff --git a/openstack-dashboard/dashboard/templates/_delete_image.html b/openstack-dashboard/dashboard/templates/_delete_image.html index cd2272b3c..1f9d0868f 100644 --- a/openstack-dashboard/dashboard/templates/_delete_image.html +++ b/openstack-dashboard/dashboard/templates/_delete_image.html @@ -4,5 +4,5 @@ {{hidden}} {% endfor %} - + diff --git a/openstack-dashboard/dashboard/templates/_delete_keypair.html b/openstack-dashboard/dashboard/templates/_delete_keypair.html index f5e0f0068..79f5c29b5 100644 --- a/openstack-dashboard/dashboard/templates/_delete_keypair.html +++ b/openstack-dashboard/dashboard/templates/_delete_keypair.html @@ -4,5 +4,5 @@ {{hidden}} {% endfor %} - + diff --git a/openstack-dashboard/dashboard/templates/_reboot.html b/openstack-dashboard/dashboard/templates/_reboot.html index 3e2261cee..837161ed3 100644 --- a/openstack-dashboard/dashboard/templates/_reboot.html +++ b/openstack-dashboard/dashboard/templates/_reboot.html @@ -4,5 +4,5 @@ {{hidden}} {% endfor %} - + diff --git a/openstack-dashboard/dashboard/templates/_service_toggle_enabled.html b/openstack-dashboard/dashboard/templates/_service_toggle_enabled.html index e22fda150..499d910e9 100644 --- a/openstack-dashboard/dashboard/templates/_service_toggle_enabled.html +++ b/openstack-dashboard/dashboard/templates/_service_toggle_enabled.html @@ -6,7 +6,7 @@ {% endfor %} - + {% else %}
@@ -16,6 +16,6 @@ {% endfor %} - +
{% endif %} diff --git a/openstack-dashboard/dashboard/templates/_tenant_delete.html b/openstack-dashboard/dashboard/templates/_tenant_delete.html index cb1393065..10349b036 100644 --- a/openstack-dashboard/dashboard/templates/_tenant_delete.html +++ b/openstack-dashboard/dashboard/templates/_tenant_delete.html @@ -4,6 +4,6 @@ {{hidden}} {% endfor %} - + diff --git a/openstack-dashboard/dashboard/templates/_user_delete.html b/openstack-dashboard/dashboard/templates/_user_delete.html index 78b675a43..0a0cc76a5 100644 --- a/openstack-dashboard/dashboard/templates/_user_delete.html +++ b/openstack-dashboard/dashboard/templates/_user_delete.html @@ -4,5 +4,5 @@ {{hidden}} {% endfor %} - + diff --git a/openstack-dashboard/dashboard/templates/_user_toggle_enabled.html b/openstack-dashboard/dashboard/templates/_user_toggle_enabled.html index c5798716d..2c0b9dd68 100644 --- a/openstack-dashboard/dashboard/templates/_user_toggle_enabled.html +++ b/openstack-dashboard/dashboard/templates/_user_toggle_enabled.html @@ -5,7 +5,7 @@ {{hidden}} {% endfor %} - + {% else %}
@@ -14,6 +14,6 @@ {{hidden}} {% endfor %} - +
{% endif %} diff --git a/openstack-dashboard/media/dashboard/js/application.js b/openstack-dashboard/media/dashboard/js/application.js index 5cad67e5b..c40ddb4dc 100644 --- a/openstack-dashboard/media/dashboard/js/application.js +++ b/openstack-dashboard/media/dashboard/js/application.js @@ -14,16 +14,25 @@ $(function(){ // confirmation on deletion of items - $(".delete_link").click(function(e){ + $(".delete").click(function(e){ var response = confirm('Are you sure you want to delete the '+$(this).attr('title')+" ?"); return response; }) - $(".reboot_link").click(function(e){ + $(".reboot").click(function(e){ var response = confirm('Are you sure you want to reboot the '+$(this).attr('title')+" ?"); return response; }) + $(".disable").click(function(e){ + var response = confirm('Are you sure you want to disable the '+$(this).attr('title')+" ?"); + return response; + }) + + $(".enable").click(function(e){ + var response = confirm('Are you sure you want to enable the '+$(this).attr('title')+" ?"); + return response; + }) // disable multiple submissions when launching a form $("form").submit(function() {