blob: 871fd0cc11d05e243baf97d1cd8df2594f1b391c (
plain) (
tree)
|
|
<h1>{{lang_roleEditor}}</h1>
<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="row">
<div class="col-md-12" style="margin-bottom: 20px;">
<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>
<li style="float: none; display: inline-block">
<label for="rolename">{{lang_name}}:</label>
<input id="rolename" name="rolename" value="{{rolename}}" type="text" class="form-control">
</li>
<li style="float: right;">
<span><a href="?do=permissionmanager&show={{cancelShow}}" id="cancelButton" class="btn btn-default">{{lang_cancel}}</a></span>
<button type="submit" id="saveButton" class="btn btn-primary"><span class="glyphicon glyphicon-floppy-disk"></span> {{lang_save}}</button>
</li>
</ul>
</div>
</div>
<div class="row" style="margin-bottom: 20px;">
<div class="col-md-12">
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="permissions">
{{{permissionHTML}}}
</div>
<div role="tabpanel" class="tab-pane" id="locations">
{{{locationHTML}}}
</div>
</div>
</div>
</div>
</form>
<script type="application/javascript">
document.addEventListener("DOMContentLoaded", function () {
$(".tree-panel input[type=checkbox]").change(function () {
var checked = $(this).prop("checked");
var parent = $(this).parent().parent();
if (parent.hasClass("panel-heading")) parent = parent.parent();
var checkboxes = parent.find("input[type=checkbox]");
if (checked) {
checkboxes.prop("checked", true);
} else {
checkboxes.prop("checked", false);
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);
}
}
});
$('form').submit(function () {
var input = $("#rolename");
var name = $.trim(input.val());
if (!name) {
input.addClass("missingInput");
return false;
}
});
$('[data-toggle="tooltip"]').tooltip({
container: 'body',
trigger : 'hover'
});
});
</script>
|