Some work on user management

This commit is contained in:
simon
2018-05-13 13:52:09 -04:00
parent f06cc9e4a4
commit 3b2d2bdd8d
5 changed files with 37 additions and 27 deletions

View File

@@ -9,6 +9,10 @@
<div class="card-header">Create user</div>
<div class="card-body">
{% if not admin_account_present %}
<p>This page is unlocked because there are no admin accounts</p>
{% endif %}
<form method="POST" action="/user/add">
<div class="input-group form-group">
@@ -44,7 +48,7 @@
<tbody>
{% for user in users %}
<tr>
<td style="width: 80%;">{{ user }}</td>
<td style="width: 80%;">{% if session["username"] == user %}<b>{{ user }}{% else %}{{ user }}{% endif %}</b></td>
<td><i class="far {{ "fa-check-square" if users[user].admin else "fa-square" }}"></i></td>
<td><a href="/user/{{ user }}" class="btn btn-primary">Manage</a></td>
</tr>

View File

@@ -1,29 +1,15 @@
{% extends "layout.html" %}
{% set active_page = "user" %}
{% block body %}
<div class="container">
<div class="card">
<div class="card-header">Directory permissions</div>
<div class="card-header">Manage permission of <strong>{{ session["username"] }}</strong></div>
<div class="card-body">
<table class="info-table table-hover table-striped">
<thead>
<tr>
<th>Directory</th>
<th>Search access</th>
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td>{{ user }}</td>
<td><i class="far {{ "fa-check-square" if users[user].admin else "fa-square" }}"></i></td>
<td><a href="/user/{{ user }}" class="btn btn-primary">Manage</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>