blob: 38493d5dad61c991ae646c3a4fef9e4fc99284ef (
plain) (
tree)
|
|
<h2>
{{#roleid}}
{{lang_editRoleHeading}}
{{/roleid}}
{{^roleid}}
{{lang_addRoleHeading}}
{{/roleid}}
</h2>
<form method="post" action="?do=permissionmanager">
<input type="hidden" name="action" value="saveRole">
<input type="hidden" name="token" value="{{token}}">
<input type="hidden" name="roleid" value="{{roleid}}">
<div class="input-group">
<span class="input-group-addon">
<label for="rolename">{{lang_name}}</label>
</span>
<input id="rolename" name="rolename" value="{{rolename}}" type="text" class="form-control" required>
</div>
<br>
<div class="pull-right">
<a href="?do=permissionmanager&show={{cancelShow}}" class="btn btn-default">{{lang_cancel}}</a>
<button type="submit" class="btn btn-primary" {{perms.roles.edit.disabled}}>
<span class="glyphicon glyphicon-floppy-disk"></span>
{{lang_save}}
</button>
</div>
<ul class="nav nav-tabs text-center" role="tablist">
<li role="presentation" class="active"><a href="#permissions" role="tab" data-toggle="tab">{{lang_permissions}}</a></li>
<li role="presentation"><a href="#locations" role="tab" data-toggle="tab">{{lang_locations}}</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="permissions">
{{{permissionHTML}}}
<div class="panel panel-default">
<div class="panel-body">
<span class="glyphicon glyphicon-home text-muted"></span> 
{{lang_locationAwareDesc}}
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="locations">
{{{locationHTML}}}
</div>
</div>
</form>
<script type="application/javascript">
document.addEventListener("DOMContentLoaded", function () {
$(".tree-container input[type=checkbox]").change(function () {
// (Un)Mark all sub-elements when changing a checkbox in the panel body
var $this = $(this);
var checked = $this.prop("checked");
$this.closest('li').find("input[type=checkbox]").prop("checked", checked);
if (!checked) {
var parent = $(this).parent().parent();
while (!parent.hasClass("tree-panel")) {
parent = parent.parent().parent();
if (parent.hasClass("tree-container")) parent = parent.parent().parent();
parent.find("input[type=checkbox]:first").prop("checked", false);
}
}
});
$("input.master-checkbox").change(function () {
// (Un)Mark everything within the panel when the master checkbox on top is clicked
var $this = $(this);
var checked = $this.prop("checked");
$this.closest('.tree-panel').find("input[type=checkbox]").prop("checked", checked);
});
$('[data-toggle="tooltip"]').tooltip({
container: 'body',
trigger : 'hover'
});
});
</script>
|