summaryrefslogtreecommitdiffstats
path: root/modules-available/adduser
diff options
context:
space:
mode:
authorSimon Rettberg2018-03-20 11:31:25 +0100
committerSimon Rettberg2018-03-20 11:31:25 +0100
commit3945fad76dc623e784cfb4fedee1978e99958a4e (patch)
tree19bedd4604e0c0949f4267ee8d5884a146dbff2d /modules-available/adduser
parent[dnbd3] Redesign proxy detail view, add image list (diff)
downloadslx-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')
-rw-r--r--modules-available/adduser/lang/de/messages.json3
-rw-r--r--modules-available/adduser/lang/de/template-tags.json4
-rw-r--r--modules-available/adduser/lang/en/messages.json3
-rw-r--r--modules-available/adduser/lang/en/template-tags.json4
-rw-r--r--modules-available/adduser/templates/page-userlist.html24
5 files changed, 32 insertions, 6 deletions
diff --git a/modules-available/adduser/lang/de/messages.json b/modules-available/adduser/lang/de/messages.json
index 0ab4571f..207e8056 100644
--- a/modules-available/adduser/lang/de/messages.json
+++ b/modules-available/adduser/lang/de/messages.json
@@ -1,8 +1,11 @@
{
"adduser-success": "Benutzer erfolgreich hinzugef\u00fcgt",
+ "cannot-delete-1-self": "Sie k\u00f6nnen nicht den Benutzer mit der ID 1 oder sich selbst l\u00f6schen",
"db-error": "Datenbankfehler: {{0}}",
"password-changed": "Passwort ge\u00e4ndert",
"password-mismatch": "Passwort und Passwortbest\u00e4tigung stimmen nicht \u00fcberein",
+ "roles-updated": "Rollen aktualisiert",
+ "user-deleted": "Benutzer {{0}} gel\u00f6scht",
"user-edited": "Benutzerdaten wurden ge\u00e4ndert",
"user-not-found": "Benutzer mit ID {{0}} nicht gefunden"
} \ No newline at end of file
diff --git a/modules-available/adduser/lang/de/template-tags.json b/modules-available/adduser/lang/de/template-tags.json
index 0b6b2530..31a7871e 100644
--- a/modules-available/adduser/lang/de/template-tags.json
+++ b/modules-available/adduser/lang/de/template-tags.json
@@ -1,8 +1,10 @@
{
"lang_addUser": "Nutzer hinzuf\u00fcgen",
+ "lang_assignRoles": "Rollen zuweisen",
"lang_changeLoginHint": "Sie k\u00f6nnen den Namen, den der Nutzer beim Login angeben muss, \u00e4ndern. Dies ist nur bei lokalen Nutzern m\u00f6glich, die nicht \u00fcber LDAP\/AD authentifiziert werden.",
"lang_changeOwnPasswordHint": "Ihr eigenes Passwort k\u00f6nnen Sie \u00fcber den Button \"Passwort \u00e4ndern\" im Men\u00fc \u00e4ndern.",
"lang_changePassword": "Neues Passwort",
+ "lang_confirmDelete": "L\u00f6schen best\u00e4tigen",
"lang_confirmation": "Wiederholen",
"lang_createUser": "Benutzer anlegen",
"lang_editUser": "Benutzer bearbeiten",
@@ -11,6 +13,8 @@
"lang_login": "Login",
"lang_name": "Name",
"lang_phone": "Telefon",
+ "lang_role": "Rolle",
+ "lang_userDeleteConfirm": "M\u00f6chten Sie diesen Benutzer wirklich l\u00f6schen?",
"lang_userManagement": "Benutzerverwaltung",
"lang_userlist": "Benutzerliste"
} \ No newline at end of file
diff --git a/modules-available/adduser/lang/en/messages.json b/modules-available/adduser/lang/en/messages.json
index 69af3227..d55e0ec6 100644
--- a/modules-available/adduser/lang/en/messages.json
+++ b/modules-available/adduser/lang/en/messages.json
@@ -1,8 +1,11 @@
{
"adduser-success": "User successfully added",
+ "cannot-delete-1-self": "Cannot delete user with ID 1 or yourself",
"db-error": "Database error: {{0}}",
"password-changed": "Password changed",
"password-mismatch": "Password and password confirmation do not match",
+ "roles-updated": "Roles have been updated",
+ "user-deleted": "Deleted user {{0}}",
"user-edited": "User data has been updated",
"user-not-found": "User with ID {{0}} not found"
} \ No newline at end of file
diff --git a/modules-available/adduser/lang/en/template-tags.json b/modules-available/adduser/lang/en/template-tags.json
index 2c9b8b53..4fe03711 100644
--- a/modules-available/adduser/lang/en/template-tags.json
+++ b/modules-available/adduser/lang/en/template-tags.json
@@ -1,8 +1,10 @@
{
"lang_addUser": "Add user",
+ "lang_assignRoles": "Assign roles",
"lang_changeLoginHint": "You can change the login identifier used for logging in. This is only enabled for local acounts that are not linked to LDAP\/AD servers.",
"lang_changeOwnPasswordHint": "You can change your own password by clicking the \"change password\" button in the menu.",
"lang_changePassword": "Change password",
+ "lang_confirmDelete": "Confirm delete",
"lang_confirmation": "Confirm Password",
"lang_createUser": "Create User",
"lang_editUser": "Edit user",
@@ -11,6 +13,8 @@
"lang_login": "Login",
"lang_name": "Name",
"lang_phone": "Phone",
+ "lang_role": "Role",
+ "lang_userDeleteConfirm": "Do you want to delete this user?",
"lang_userManagement": "User management",
"lang_userlist": "User list"
} \ No newline at end of file
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">&times;</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">