diff options
author | Simon Rettberg | 2016-08-16 18:05:29 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-08-16 18:05:29 +0200 |
commit | bf3bb604fa82e0738fdb21d9bd4fd07000ed35bd (patch) | |
tree | d89f1aff06f9374ea44587542c3fd319cc727187 /modules-available/dozmod/templates/orglist.html | |
parent | [render] Restore debug template generation (diff) | |
download | slx-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/orglist.html')
-rw-r--r-- | modules-available/dozmod/templates/orglist.html | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/modules-available/dozmod/templates/orglist.html b/modules-available/dozmod/templates/orglist.html index 34fa039c..bb002b3b 100644 --- a/modules-available/dozmod/templates/orglist.html +++ b/modules-available/dozmod/templates/orglist.html @@ -35,33 +35,35 @@ function seto(action, el, orgid) { var v = el.checked ? '1' : '0'; var old = el.checked == true; box.css('display', 'none'); - $.post('?do=DozMod', { token: TOKEN, action: action, organizationid: orgid, value: v }).done(function (data) { - if (data != 1 && data != 0) { + $.post('?do=DozMod', { token: TOKEN, section: 'users', action: action, organizationid: orgid, 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() }); + }); } box.css('display', ''); - /* 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');}); - - - - }).fail(function() { + el.checked = !old; box.parent().css('background-color', 'red !important'); box.css('display', ''); + }); } |