mirror of https://git.48k.eu/ogcp
Add Users section
In Users section/view, administrator accounts can manage all task related to users. For example: add, delete and edit users.multi-ogserver
parent
57da4f4efa
commit
d8bac16a98
|
@ -36,6 +36,11 @@
|
|||
<li class="nav-item {% block nav_images%}{% endblock %}">
|
||||
<a class="nav-link" href="{{ url_for('images') }}">{{ _('Images') }}</a>
|
||||
</li>
|
||||
{% if current_user.admin %}
|
||||
<li class="nav-item {% block nav_users %}{% endblock %}">
|
||||
<a class="nav-link" href="{{ url_for('users') }}">{{ _('Users') }}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
{% extends 'base.html' %}
|
||||
|
||||
{% block nav_users %}active{% endblock %}
|
||||
|
||||
{% block container %}
|
||||
<form id="usersForm">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
||||
</form>
|
||||
{{ super() }}
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
<ul id="users-list" class="nav flex-column nav-pills">
|
||||
{% for user in users %}
|
||||
<li id="user-{{ user['USER'] }}" class="nav-item">
|
||||
<input class="form-check-input" type="checkbox" form="usersForm"
|
||||
value="{{ user['USER'] }}"
|
||||
name="user-{{ user['USER'] }}" />
|
||||
{{ user['USER'] }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
{% block commands %}
|
||||
{% if btn_back %}
|
||||
<button class="btn btn-danger ml-3" type="button" id="backButton" onclick="history.back()">
|
||||
{{ _("Back") }}
|
||||
</button>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
@ -1186,6 +1186,14 @@ def images():
|
|||
images = r.json()['images']
|
||||
return render_template('images.html', images=images)
|
||||
|
||||
|
||||
@app.route('/users/', methods=['GET'])
|
||||
@login_required
|
||||
def users():
|
||||
users = app.config['USERS']
|
||||
return render_template('users.html', users=users)
|
||||
|
||||
|
||||
@app.route('/action/image/info', methods=['GET'])
|
||||
@login_required
|
||||
def action_image_info():
|
||||
|
|
Loading…
Reference in New Issue