From 13b2bd2671736d2194adc86ecddbdf0714ce11b9 Mon Sep 17 00:00:00 2001 From: Lephe Date: Sun, 1 Nov 2020 16:12:15 +0100 Subject: [PATCH] admin/members: add a full member list ... which can someday be filtered for names, shared IPs, registration dates, and other useful tools. --- app/routes/__init__.py | 2 +- app/routes/admin/members.py | 14 +++++++++++++ app/templates/admin/index.html | 1 + app/templates/admin/members.html | 34 ++++++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 app/routes/admin/members.py create mode 100644 app/templates/admin/members.html diff --git a/app/routes/__init__.py b/app/routes/__init__.py index acbdec2..32449c0 100644 --- a/app/routes/__init__.py +++ b/app/routes/__init__.py @@ -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 diff --git a/app/routes/admin/members.py b/app/routes/admin/members.py new file mode 100644 index 0000000..407d661 --- /dev/null +++ b/app/routes/admin/members.py @@ -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) diff --git a/app/templates/admin/index.html b/app/templates/admin/index.html index 0b2b8c4..26694eb 100644 --- a/app/templates/admin/index.html +++ b/app/templates/admin/index.html @@ -9,6 +9,7 @@

Pages générales du panneau d'administration :