summaryrefslogtreecommitdiffstats
path: root/modules-available/dozmod/templates/userlist.html
diff options
context:
space:
mode:
authorSimon Rettberg2016-08-16 18:05:29 +0200
committerSimon Rettberg2016-08-16 18:05:29 +0200
commitbf3bb604fa82e0738fdb21d9bd4fd07000ed35bd (patch)
treed89f1aff06f9374ea44587542c3fd319cc727187 /modules-available/dozmod/templates/userlist.html
parent[render] Restore debug template generation (diff)
downloadslx-admin-bf3bb604fa82e0738fdb21d9bd4fd07000ed35bd.tar.gz
slx-admin-bf3bb604fa82e0738fdb21d9bd4fd07000ed35bd.tar.xz
slx-admin-bf3bb604fa82e0738fdb21d9bd4fd07000ed35bd.zip
[dozmod] Implement action log subpage
Diffstat (limited to 'modules-available/dozmod/templates/userlist.html')
-rw-r--r--modules-available/dozmod/templates/userlist.html34
1 files changed, 20 insertions, 14 deletions
diff --git a/modules-available/dozmod/templates/userlist.html b/modules-available/dozmod/templates/userlist.html
index 79d4848b..7dd84fd4 100644
--- a/modules-available/dozmod/templates/userlist.html
+++ b/modules-available/dozmod/templates/userlist.html
@@ -22,7 +22,7 @@
<tbody>
{{#users}}
<tr>
- <td class="text-left slx-nowrap">{{lastname}}, {{firstname}}</td>
+ <td class="text-left slx-nowrap"><a href="?do=dozmod&amp;section=actionlog&amp;action=showuser&amp;uuid={{userid}}">{{lastname}}, {{firstname}}</a></td>
<td class="text-left slx-nowrap">{{orgname}}</td>
<td class="text-left slx-nowrap">{{lastlogin}}</td>
<td class="text-left slx-nowrap"><a href="mailto:{{email}}">{{email}}</a></td>
@@ -44,29 +44,35 @@ function setu(action, el, uid) {
var v = el.checked ? '1' : '0';
var old = el.checked == true;
box.css('display', 'none');
- $.post('?do=DozMod', { token: TOKEN, action: action, userid: uid, value: v }).done(function (data) {
- if (data != 1 && data != 0) {
+ $.post('?do=DozMod', { token: TOKEN, section: 'users', action: action, userid: uid, value: v }).done(function (data) {
+
+ if (data !== '1' && data !== '0') {
el.checked = !old;
box.parent().css('background-color', 'red !important');
} else {
el.checked = (data == 1);
+ box.parent().css('background-color', '');
+ /* show success notification */
+ $notification = $('<span></span>')
+ .addClass('glyphicon glyphicon-saved')
+ .css('color', '#2ecc71')
+ .css('width', '0px')
+ .css('position', 'relative')
+ .css('right', '20px')
+ .hide();
+ box.before($notification);
+ $notification.fadeIn('fast', function () {
+ $notification.fadeOut('slow', function () { $notification.remove() });
+ });
}
- /* show success notification */
- $notification = $('<span></span>')
- .addClass('glyphicon glyphicon-saved')
- .css('color', '#2ecc71')
- .css('width', '0px')
- .css('position', 'relative')
- .css('right', '20px')
- .hide();
- box.before($notification);
- $notification.fadeIn('slow', function () {$notification.fadeOut('fast');});
-
box.css('display', '');
+
}).fail(function() {
+
el.checked = !old;
box.parent().css('background-color', 'red !important');
box.css('display', '');
+
});
}