From: Guillaume Subiron Date: Thu, 7 Jun 2012 12:32:18 +0000 (+0200) Subject: Interface details X-Git-Url: http://git.heureux-cyclage.org/?p=cavote.git;a=commitdiff_plain;h=7f235db921ed9e01ae8c8057bc35f6796284808d Interface details --- diff --git a/main.py b/main.py index 3effbb2..d7bb5e9 100755 --- a/main.py +++ b/main.py @@ -287,7 +287,7 @@ def admin_user_add(): def admin_groups(): if not session.get('user').get('is_admin'): abort(401) - groups = query_db('select * from groups') + groups = query_db('select groups.*, count(user_group.id_user) as nb_users from (select groups.*, count(votes.id) as nb_votes from groups left join votes on votes.id_group = groups.id group by groups.id) as groups left join user_group on user_group.id_group = groups.id group by groups.id') return render_template('admin_groups.html', groups=groups) @app.route('/admin/groups/add', methods=['POST']) diff --git a/templates/admin_groups.html b/templates/admin_groups.html index 966372e..adb8656 100644 --- a/templates/admin_groups.html +++ b/templates/admin_groups.html @@ -21,8 +21,8 @@ {% for group in groups %} {{ group.name }} - TODO - TODO + {{ group.nb_users }} + {{ group.nb_votes }} {% if group.system %}system{% else %}Supprimer{% endif %} {% endfor %} @@ -38,7 +38,9 @@
Ajouter un groupe
- +
diff --git a/templates/admin_users.html b/templates/admin_users.html index 3c39bf0..2593ae0 100644 --- a/templates/admin_users.html +++ b/templates/admin_users.html @@ -2,7 +2,7 @@ {% block subtitle %}Administrer les utilisateurs{% endblock %} {% block body %}
-
+ + Ajouter un utilisateur {% if not users %}
Il n'y a aucun user.
{% else %} @@ -33,5 +33,6 @@

{% endif %} + + Ajouter un utilisateur {% endblock %} diff --git a/templates/admin_vote_edit.html b/templates/admin_vote_edit.html index a0adb07..215814c 100644 --- a/templates/admin_vote_edit.html +++ b/templates/admin_vote_edit.html @@ -140,7 +140,9 @@

- +
@@ -170,7 +172,9 @@
- +
diff --git a/templates/admin_vote_new.html b/templates/admin_vote_new.html index 165fece..8ae0b9a 100644 --- a/templates/admin_vote_new.html +++ b/templates/admin_vote_new.html @@ -53,11 +53,11 @@