diff options
author | Simon Rettberg | 2019-03-25 11:46:50 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-03-25 11:46:50 +0100 |
commit | 03424ad19ac1bb42635a3d6653565aa0dc6ccf5a (patch) | |
tree | f3b068d5ca0aff6b897f98bb7eb7a5d097cec749 /modules-available/adduser/templates | |
parent | [dozmod] How about implementing runscript deletion (diff) | |
download | slx-admin-03424ad19ac1bb42635a3d6653565aa0dc6ccf5a.tar.gz slx-admin-03424ad19ac1bb42635a3d6653565aa0dc6ccf5a.tar.xz slx-admin-03424ad19ac1bb42635a3d6653565aa0dc6ccf5a.zip |
Introduce JS helper for bootstrap confirm dialogs on button-submit
Diffstat (limited to 'modules-available/adduser/templates')
-rw-r--r-- | modules-available/adduser/templates/page-userlist.html | 54 |
1 files changed, 8 insertions, 46 deletions
diff --git a/modules-available/adduser/templates/page-userlist.html b/modules-available/adduser/templates/page-userlist.html index 262553f6..af26ad8b 100644 --- a/modules-available/adduser/templates/page-userlist.html +++ b/modules-available/adduser/templates/page-userlist.html @@ -2,9 +2,9 @@ {{{pagenav}}} -<form method="get"> - <input type="hidden" name="do" value="adduser"> - <input type="hidden" name="show" value="edituser"> +<form method="post"> + <input type="hidden" name="action" value="deleteuser"> + <input type="hidden" name="token" value="{{token}}"> <table class="table stupidtable"> <thead> <tr> @@ -25,12 +25,12 @@ <td>{{phone}}</td> <td>{{email}}</td> <td class="text-nowrap"> - <button class="btn btn-primary btn-xs" {{perms.user.edit.disabled}} type="submit" name="userid" value="{{userid}}"> + <a class="btn btn-primary btn-xs" {{perms.user.edit.disabled}} href="?do=adduser&show=edituser&userid={{userid}}"> <span class="glyphicon glyphicon-edit"></span> - </button> + </a> {{^hide_delete}} - <button type="button" {{perms.user.remove.disabled}} class="btn btn-danger btn-xs del-user-btn" - data-target="#delete-modal" data-toggle="modal" data-user="{{userid}}"> + <button type="submit" {{perms.user.remove.disabled}} name="userid" value="{{userid}}" class="btn btn-danger btn-xs" + data-confirm="#confirm-delete" data-title="{{fullname}} ({{login}})"> <span class="glyphicon glyphicon-trash"></span> </button> {{/hide_delete}} @@ -46,42 +46,4 @@ </a> </div> </form> -<script> - document.addEventListener('DOMContentLoaded', function() { - $('.del-user-btn').click(function (e) { - var uid = $(this).data('user'); - if (!uid) { - alert('ERROR'); - return false; - } - $('#delete-userid').val(uid); - $('#delete-user-field').text($('#user-' + uid).text()); - }); - }); -</script> - -<!-- Modals --> -<div class ="modal fade" id="delete-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> - <div class="modal-dialog" role="document"> - <div class="modal-content"> - <form method="post"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> - <h4 class="modal-title" id="myModalLabel">{{lang_confirmDelete}}: <span id="delete-user-field"></span></h4> - </div> - <div class="modal-body"> - <p>{{lang_userDeleteConfirm}}</p> - </div> - <div class="modal-footer"> - <input type="hidden" name="action" value="deleteuser"> - <input type="hidden" name="token" value="{{token}}"> - <button type="button" class="btn btn-default" data-dismiss="modal">{{lang_cancel}}</button> - <button type="submit" id="delete-userid" name="userid" value="" class="btn btn-danger"> - <span class="glyphicon glyphicon-trash"></span> - {{lang_delete}} - </button> - </div> - </form> - </div> - </div> -</div>
\ No newline at end of file +<div class="hidden" id="confirm-delete">{{lang_userDeleteConfirm}}</div>
\ No newline at end of file |