summaryrefslogblamecommitdiffstats
path: root/modules-available/dozmod/templates/orglist.html
blob: 34fa039c3b1cc4ed274dd801958ef499adcced8e (plain) (tree)


















                                                                                                                               


                                                                                                                                                        






















                                                                                                                      














                                                                                           






                                                                       
             
<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 class="text-nowrap">
							<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', '');

		/* 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', '');
	});
}

--> </script>