diff options
author | Simon Rettberg | 2015-09-10 18:52:17 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-09-10 18:52:17 +0200 |
commit | e529743b9c18838cc6eedbaa85c17456f9dbb279 (patch) | |
tree | 772664806316f4d6d8fded117bdf2ce086c87135 /templates | |
parent | Add dozmod config page (diff) | |
download | slx-admin-e529743b9c18838cc6eedbaa85c17456f9dbb279.tar.gz slx-admin-e529743b9c18838cc6eedbaa85c17456f9dbb279.tar.xz slx-admin-e529743b9c18838cc6eedbaa85c17456f9dbb279.zip |
Add org list to dozmod module
Diffstat (limited to 'templates')
-rw-r--r-- | templates/dozmod/orglist.html | 51 | ||||
-rw-r--r-- | templates/dozmod/userlist.html | 91 | ||||
-rw-r--r-- | templates/main-menu.html | 3 |
3 files changed, 113 insertions, 32 deletions
diff --git a/templates/dozmod/orglist.html b/templates/dozmod/orglist.html new file mode 100644 index 00000000..d325cc4d --- /dev/null +++ b/templates/dozmod/orglist.html @@ -0,0 +1,51 @@ +<h2>{{lang_organizationList}}</h2> + +<div class="panel panel-default"> + <div class="panel-heading"> + {{lang_organizationListHeader}} + </div> + <div class="panel-body"> + <div class="table-responsive"> + <table class="table table-stripped table-condensed"> + <thead> + <tr> + <th>{{lang_organization}}</th> + <th><span class="glyphicon glyphicon-ok" title="{{lang_canLogin}}"></span></th> + </tr> + </thead> + <tbody> + {{#organizations}} + <tr> + <td class="text-left slx-nowrap">{{displayname}}</td> + <td><input onclick="seto('setorglogin', this, '{{organizationid}}')" type="checkbox" {{{canlogin}}}></td> + </tr> + {{/organizations}} + </tbody> + </table> + </div> + </div> +</div> + +<script type="text/javascript"><!-- + +function seto(action, el, orgid) { + var box = $(el); + 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) { + el.checked = !old; + box.parent().css('background-color', 'red !important'); + } else { + el.checked = (data == 1); + } + box.css('display', ''); + }).fail(function() { + el.checked = !old; + box.parent().css('background-color', 'red !important'); + box.css('display', ''); + }); +} + +--> </script>
\ No newline at end of file diff --git a/templates/dozmod/userlist.html b/templates/dozmod/userlist.html index addb7edf..7fe52acc 100644 --- a/templates/dozmod/userlist.html +++ b/templates/dozmod/userlist.html @@ -1,34 +1,61 @@ <h2>{{lang_userList}}</h2> -<div class="table-responsive"> - <form method="post" action="?do=DozMod"> - <input type="hidden" name="token" value="{{token}}"> - <input type="hidden" name="action" value="setuser"> - <table class="table table-stripped table-condensed"> - <thead> - <tr> - <th>{{lang_user}}</th> - <th>{{lang_organization}}</th> - <th>{{lang_lastLogin}}</th> - <th>{{lang_email}}</th> - <th><span class="glyphicon glyphicon-envelope" title="{{lang_emailNotifications}}"></span></th> - <th><span class="glyphicon glyphicon-king" title="{{lang_superUser}}"></span></th> - <th><span class="glyphicon glyphicon-ban-circle" title="{{lang_isBanned}}"></span></th> - </tr> - </thead> - <tbody> - {{#users}} - <tr> - <td class="text-left slx-nowrap">{{lastname}}, {{firstname}}</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> - <td><input type="checkbox" {{emailnotifications}}></td> - <td><input type="checkbox" {{issuperuser}}></td> - <td><input type="checkbox" {{isbanned}}></td> - </tr> - {{/users}} - </tbody> - </table> - </form> -</div>
\ No newline at end of file +<div class="panel panel-default"> + <div class="panel-heading"> + {{lang_userListHeader}} + </div> + <div class="panel-body"> + <div class="table-responsive"> + <table class="table table-stripped table-condensed"> + <thead> + <tr> + <th>{{lang_user}}</th> + <th>{{lang_organization}}</th> + <th>{{lang_lastLogin}}</th> + <th>{{lang_email}}</th> + <th><span class="glyphicon glyphicon-envelope" title="{{lang_emailNotifications}}"></span></th> + <th><span class="glyphicon glyphicon-king" title="{{lang_superUser}}"></span></th> + <th><span class="glyphicon glyphicon-ok" title="{{lang_canLogin}}"></span></th> + </tr> + </thead> + <tbody> + {{#users}} + <tr> + <td class="text-left slx-nowrap">{{lastname}}, {{firstname}}</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> + <td><input onclick="setu('setmail', this, '{{userid}}')" type="checkbox" {{{emailnotifications}}}></td> + <td><input onclick="setu('setsu', this, '{{userid}}')" type="checkbox" {{{issuperuser}}}></td> + <td><input onclick="setu('setlogin', this, '{{userid}}')" type="checkbox" {{{canlogin}}}></td> + </tr> + {{/users}} + </tbody> + </table> + </div> + </div> +</div> + +<script type="text/javascript"><!-- + +function setu(action, el, uid) { + var box = $(el); + 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) { + el.checked = !old; + box.parent().css('background-color', 'red !important'); + } else { + el.checked = (data == 1); + } + box.css('display', ''); + }).fail(function() { + el.checked = !old; + box.parent().css('background-color', 'red !important'); + box.css('display', ''); + }); +} + +--> </script>
\ No newline at end of file diff --git a/templates/main-menu.html b/templates/main-menu.html index 77d5d5ee..57576fd7 100644 --- a/templates/main-menu.html +++ b/templates/main-menu.html @@ -36,6 +36,9 @@ <li><a href="?do=EventLog">{{lang_eventLog}}</a></li> </ul> </li> + <li> + <a href="?do=DozMod">{{lang_dozmod}}</a> + </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"><img src="lang/{{current_lang}}/flag.png" alt="{{current_lang}}"><b class="caret"></b></a> <ul class="dropdown-menu"> |