diff options
author | Simon Rettberg | 2018-03-20 11:31:25 +0100 |
---|---|---|
committer | Simon Rettberg | 2018-03-20 11:31:25 +0100 |
commit | 3945fad76dc623e784cfb4fedee1978e99958a4e (patch) | |
tree | 19bedd4604e0c0949f4267ee8d5884a146dbff2d /modules-available/adduser/templates | |
parent | [dnbd3] Redesign proxy detail view, add image list (diff) | |
download | slx-admin-3945fad76dc623e784cfb4fedee1978e99958a4e.tar.gz slx-admin-3945fad76dc623e784cfb4fedee1978e99958a4e.tar.xz slx-admin-3945fad76dc623e784cfb4fedee1978e99958a4e.zip |
[adduser] Fix delete message, add translations
Diffstat (limited to 'modules-available/adduser/templates')
-rw-r--r-- | modules-available/adduser/templates/page-userlist.html | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/modules-available/adduser/templates/page-userlist.html b/modules-available/adduser/templates/page-userlist.html index 5b14f7e5..8d9c6de0 100644 --- a/modules-available/adduser/templates/page-userlist.html +++ b/modules-available/adduser/templates/page-userlist.html @@ -18,7 +18,7 @@ <tbody> {{#list}} <tr> - <td>{{login}}</td> + <td id="user-{{userid}}">{{login}}</td> <td>{{fullname}}</td> <td>{{phone}}</td> <td>{{email}}</td> @@ -27,8 +27,8 @@ <span class="glyphicon glyphicon-edit"></span> </button> {{^hide_delete}} - <button type="button" {{perms.user.remove.disabled}} class="btn btn-danger btn-xs" - data-target="#delete-modal" data-toggle="modal" onclick="$('#delete-userid').val({{userid}})"> + <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}}"> <span class="glyphicon glyphicon-trash"></span> </button> {{/hide_delete}} @@ -44,6 +44,19 @@ </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"> @@ -52,11 +65,10 @@ <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}}</h4> + <h4 class="modal-title" id="myModalLabel">{{lang_confirmDelete}}: <span id="delete-user-field"></span></h4> </div> <div class="modal-body"> - <p>{{lang_roleDeleteConfirm}}</p> - {{lang_numAssignedUsers}}: <span id="delete-role-users"></span> + <p>{{lang_userDeleteConfirm}}</p> </div> <div class="modal-footer"> <input type="hidden" name="action" value="deleteuser"> |