Adding permission mangement to admin panel
This commit is contained in:
@ -164,6 +164,7 @@
|
||||
<div></div>
|
||||
</th>
|
||||
<th scope="col" style="width: 2.5rem"></th>
|
||||
<th scope="col" style="width: 2.5rem"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -183,8 +184,11 @@
|
||||
<td>
|
||||
<a href="\{{ website }}">\{{ website }}</a>
|
||||
</td>
|
||||
|
||||
<!-- ToDo: Make helper to resolve number to human readaby text-->
|
||||
<td style="padding: 0.25em">
|
||||
<button style="border: 0; background-color: rgba(0, 0, 0, 0); padding: 0; text-align: center;" onclick="permissionsClient('\{{_id}}')">
|
||||
perm
|
||||
</button>
|
||||
</td>
|
||||
<td style="padding: 0.25em">
|
||||
<button style="border: 0; background-color: rgba(0, 0, 0, 0); padding: 0; text-align: center;" onclick="editClient('\{{_id}}')">
|
||||
<i class="material-icons" style="font-size: 2rem; display: inline">
|
||||
@ -238,6 +242,53 @@
|
||||
</span>
|
||||
</form>
|
||||
</script>
|
||||
<script id="template-permission-list" type="text/x-handlebars-template">
|
||||
<h2><button class="btn btn-raised btn-primary" onclick="gotoClients()">back</button> to \{{client_name}} </h2>
|
||||
<button class="btn btn-raised btn-primary" onclick="createPermission('\{{ client_id }}')">Create</button>
|
||||
<table class="table table-bordered" style="margin-bottom: 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col">Description</th>
|
||||
<th scope="col" style="width: 2.5rem"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
\{{#permissions}}
|
||||
<tr>
|
||||
<td>\{{ _id }}</td>
|
||||
<td>\{{ name }}</td>
|
||||
<td>\{{ description }}</td>
|
||||
<td style="padding: 0.25em">
|
||||
<button style="border: 0; background-color: rgba(0, 0, 0, 0); padding: 0; text-align: center;" onclick="deletePermission('\{{_id}}')">
|
||||
<i class="material-icons" style="font-size: 2rem; display: inline">
|
||||
delete
|
||||
</i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
\{{/permissions}}
|
||||
</tbody>
|
||||
</table>
|
||||
</script>
|
||||
<script id="template-permission-form" type="text/x-handlebars-template">
|
||||
<form class="form" action="JavaScript:void(null)" onsubmit="createPermissionSubmit(this)" style="margin-bottom: 0">
|
||||
<input type=hidden value="\{{client_id}}" name=client />
|
||||
<div class="form-group">
|
||||
<label for="name_input" class="bmd-label-floating">Name</label>
|
||||
<input type="text" class="form-control" id="name_input" name=name value="">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for=name class="bmd-label-floating">Description</label>
|
||||
<input type="text" class="form-control" id=name name=description value="">
|
||||
</div>
|
||||
<span class="form-group bmd-form-group">
|
||||
<!-- needed to match padding for floating labels -->
|
||||
<button type="submit" class="btn btn-raised btn-primary">Save</button>
|
||||
</span>
|
||||
</form>
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
|
Reference in New Issue
Block a user