On 10/27/2010 09:45 AM, [email protected] wrote: > From: Ladislav Martincik<[email protected]> > > This patch is fixing BZ#646396. > - When deleting user action is triggered and no user selected javascript will > popu alert message "please select any user to delete" > - If user select normal confirm box will appear > --- > src/app/views/users/index.haml | 15 ++++++++++++--- > 1 files changed, 12 insertions(+), 3 deletions(-) > > diff --git a/src/app/views/users/index.haml b/src/app/views/users/index.haml > index 111375f..d0a5d7e 100644 > --- a/src/app/views/users/index.haml > +++ b/src/app/views/users/index.haml > @@ -8,13 +8,13 @@ > = submit_tag "edit", :class => "submit linkbutton" > %dd.delete > %span > - = submit_tag "delete", :class => "submit linkbutton", :confirm => > "Are you sure you want to delete this user?" > + = submit_tag "delete", :id => 'delete_button', :class => "submit > linkbutton" > %dd.add > %span > = link_to "create", new_user_url > > .grid_13 > - %table > + %table{:id => 'users_table'} > %thead > %tr > %th > @@ -39,5 +39,14 @@ > > :javascript > $(document).ready(function () { > - //$("input[type='checkbox']").buttonSensitivity().change(); > + $('#delete_button').click(function(e) { > + if ($("#users_table inp...@type=radio]:checked").length == 0) { > + alert('please select any user to be deleted'); > + e.preventDefault(); > + } else { > + if (!confirm("Are you sure you want to delete this user?")) { > + e.preventDefault(); > + } > + } > + }); > });
ACK _______________________________________________ deltacloud-devel mailing list [email protected] https://fedorahosted.org/mailman/listinfo/deltacloud-devel
