summaryrefslogtreecommitdiffstats
path: root/modules-available/dozmod/templates/userlist.html
blob: 3b919099e7b853cb0e7a8a04d948aedc54d7a208 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<h1>{{lang_bwlehrpoolsuite}}</h1>

<div class="panel panel-default">
	<div class="panel-heading">
		{{lang_userListHeader}}
	</div>
	<div class="panel-body">
		<p>{{lang_userListDescription}}</p>
		<div class="table-responsive">
			<table class="table table-stripped table-condensed table-hover stupidtable">
				<thead>
					<tr>
						<th data-sort="string">{{lang_user}}</th>
						<th data-sort="string">{{lang_organization}}</th>
						<th data-sort="int">{{lang_lastLogin}}</th>
						<th data-sort="string">{{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_canLoginUser}}"></span></th>
					</tr>
				</thead>
				<tbody>
					{{#users}}
					<tr>
						<td class="text-left text-nowrap">
							<{{nameTag}} href="?do=dozmod&amp;section=actionlog&amp;action=showuser&amp;uuid={{userid}}">
								{{lastname}}, {{firstname}}
							</{{nameTag}}>
						</td>
						<td class="text-left text-nowrap">{{orgname}}</td>
						<td class="text-left text-nowrap">{{lastlogin}}</td>
						<td class="text-left text-nowrap"><a href="mailto:{{email}}">{{email}}</a></td>
						<td>
							<div class="checkbox">
								<input onclick="setu('setmail', this, '{{userid}}')" type="checkbox" {{{emailnotifications}}}>
								<label></label>
							</div>
						</td>
						<td>
							<div class="checkbox">
								<input onclick="setu('setsu', this, '{{userid}}')" type="checkbox" {{{issuperuser}}}>
								<label></label>
							</div>
						</td>
						<td>
							<div class="checkbox">
								<input onclick="setu('setlogin', this, '{{userid}}')" type="checkbox" {{{canlogin}}}>
								<label></label>
							</div>
						</td>
					</tr>
					{{/users}}
				</tbody>
			</table>
		</div>
	</div>
</div>

<script type="text/javascript"><!--

function setu(action, el, uid) {
	var box = $(el);
	var $notification;
	box = box.parent();
	var v = el.checked ? '1' : '0';
	var old = el.checked == true;
	box.css('display', 'none');
	$.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', '');
			/* show success notification */
			$notification = $('<span></span>')
				.addClass('glyphicon glyphicon-remove')
				.css('color', 'red')
				.css('width', '0px')
				.css('position', 'relative')
				.css('right', '20px')
				.hide();
			box.before($notification);
			$notification.fadeIn('fast', function () {
				$notification.fadeOut('slow', function () { $notification.remove() });
			});
		} 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', '');

	}).fail(function() {

		el.checked = !old;
		box.parent().css('background-color', 'red !important');
		box.css('display', '');

	});
}

--> </script>