add more registration stuff, admin interface

This commit is contained in:
TuxCoder 2020-06-01 23:43:10 +02:00
parent c1c8876b63
commit 67b69104d6
23 changed files with 369 additions and 92 deletions

View file

@ -0,0 +1,37 @@
{% extends 'base.html.j2' %}
{% block body %}
<div class="container-fluid">
<div class="row">
{% for message in get_flashed_messages() %}
<div class="alert alert-warning">
<button type="button" class="close" data-dismiss="alert">&times;</button>
{{ message }}
</div>
{% endfor %}
</div>
<div class="row">
<nav class="col-md-2 d-none d-md-block bg-light sidebar fixed-top">
<div class="sidebar-sticky active">
<li class="nav-item"><a class="nav-link" href="{{ url_for('admin.users') }}">{{ gettext('users') }}</a></li>
<li class="nav-item"><a class="nav-link" href="{{ url_for('admin.registrations') }}">{{ gettext('registrations') }}</a></li>
</div>
</nav>
<main class="col-md-9 ml-sm-auto col-lg-10 px-4" role="main">
<h1>{% block title %}{% endblock %}</h1>
<div class="card">
<div class="card-body mt-5 mb-5">
<div class="tab-content">
{% block content %}{% endblock %}
</div>
</div>
</div>
</main>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,2 @@
{% extends 'admin/base.html.j2' %}

View file

@ -0,0 +1,28 @@
{% extends 'admin/base.html.j2' %}
{% block title %}{{ gettext('registrations') }}{% endblock %}
{% block content %}
<table class="table">
<thead>
<tr>
<th>username</th>
<th>created_at</th>
<th>action<th>
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td>{{ user.username }}</td>
<td>{{ user.created_at }}</td>
<td>
<a title="{{ gettext('Reject')}}" href="{{ url_for('.registration_delete', registration_id=user.id) }}" onclick="admin.registration.delete(this.href, '{{ user.username }}'); return false;"><i class="fas fa-ban"></i></a>
<a title="{{ gettext('Reject')}}" href="{{ url_for('.registration_accept', registration_id=user.id) }}" onclick="admin.registration.accept(this.href, '{{ user.username }}'); return false;"><i class="fas fa-check"></i></a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock%}

View file

@ -0,0 +1,26 @@
{% extends 'admin/base.html.j2' %}
{% block title %}{{ gettext('users') }}{% endblock %}
{% block content %}
<table class="table">
<thead>
<tr>
<th>username</th>
<th>created_at</th>
<th>modified_at<th>
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td>{{ user.username }}</td>
<td>{{ user.created_at }}</td>
<td>{{ user.modified_at }}</td>
<td></td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock%}