admin/members: add a full member list
... which can someday be filtered for names, shared IPs, registration dates, and other useful tools.
This commit is contained in:
parent
0be0d5ab65
commit
13b2bd2671
|
@ -3,7 +3,7 @@
|
|||
from app.routes import index, search, users, tools, development
|
||||
from app.routes.account import login, account, notification
|
||||
from app.routes.admin import index, groups, account, trophies, forums, \
|
||||
attachments, config
|
||||
attachments, config, members
|
||||
from app.routes.forum import index, topic
|
||||
from app.routes.programs import index
|
||||
from app.routes.posts import edit
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
from app.utils.priv_required import priv_required
|
||||
from app.models.user import Member, Group, GroupPrivilege
|
||||
from app.models.priv import SpecialPrivilege
|
||||
from app.utils.render import render
|
||||
from app import app, db
|
||||
|
||||
|
||||
@app.route('/admin/membres', methods=['GET', 'POST'])
|
||||
@priv_required('access-admin-panel')
|
||||
def adm_members():
|
||||
users = Member.query.all()
|
||||
users = sorted(users, key = lambda x: x.name)
|
||||
|
||||
return render('admin/members.html', users=users)
|
|
@ -9,6 +9,7 @@
|
|||
<p>Pages générales du panneau d'administration :</p>
|
||||
<ul>
|
||||
<li><a href="{{ url_for('adm_groups') }}">Groupes et privilèges</a></li>
|
||||
<li><a href="{{ url_for('adm_members') }}">Liste des membres</a></li>
|
||||
<li><a href="{{ url_for('adm_trophies') }}">Titres et trophées</a></li>
|
||||
<li><a href="{{ url_for('adm_forums') }}">Arbre des forums</a></li>
|
||||
<li><a href="{{ url_for('adm_attachments') }}">Pièces-jointes</a></li>
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
{% extends "base/base.html" %}
|
||||
|
||||
{% block title %}
|
||||
<a href="{{ url_for('adm') }}">Panneau d'administration</a> » <h1>Liste des membres</h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section>
|
||||
<h2>Listes des membres inscrits</h2>
|
||||
|
||||
{# TODO: Barre de recherche interactive #}
|
||||
|
||||
<table style="width:90%; margin: auto;">
|
||||
<tr><th>Pseudo</th><th>Email</th><th>Inscrit le</th><th>Groupes</th>
|
||||
<th>Privilèges spéciaux</th><th>Modifier</th></tr>
|
||||
|
||||
{% for user in users %}
|
||||
<tr><td><a href="{{ url_for('user_by_id', user_id=user.id) }}" title="Page de profil publique de {{ user.name }}">{{ user.name }}</a></td>
|
||||
<td style="color: {{ 'red' if not user.email_confirmed else 'inherit' }};">{{ user.email }}</td>
|
||||
<td style="text-align: center">{{ user.register_date | date('%Y-%d-%d') }}</td>
|
||||
<td>{% for g in user.groups %}
|
||||
<span style="{{ g.css }}">{{ g.name }}</span>
|
||||
{{ ', ' if not loop.last }}
|
||||
{% endfor %}</td>
|
||||
<td>{% for priv in user.special_privileges() %}
|
||||
<code>{{ priv }}</code>
|
||||
{{- ', ' if not loop.last }}
|
||||
{% endfor %}</td>
|
||||
<td style="text-align: center"><a href="{{ url_for('adm_edit_account', user_id=user.id) }}">Modifier</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</section>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue