From e5f9b634a01677fc13a49a02f3a2b419cda23fda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Kervella?= Date: Wed, 27 Jun 2018 19:42:28 +0000 Subject: [PATCH] Remove logs/stats_droit --- logs/templates/logs/aff_stats_droits.html | 86 ----------------------- logs/templates/logs/sidebar.html | 4 -- logs/templates/logs/stats_droits.html | 36 ---------- logs/urls.py | 1 - logs/views.py | 24 ------- 5 files changed, 151 deletions(-) delete mode 100644 logs/templates/logs/aff_stats_droits.html delete mode 100644 logs/templates/logs/stats_droits.html diff --git a/logs/templates/logs/aff_stats_droits.html b/logs/templates/logs/aff_stats_droits.html deleted file mode 100644 index 6e424223..00000000 --- a/logs/templates/logs/aff_stats_droits.html +++ /dev/null @@ -1,86 +0,0 @@ -{% comment %} -Re2o est un logiciel d'administration développé initiallement au rezometz. Il -se veut agnostique au réseau considéré, de manière à être installable en -quelques clics. - -Copyright © 2017 Gabriel Détraz -Copyright © 2017 Goulven Kermarec -Copyright © 2017 Augustin Lemesle - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -{% endcomment %} - -{% load bootstrap3 %} -{% load acl %} - -{% for droit,users in stats_list.items %} -
-
-

- - {{droit}} - {{users.count}} -

-
-
-
-
- - - - - - - - - - - - {% for utilisateur in users %} - - - {% if utilisateur.is_adherent %} - - {% elif not utilisateur.end_adhesion %} - - {% else %} - - {% endif %} - - - {% if not utilisateur.last %} - - {% else %} - - {% endif %} - - - {% endfor %} -
PseudoAdhésionDerniere connexionNombre d'actionsDate de la dernière action
{{ utilisateur.pseudo }}

Adhérent

On ne s'en souvient plus...

Plus depuis {{ utilisateur.end_adhesion }}

{{ utilisateur.last_login }}{{ utilisateur.num }}

Jamais

{{utilisateur.last}}

- {% if droit != 'Superuser' %} - - {% else %} - - {% endif %} - - -
-
-
-
-
-{% endfor %} diff --git a/logs/templates/logs/sidebar.html b/logs/templates/logs/sidebar.html index 03a4bd73..0e3048e3 100644 --- a/logs/templates/logs/sidebar.html +++ b/logs/templates/logs/sidebar.html @@ -51,9 +51,5 @@ with this program; if not, write to the Free Software Foundation, Inc., Utilisateurs - - - Groupes de droit - {% acl_end %} {% endblock %} diff --git a/logs/templates/logs/stats_droits.html b/logs/templates/logs/stats_droits.html deleted file mode 100644 index 76c20331..00000000 --- a/logs/templates/logs/stats_droits.html +++ /dev/null @@ -1,36 +0,0 @@ -{% extends "logs/sidebar.html" %} -{% comment %} -Re2o est un logiciel d'administration développé initiallement au rezometz. Il -se veut agnostique au réseau considéré, de manière à être installable en -quelques clics. - -Copyright © 2017 Gabriel Détraz -Copyright © 2017 Goulven Kermarec -Copyright © 2017 Augustin Lemesle - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -{% endcomment %} - -{% load bootstrap3 %} - -{% block title %}Statistiques des droits{% endblock %} - -{% block content %} -

Statistiques des droits

- {% include "logs/aff_stats_droits.html" with stats_list=stats_list %} -
-
-
- {% endblock %} diff --git a/logs/urls.py b/logs/urls.py index 98dec281..11009835 100644 --- a/logs/urls.py +++ b/logs/urls.py @@ -39,5 +39,4 @@ urlpatterns = [ url(r'^stats_models/$', views.stats_models, name='stats-models'), url(r'^stats_users/$', views.stats_users, name='stats-users'), url(r'^stats_actions/$', views.stats_actions, name='stats-actions'), - url(r'^stats_droits/$', views.stats_droits, name='stats-droits'), ] diff --git a/logs/views.py b/logs/views.py index 1fdda9fb..cdbad9ac 100644 --- a/logs/views.py +++ b/logs/views.py @@ -453,27 +453,3 @@ def stats_actions(request): }, } return render(request, 'logs/stats_users.html', {'stats_list': stats}) - - -@login_required -@can_view_app('users') -def stats_droits(request): - """Affiche la liste des droits et les users ayant chaque droit""" - stats_list = {} - - for droit in ListRight.objects.all().select_related('group_ptr'): - stats_list[droit] = droit.user_set.all().annotate( - num=Count('revision'), - last=Max('revision__date_created'), - ) - - stats_list['Superuser'] = User.objects.filter(is_superuser=True).annotate( - num=Count('revision'), - last=Max('revision__date_created'), - ) - - return render( - request, - 'logs/stats_droits.html', - {'stats_list': stats_list} - )