mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-26 06:32:26 +00:00
Translation of logs/ (front)
This commit is contained in:
parent
2ecf6b86f1
commit
f6130c2335
16 changed files with 619 additions and 238 deletions
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
Here are defined some functions to check acl on the application.
|
Here are defined some functions to check acl on the application.
|
||||||
"""
|
"""
|
||||||
|
from django.utils.translation import ugettext as _
|
||||||
|
|
||||||
|
|
||||||
def can_view(user):
|
def can_view(user):
|
||||||
|
@ -38,4 +39,6 @@ def can_view(user):
|
||||||
viewing is granted and msg is a message (can be None).
|
viewing is granted and msg is a message (can be None).
|
||||||
"""
|
"""
|
||||||
can = user.has_module_perms('admin')
|
can = user.has_module_perms('admin')
|
||||||
return can, None if can else "Vous ne pouvez pas voir cette application."
|
return can, None if can else _("You don't have the right to view this"
|
||||||
|
" application.")
|
||||||
|
|
||||||
|
|
BIN
logs/locale/fr/LC_MESSAGES/django.mo
Normal file
BIN
logs/locale/fr/LC_MESSAGES/django.mo
Normal file
Binary file not shown.
338
logs/locale/fr/LC_MESSAGES/django.po
Normal file
338
logs/locale/fr/LC_MESSAGES/django.po
Normal file
|
@ -0,0 +1,338 @@
|
||||||
|
# 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 © 2018 Maël Kervella
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: 2.5\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2018-08-15 20:12+0200\n"
|
||||||
|
"PO-Revision-Date: 2018-06-23 16:01+0200\n"
|
||||||
|
"Last-Translator: Laouen Fernet <laouen.fernet@supelec.fr>\n"
|
||||||
|
"Language-Team: \n"
|
||||||
|
"Language: fr_FR\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
#: acl.py:42
|
||||||
|
msgid "You don't have the right to view this application."
|
||||||
|
msgstr "Vous n'avez pas le droit de voir cette application."
|
||||||
|
|
||||||
|
#: templates/logs/aff_stats_logs.html:36
|
||||||
|
msgid "Edited object"
|
||||||
|
msgstr "Objet modifié"
|
||||||
|
|
||||||
|
#: templates/logs/aff_stats_logs.html:37
|
||||||
|
#: templates/logs/aff_stats_models.html:32
|
||||||
|
msgid "Object type"
|
||||||
|
msgstr "Type d'objet"
|
||||||
|
|
||||||
|
#: templates/logs/aff_stats_logs.html:38
|
||||||
|
msgid "Edited by"
|
||||||
|
msgstr "Modifié par"
|
||||||
|
|
||||||
|
#: templates/logs/aff_stats_logs.html:40
|
||||||
|
msgid "Date of editing"
|
||||||
|
msgstr "Date de modification"
|
||||||
|
|
||||||
|
#: templates/logs/aff_stats_logs.html:42
|
||||||
|
msgid "Comment"
|
||||||
|
msgstr "Commentaire"
|
||||||
|
|
||||||
|
#: templates/logs/aff_stats_logs.html:58 templates/logs/aff_summary.html:62
|
||||||
|
#: templates/logs/aff_summary.html:85 templates/logs/aff_summary.html:104
|
||||||
|
#: templates/logs/aff_summary.html:123 templates/logs/aff_summary.html:142
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr "Annuler"
|
||||||
|
|
||||||
|
#: templates/logs/aff_stats_models.html:29
|
||||||
|
#, python-format
|
||||||
|
msgid "Statistics of the set %(key)s"
|
||||||
|
msgstr "Statistiques de l'ensemble %(key)s"
|
||||||
|
|
||||||
|
#: templates/logs/aff_stats_models.html:33
|
||||||
|
msgid "Number of stored entries"
|
||||||
|
msgstr "Nombre d'entrées enregistrées"
|
||||||
|
|
||||||
|
#: templates/logs/aff_stats_users.html:31
|
||||||
|
#, python-format
|
||||||
|
msgid "Statistics per %(key_dict)s of %(key)s"
|
||||||
|
msgstr "Statistiques par %(key_dict)s de %(key)s"
|
||||||
|
|
||||||
|
#: templates/logs/aff_stats_users.html:34
|
||||||
|
#, python-format
|
||||||
|
msgid "Number of %(key)s per %(key_dict)s"
|
||||||
|
msgstr "Nombre de %(key)s par %(key_dict)s"
|
||||||
|
|
||||||
|
#: templates/logs/aff_stats_users.html:35
|
||||||
|
msgid "Rank"
|
||||||
|
msgstr "Rang"
|
||||||
|
|
||||||
|
#: templates/logs/aff_summary.html:37
|
||||||
|
msgid "Date"
|
||||||
|
msgstr "Date"
|
||||||
|
|
||||||
|
#: templates/logs/aff_summary.html:39
|
||||||
|
msgid "Editing"
|
||||||
|
msgstr "Modification"
|
||||||
|
|
||||||
|
#: templates/logs/aff_summary.html:48
|
||||||
|
#, python-format
|
||||||
|
msgid "%(username)s has banned"
|
||||||
|
msgstr "%(username)s a banni"
|
||||||
|
|
||||||
|
#: templates/logs/aff_summary.html:52 templates/logs/aff_summary.html:75
|
||||||
|
msgid "No reason"
|
||||||
|
msgstr "Aucun motif"
|
||||||
|
|
||||||
|
#: templates/logs/aff_summary.html:71
|
||||||
|
#, python-format
|
||||||
|
msgid "%(username)s has graciously authorised"
|
||||||
|
msgstr "%(username)s a autorisé gracieusement"
|
||||||
|
|
||||||
|
#: templates/logs/aff_summary.html:94
|
||||||
|
#, python-format
|
||||||
|
msgid "%(username)s has updated"
|
||||||
|
msgstr "%(username)s a mis à jour"
|
||||||
|
|
||||||
|
#: templates/logs/aff_summary.html:113
|
||||||
|
#, python-format
|
||||||
|
msgid "%(username)s has sold %(number)sx %(name)s to"
|
||||||
|
msgstr "%(username)s a vendu %(number)sx %(name)s à"
|
||||||
|
|
||||||
|
#: templates/logs/aff_summary.html:116
|
||||||
|
#, python-format
|
||||||
|
msgid "+%(duration)s months"
|
||||||
|
msgstr "+%(duration)s mois"
|
||||||
|
|
||||||
|
#: templates/logs/aff_summary.html:132
|
||||||
|
#, python-format
|
||||||
|
msgid "%(username)s has edited an interface of"
|
||||||
|
msgstr "%(username)s a modifié une interface de"
|
||||||
|
|
||||||
|
#: templates/logs/delete.html:29
|
||||||
|
msgid "Deletion of actions"
|
||||||
|
msgstr "Suppression d'actions"
|
||||||
|
|
||||||
|
#: templates/logs/delete.html:35
|
||||||
|
#, python-format
|
||||||
|
msgid ""
|
||||||
|
"Warning: are you sure you want to delete this action %(objet_name)s "
|
||||||
|
"( %(objet)s )?"
|
||||||
|
msgstr ""
|
||||||
|
"Attention: voulez-vous vraiment supprimer cette action %(objet_name)s "
|
||||||
|
"( %(objet)s ) ?"
|
||||||
|
|
||||||
|
#: templates/logs/delete.html:36
|
||||||
|
msgid "Confirm"
|
||||||
|
msgstr "Confirmer"
|
||||||
|
|
||||||
|
#: templates/logs/index.html:29 templates/logs/stats_general.html:29
|
||||||
|
#: templates/logs/stats_logs.html:29 templates/logs/stats_models.html:29
|
||||||
|
#: templates/logs/stats_users.html:29
|
||||||
|
msgid "Statistics"
|
||||||
|
msgstr "Statistiques"
|
||||||
|
|
||||||
|
#: templates/logs/index.html:32 templates/logs/stats_logs.html:32 views.py:403
|
||||||
|
msgid "Actions performed"
|
||||||
|
msgstr "Actions effectuées"
|
||||||
|
|
||||||
|
#: templates/logs/sidebar.html:33
|
||||||
|
msgid "Summary"
|
||||||
|
msgstr "Résumé"
|
||||||
|
|
||||||
|
#: templates/logs/sidebar.html:37
|
||||||
|
msgid "Events"
|
||||||
|
msgstr "Évènements"
|
||||||
|
|
||||||
|
#: templates/logs/sidebar.html:41
|
||||||
|
msgid "General"
|
||||||
|
msgstr "Général"
|
||||||
|
|
||||||
|
#: templates/logs/sidebar.html:45
|
||||||
|
msgid "Database"
|
||||||
|
msgstr "Base de données"
|
||||||
|
|
||||||
|
#: templates/logs/sidebar.html:49
|
||||||
|
msgid "Wiring actions"
|
||||||
|
msgstr "Actions de câblage"
|
||||||
|
|
||||||
|
#: templates/logs/sidebar.html:53 views.py:325
|
||||||
|
msgid "Users"
|
||||||
|
msgstr "Utilisateurs"
|
||||||
|
|
||||||
|
#: templates/logs/stats_general.html:32
|
||||||
|
msgid "General statistics"
|
||||||
|
msgstr "Statistiques générales"
|
||||||
|
|
||||||
|
#: templates/logs/stats_models.html:32
|
||||||
|
msgid "Database statistics"
|
||||||
|
msgstr "Statistiques sur la base de données"
|
||||||
|
|
||||||
|
#: templates/logs/stats_users.html:32
|
||||||
|
msgid "Statistics about users"
|
||||||
|
msgstr "Statistiques sur les utilisateurs"
|
||||||
|
|
||||||
|
#: views.py:191
|
||||||
|
msgid "Nonexistent revision."
|
||||||
|
msgstr "Révision inexistante."
|
||||||
|
|
||||||
|
#: views.py:194
|
||||||
|
msgid "The action was deleted."
|
||||||
|
msgstr "L'action a été supprimée."
|
||||||
|
|
||||||
|
#: views.py:227
|
||||||
|
msgid "Category"
|
||||||
|
msgstr "Catégorie"
|
||||||
|
|
||||||
|
#: views.py:228
|
||||||
|
msgid "Number of users (members and clubs)"
|
||||||
|
msgstr "Nombre d'utilisateurs (adhérents et clubs)"
|
||||||
|
|
||||||
|
#: views.py:229
|
||||||
|
msgid "Number of members"
|
||||||
|
msgstr "Nombre d'adhérents"
|
||||||
|
|
||||||
|
#: views.py:230
|
||||||
|
msgid "Number of clubs"
|
||||||
|
msgstr "Nombre de clubs"
|
||||||
|
|
||||||
|
#: views.py:234
|
||||||
|
msgid "Activated users"
|
||||||
|
msgstr "Utilisateurs activés"
|
||||||
|
|
||||||
|
#: views.py:242
|
||||||
|
msgid "Disabled users"
|
||||||
|
msgstr "Utilisateurs désactivés"
|
||||||
|
|
||||||
|
#: views.py:250
|
||||||
|
msgid "Archived users"
|
||||||
|
msgstr "Utilisateurs archivés"
|
||||||
|
|
||||||
|
#: views.py:258
|
||||||
|
msgid "Contributing members"
|
||||||
|
msgstr "Adhérents cotisants"
|
||||||
|
|
||||||
|
#: views.py:264
|
||||||
|
msgid "Users benefiting from a connection"
|
||||||
|
msgstr "Utilisateurs bénéficiant d'une connexion"
|
||||||
|
|
||||||
|
#: views.py:270
|
||||||
|
msgid "Banned users"
|
||||||
|
msgstr "Utilisateurs bannis"
|
||||||
|
|
||||||
|
#: views.py:276
|
||||||
|
msgid "Users benefiting from a free connection"
|
||||||
|
msgstr "Utilisateurs bénéficiant d'une connexion gratuite"
|
||||||
|
|
||||||
|
#: views.py:282
|
||||||
|
msgid "Active interfaces (with access to the network)"
|
||||||
|
msgstr "Interfaces actives (ayant accès au réseau)"
|
||||||
|
|
||||||
|
#: views.py:292
|
||||||
|
msgid "Active interfaces assigned IPv4"
|
||||||
|
msgstr "Interfaces actives assignées IPv4"
|
||||||
|
|
||||||
|
#: views.py:305
|
||||||
|
msgid "IP range"
|
||||||
|
msgstr "Plage d'IP"
|
||||||
|
|
||||||
|
#: views.py:306
|
||||||
|
msgid "VLAN"
|
||||||
|
msgstr "VLAN"
|
||||||
|
|
||||||
|
#: views.py:307
|
||||||
|
msgid "Total number of IP addresses"
|
||||||
|
msgstr "Nombre total d'adresses IP"
|
||||||
|
|
||||||
|
#: views.py:308
|
||||||
|
msgid "Number of assigned IP addresses"
|
||||||
|
msgstr "Nombre d'adresses IP non assignées"
|
||||||
|
|
||||||
|
#: views.py:309
|
||||||
|
msgid "Number of IP address assigned to an activated machine"
|
||||||
|
msgstr "Nombre d'adresses IP assignées à une machine activée"
|
||||||
|
|
||||||
|
#: views.py:310
|
||||||
|
msgid "Number of nonassigned IP addresses"
|
||||||
|
msgstr "Nombre d'adresses IP non assignées"
|
||||||
|
|
||||||
|
#: views.py:337
|
||||||
|
msgid "Subscriptions"
|
||||||
|
msgstr "Cotisations"
|
||||||
|
|
||||||
|
#: views.py:359 views.py:420
|
||||||
|
msgid "Machines"
|
||||||
|
msgstr "Machines"
|
||||||
|
|
||||||
|
#: views.py:386
|
||||||
|
msgid "Topology"
|
||||||
|
msgstr "Topologie"
|
||||||
|
|
||||||
|
#: views.py:405
|
||||||
|
msgid "Number of actions"
|
||||||
|
msgstr "Nombre d'actions"
|
||||||
|
|
||||||
|
#: views.py:419 views.py:437 views.py:442 views.py:447 views.py:462
|
||||||
|
msgid "User"
|
||||||
|
msgstr "Utilisateur"
|
||||||
|
|
||||||
|
#: views.py:423
|
||||||
|
msgid "Invoice"
|
||||||
|
msgstr "Facture"
|
||||||
|
|
||||||
|
#: views.py:426
|
||||||
|
msgid "Ban"
|
||||||
|
msgstr "Bannissement"
|
||||||
|
|
||||||
|
#: views.py:429
|
||||||
|
msgid "Whitelist"
|
||||||
|
msgstr "Accès gracieux"
|
||||||
|
|
||||||
|
#: views.py:432
|
||||||
|
msgid "Rights"
|
||||||
|
msgstr "Droits"
|
||||||
|
|
||||||
|
#: views.py:436
|
||||||
|
msgid "School"
|
||||||
|
msgstr "Établissement"
|
||||||
|
|
||||||
|
#: views.py:441
|
||||||
|
msgid "Payment method"
|
||||||
|
msgstr "Moyen de paiement"
|
||||||
|
|
||||||
|
#: views.py:446
|
||||||
|
msgid "Bank"
|
||||||
|
msgstr "Banque"
|
||||||
|
|
||||||
|
#: views.py:463
|
||||||
|
msgid "Action"
|
||||||
|
msgstr "Action"
|
||||||
|
|
||||||
|
#: views.py:494
|
||||||
|
msgid "No model found."
|
||||||
|
msgstr "Aucun modèle trouvé."
|
||||||
|
|
||||||
|
#: views.py:500
|
||||||
|
msgid "Nonexistent entry."
|
||||||
|
msgstr "Entrée inexistante."
|
||||||
|
|
||||||
|
#: views.py:507
|
||||||
|
msgid "You don't have the right to access this menu."
|
||||||
|
msgstr "Vous n'avez pas le droit d'accéder à ce menu."
|
|
@ -40,3 +40,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|
|
@ -28,15 +28,18 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
|
||||||
{% load logs_extra %}
|
{% load logs_extra %}
|
||||||
{% load acl %}
|
{% load acl %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Objet modifié</th>
|
<th>{% trans "Edited object" %}</th>
|
||||||
<th>Type de l'objet</th>
|
<th>{% trans "Object type" %}</th>
|
||||||
<th>{% include "buttons/sort.html" with prefix='logs' col='author' text='Modification par' %}</th>
|
{% trans "Edited by" as tr_edited_by %}
|
||||||
<th>{% include "buttons/sort.html" with prefix='logs' col='date' text='Date de modification' %}</th>
|
<th>{% include "buttons/sort.html" with prefix='logs' col='author' text=tr_edited_by %}</th>
|
||||||
<th>Commentaire</th>
|
{% trans "Date of editing" as tr_date_of_editing %}
|
||||||
|
<th>{% include "buttons/sort.html" with prefix='logs' col='date' text=tr_date_of_editing %}</th>
|
||||||
|
<th>{% trans "Comment" %}</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -52,7 +55,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<td>
|
<td>
|
||||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' revision.id %}">
|
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' revision.id %}">
|
||||||
<i class="fa fa-times"></i>
|
<i class="fa fa-times"></i>
|
||||||
Annuler
|
{% trans "Cancel" %}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
|
@ -64,3 +67,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% if revisions_list.paginator %}
|
{% if revisions_list.paginator %}
|
||||||
{% include "pagination.html" with list=revisions_list %}
|
{% include "pagination.html" with list=revisions_list %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
|
@ -22,13 +22,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
{% for key, stats in stats_list.items %}
|
{% for key, stats in stats_list.items %}
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<h4>Statistiques de l'ensemble {{ key }}</h4>
|
<h4>{% blocktrans %}Statistics of the set {{ key }}{% endblocktrans %}</h4>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Type d'objet</th>
|
<th>{% trans "Object type" %}</th>
|
||||||
<th>Nombre d'entrée stockées</th>
|
<th>{% trans "Number of stored entries" %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
{% for key, stat in stats.items %}
|
{% for key, stat in stats.items %}
|
||||||
|
@ -39,3 +41,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|
|
@ -22,15 +22,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
{% for key_dict, stats_dict in stats_list.items %}
|
{% for key_dict, stats_dict in stats_list.items %}
|
||||||
{% for key, stats in stats_dict.items %}
|
{% for key, stats in stats_dict.items %}
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<h4>Statistiques par {{ key_dict }} de {{ key }}</h4>
|
<h4>{% blocktrans %}Statistics per {{ key_dict }} of {{ key }}{% endblocktrans %}</h4>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{ key_dict }}</th>
|
<th>{{ key_dict }}</th>
|
||||||
<th>Nombre de {{ key }} par {{ key_dict }}</th>
|
<th>{% blocktrans %}Number of {{ key }} per {{ key_dict }}{% endblocktrans %}</th>
|
||||||
<th>Rang</th>
|
<th>{% trans "Rank" %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
{% for stat in stats %}
|
{% for stat in stats %}
|
||||||
|
@ -43,3 +45,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
</table>
|
</table>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|
|
@ -28,11 +28,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
|
||||||
{% load logs_extra %}
|
{% load logs_extra %}
|
||||||
{% load acl %}
|
{% load acl %}
|
||||||
|
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{% include "buttons/sort.html" with prefix='sum' col='date' text='Date' %}</th>
|
{% trans "Date" as tr_date %}
|
||||||
<th>Modification</th>
|
<th>{% include "buttons/sort.html" with prefix='sum' col='date' text=tr_date %}</th>
|
||||||
|
<th>{% trans "Editing" %}</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -41,11 +45,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<tr class="danger">
|
<tr class="danger">
|
||||||
<td>{{ v.datetime }}</td>
|
<td>{{ v.datetime }}</td>
|
||||||
<td>
|
<td>
|
||||||
{{ v.username }} a banni
|
{% blocktrans with username=v.username %}{{ username }} has banned{% endblocktrans %}
|
||||||
<a href="{% url 'users:profil' v.version.object.user_id %}">{{ v.version.object.user.get_username }}</a>
|
<a href="{% url 'users:profil' v.version.object.user_id %}">{{ v.version.object.user.get_username }}</a>
|
||||||
(<i>
|
(<i>
|
||||||
{% if v.version.object.raison == '' %}
|
{% if v.version.object.raison == '' %}
|
||||||
Aucune raison
|
{% trans "No reason" %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ v.version.object.raison }}
|
{{ v.version.object.raison }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -55,7 +59,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<td>
|
<td>
|
||||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
|
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
|
||||||
<i class="fa fa-times"></i>
|
<i class="fa fa-times"></i>
|
||||||
Annuler
|
{% trans "Cancel" %}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
|
@ -64,11 +68,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<tr class="success">
|
<tr class="success">
|
||||||
<td>{{ v.datetime }}</td>
|
<td>{{ v.datetime }}</td>
|
||||||
<td>
|
<td>
|
||||||
{{ v.username }} a autorisé gracieusement
|
{% blocktrans with username=v.username %}{{ username }} has graciously authorised{% endblocktrans %}
|
||||||
<a href="{% url 'users:profil' v.version.object.user_id %}">{{ v.version.object.user.get_username }}</a>
|
<a href="{% url 'users:profil' v.version.object.user_id %}">{{ v.version.object.user.get_username }}</a>
|
||||||
(<i>
|
(<i>
|
||||||
{% if v.version.object.raison == '' %}
|
{% if v.version.object.raison == '' %}
|
||||||
Aucune raison
|
{% trans "No reason" %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ v.version.object.raison }}
|
{{ v.version.object.raison }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -78,7 +82,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<td>
|
<td>
|
||||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
|
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
|
||||||
<i class="fa fa-times"></i>
|
<i class="fa fa-times"></i>
|
||||||
Annuler
|
{% trans "Cancel" %}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
|
@ -87,7 +91,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ v.datetime }}</td>
|
<td>{{ v.datetime }}</td>
|
||||||
<td>
|
<td>
|
||||||
{{ v.username }} a mis à jour
|
{% blocktrans with username=v.username %}{{ username }} has updated{% endblocktrans %}
|
||||||
<a href="{% url 'users:profil' v.version.object.id %}">{{ v.version.object.get_username }}</a>
|
<a href="{% url 'users:profil' v.version.object.id %}">{{ v.version.object.get_username }}</a>
|
||||||
{% if v.comment != '' %}
|
{% if v.comment != '' %}
|
||||||
(<i>{{ v.comment }}</i>)
|
(<i>{{ v.comment }}</i>)
|
||||||
|
@ -97,7 +101,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<td>
|
<td>
|
||||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
|
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
|
||||||
<i class="fa fa-times"></i>
|
<i class="fa fa-times"></i>
|
||||||
Annuler
|
{% trans "Cancel" %}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
|
@ -106,17 +110,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ v.datetime }}</td>
|
<td>{{ v.datetime }}</td>
|
||||||
<td>
|
<td>
|
||||||
{{ v.username }} a vendu {{ v.version.object.number }}x {{ v.version.object.name }} à
|
{% blocktrans with username=v.username number=v.version.object.number name=v.version.object.name %}{{ username }} has sold {{ number }}x {{ name }} to{% endblocktrans %}
|
||||||
<a href="{% url 'users:profil' v.version.object.facture.user_id %}">{{ v.version.object.facture.user.get_username }}</a>
|
<a href="{% url 'users:profil' v.version.object.facture.user_id %}">{{ v.version.object.facture.user.get_username }}</a>
|
||||||
{% if v.version.object.iscotisation %}
|
{% if v.version.object.iscotisation %}
|
||||||
(<i>+{{ v.version.object.duration }} mois</i>)
|
(<i>{% blocktrans with duration=v.version.object.duration %}+{{ duration }} months{% endblocktrans %}</i>)
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
{% can_edit_history %}
|
{% can_edit_history %}
|
||||||
<td>
|
<td>
|
||||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
|
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
|
||||||
<i class="fa fa-times"></i>
|
<i class="fa fa-times"></i>
|
||||||
Annuler
|
{% trans "Cancel" %}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
|
@ -125,7 +129,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ v.datetime }}</td>
|
<td>{{ v.datetime }}</td>
|
||||||
<td>
|
<td>
|
||||||
{{ v.username }} a modifié une interface de
|
{% blocktrans with username=v.username %}{{ username }} has edited an interface of{% endblocktrans %}
|
||||||
<a href="{% url 'users:profil' v.version.object.machine.user_id %}">{{ v.version.object.machine.user.get_username }}</a>
|
<a href="{% url 'users:profil' v.version.object.machine.user_id %}">{{ v.version.object.machine.user.get_username }}</a>
|
||||||
{% if v.comment != '' %}
|
{% if v.comment != '' %}
|
||||||
(<i>{{ v.comment }}</i>)
|
(<i>{{ v.comment }}</i>)
|
||||||
|
@ -135,7 +139,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<td>
|
<td>
|
||||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
|
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
|
||||||
<i class="fa fa-times"></i>
|
<i class="fa fa-times"></i>
|
||||||
Annuler
|
{% trans "Cancel" %}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
|
@ -147,3 +151,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% if versions_list.paginator %}
|
{% if versions_list.paginator %}
|
||||||
{% include "pagination.html" with list=versions_list %}
|
{% include "pagination.html" with list=versions_list %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
|
@ -24,17 +24,20 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
|
|
||||||
{% load bootstrap3 %}
|
{% load bootstrap3 %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
{% block title %}Supression d'action{% endblock %}
|
{% block title %}{% trans "Deletion of actions" %}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<form class="form" method="post">
|
<form class="form" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<h4>Attention, voulez-vous vraiment annuler cette action {{ objet_name }} ( {{ objet }} ) ?</h4>
|
<h4>{% blocktrans %}Warning: are you sure you want to delete this action {{ objet_name }} ( {{ objet }} )?{% endblocktrans %}</h4>
|
||||||
{% bootstrap_button "Confirmer" button_type="submit" icon="trash" %}
|
{% trans "Confirm" as tr_confirm %}
|
||||||
|
{% bootstrap_button tr_confirm button_type="submit" icon="trash" %}
|
||||||
</form>
|
</form>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
|
@ -24,13 +24,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
|
|
||||||
{% load bootstrap3 %}
|
{% load bootstrap3 %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
{% block title %}Statistiques{% endblock %}
|
{% block title %}{%trans "Statistics" %}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h2>Actions effectuées</h2>
|
<h2>{% trans "Actions performed" %}</h2>
|
||||||
{% include "logs/aff_summary.html" with versions_list=versions_list %}
|
{% include "logs/aff_summary.html" with versions_list=versions_list %}
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
|
@ -24,32 +24,34 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
|
|
||||||
{% load acl %}
|
{% load acl %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
{% block sidebar %}
|
{% block sidebar %}
|
||||||
{% can_view_app logs %}
|
{% can_view_app logs %}
|
||||||
<a class="list-group-item list-group-item-info" href="{% url "logs:index" %}">
|
<a class="list-group-item list-group-item-info" href="{% url "logs:index" %}">
|
||||||
<i class="fa fa-clipboard-list"></i>
|
<i class="fa fa-clipboard-list"></i>
|
||||||
Résumé
|
{% trans "Summary" %}
|
||||||
</a>
|
</a>
|
||||||
<a class="list-group-item list-group-item-info" href="{% url "logs:stats-logs" %}">
|
<a class="list-group-item list-group-item-info" href="{% url "logs:stats-logs" %}">
|
||||||
<i class="fa fa-calendar-alt"></i>
|
<i class="fa fa-calendar-alt"></i>
|
||||||
Évènements
|
{% trans "Events" %}
|
||||||
</a>
|
</a>
|
||||||
<a class="list-group-item list-group-item-info" href="{% url "logs:stats-general" %}">
|
<a class="list-group-item list-group-item-info" href="{% url "logs:stats-general" %}">
|
||||||
<i class="fa fa-chart-area"></i>
|
<i class="fa fa-chart-area"></i>
|
||||||
Général
|
{% trans "General" %}
|
||||||
</a>
|
</a>
|
||||||
<a class="list-group-item list-group-item-info" href="{% url "logs:stats-models" %}">
|
<a class="list-group-item list-group-item-info" href="{% url "logs:stats-models" %}">
|
||||||
<i class="fa fa-database"></i>
|
<i class="fa fa-database"></i>
|
||||||
Base de données
|
{% trans "Database" %}
|
||||||
</a>
|
</a>
|
||||||
<a class="list-group-item list-group-item-info" href="{% url "logs:stats-actions" %}">
|
<a class="list-group-item list-group-item-info" href="{% url "logs:stats-actions" %}">
|
||||||
<i class="fa fa-plug"></i>
|
<i class="fa fa-plug"></i>
|
||||||
Actions de cablage
|
{% trans "Wiring actions" %}
|
||||||
</a>
|
</a>
|
||||||
<a class="list-group-item list-group-item-info" href="{% url "logs:stats-users" %}">
|
<a class="list-group-item list-group-item-info" href="{% url "logs:stats-users" %}">
|
||||||
<i class="fa fa-users"></i>
|
<i class="fa fa-users"></i>
|
||||||
Utilisateurs
|
{% trans "Users" %}
|
||||||
</a>
|
</a>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
|
@ -24,13 +24,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
|
|
||||||
{% load bootstrap3 %}
|
{% load bootstrap3 %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
{% block title %}Statistiques générales{% endblock %}
|
{% block title %}{% trans "Statistics" %}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h2>Statistiques générales</h2>
|
<h2>{% trans "General statistics" %}</h2>
|
||||||
{% include "logs/aff_stats_general.html" with stats_list=stats_list %}
|
{% include "logs/aff_stats_general.html" with stats_list=stats_list %}
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
|
@ -24,13 +24,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
|
|
||||||
{% load bootstrap3 %}
|
{% load bootstrap3 %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
{% block title %}Statistiques{% endblock %}
|
{% block title %}{% trans "Statistics" %}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h2>Actions effectuées</h2>
|
<h2>{% trans "Actions performed" %}</h2>
|
||||||
{% include "logs/aff_stats_logs.html" with revisions_list=revisions_list %}
|
{% include "logs/aff_stats_logs.html" with revisions_list=revisions_list %}
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
|
@ -24,13 +24,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
|
|
||||||
{% load bootstrap3 %}
|
{% load bootstrap3 %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
{% block title %}Statistiques des objets base de données{% endblock %}
|
{% block title %}{% trans "Statistics" %}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h2>Statistiques bdd</h2>
|
<h2>{% trans "Database statistics" %}</h2>
|
||||||
{% include "logs/aff_stats_models.html" with stats_list=stats_list %}
|
{% include "logs/aff_stats_models.html" with stats_list=stats_list %}
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
|
@ -24,13 +24,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
|
|
||||||
{% load bootstrap3 %}
|
{% load bootstrap3 %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
{% block title %}Statistiques par utilisateur{% endblock %}
|
{% block title %}{% trans "Statistics" %}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h2>Statistiques par utilisateur</h2>
|
<h2>{% trans "Statistics about users" %}</h2>
|
||||||
{% include "logs/aff_stats_users.html" with stats_list=stats_list %}
|
{% include "logs/aff_stats_users.html" with stats_list=stats_list %}
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
165
logs/views.py
165
logs/views.py
|
@ -188,10 +188,10 @@ def revert_action(request, revision_id):
|
||||||
try:
|
try:
|
||||||
revision = Revision.objects.get(id=revision_id)
|
revision = Revision.objects.get(id=revision_id)
|
||||||
except Revision.DoesNotExist:
|
except Revision.DoesNotExist:
|
||||||
messages.error(request, u"Revision inexistante")
|
messages.error(request, _("Nonexistent revision."))
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
revision.revert()
|
revision.revert()
|
||||||
messages.success(request, "L'action a été supprimée")
|
messages.success(request, _("The action was deleted."))
|
||||||
return redirect(reverse('logs:index'))
|
return redirect(reverse('logs:index'))
|
||||||
return form({
|
return form({
|
||||||
'objet': revision,
|
'objet': revision,
|
||||||
|
@ -224,14 +224,14 @@ def stats_general(request):
|
||||||
stats = [
|
stats = [
|
||||||
[ # First set of data (about users)
|
[ # First set of data (about users)
|
||||||
[ # Headers
|
[ # Headers
|
||||||
"Categorie",
|
_("Category"),
|
||||||
"Nombre d'utilisateurs (total club et adhérents)",
|
_("Number of users (members and clubs)"),
|
||||||
"Nombre d'adhérents",
|
_("Number of members"),
|
||||||
"Nombre de clubs"
|
_("Number of clubs")
|
||||||
],
|
],
|
||||||
{ # Data
|
{ # Data
|
||||||
'active_users': [
|
'active_users': [
|
||||||
"Users actifs",
|
_("Activated users"),
|
||||||
User.objects.filter(state=User.STATE_ACTIVE).count(),
|
User.objects.filter(state=User.STATE_ACTIVE).count(),
|
||||||
(Adherent.objects
|
(Adherent.objects
|
||||||
.filter(state=Adherent.STATE_ACTIVE)
|
.filter(state=Adherent.STATE_ACTIVE)
|
||||||
|
@ -239,7 +239,7 @@ def stats_general(request):
|
||||||
Club.objects.filter(state=Club.STATE_ACTIVE).count()
|
Club.objects.filter(state=Club.STATE_ACTIVE).count()
|
||||||
],
|
],
|
||||||
'inactive_users': [
|
'inactive_users': [
|
||||||
"Users désactivés",
|
_("Disabled users"),
|
||||||
User.objects.filter(state=User.STATE_DISABLED).count(),
|
User.objects.filter(state=User.STATE_DISABLED).count(),
|
||||||
(Adherent.objects
|
(Adherent.objects
|
||||||
.filter(state=Adherent.STATE_DISABLED)
|
.filter(state=Adherent.STATE_DISABLED)
|
||||||
|
@ -247,7 +247,7 @@ def stats_general(request):
|
||||||
Club.objects.filter(state=Club.STATE_DISABLED).count()
|
Club.objects.filter(state=Club.STATE_DISABLED).count()
|
||||||
],
|
],
|
||||||
'archive_users': [
|
'archive_users': [
|
||||||
"Users archivés",
|
_("Archived users"),
|
||||||
User.objects.filter(state=User.STATE_ARCHIVE).count(),
|
User.objects.filter(state=User.STATE_ARCHIVE).count(),
|
||||||
(Adherent.objects
|
(Adherent.objects
|
||||||
.filter(state=Adherent.STATE_ARCHIVE)
|
.filter(state=Adherent.STATE_ARCHIVE)
|
||||||
|
@ -255,31 +255,31 @@ def stats_general(request):
|
||||||
Club.objects.filter(state=Club.STATE_ARCHIVE).count()
|
Club.objects.filter(state=Club.STATE_ARCHIVE).count()
|
||||||
],
|
],
|
||||||
'adherent_users': [
|
'adherent_users': [
|
||||||
"Cotisant à l'association",
|
_("Contributing members"),
|
||||||
_all_adherent.count(),
|
_all_adherent.count(),
|
||||||
_all_adherent.exclude(adherent__isnull=True).count(),
|
_all_adherent.exclude(adherent__isnull=True).count(),
|
||||||
_all_adherent.exclude(club__isnull=True).count()
|
_all_adherent.exclude(club__isnull=True).count()
|
||||||
],
|
],
|
||||||
'connexion_users': [
|
'connexion_users': [
|
||||||
"Utilisateurs bénéficiant d'une connexion",
|
_("Users benefiting from a connection"),
|
||||||
_all_has_access.count(),
|
_all_has_access.count(),
|
||||||
_all_has_access.exclude(adherent__isnull=True).count(),
|
_all_has_access.exclude(adherent__isnull=True).count(),
|
||||||
_all_has_access.exclude(club__isnull=True).count()
|
_all_has_access.exclude(club__isnull=True).count()
|
||||||
],
|
],
|
||||||
'ban_users': [
|
'ban_users': [
|
||||||
"Utilisateurs bannis",
|
_("Banned users"),
|
||||||
_all_baned.count(),
|
_all_baned.count(),
|
||||||
_all_baned.exclude(adherent__isnull=True).count(),
|
_all_baned.exclude(adherent__isnull=True).count(),
|
||||||
_all_baned.exclude(club__isnull=True).count()
|
_all_baned.exclude(club__isnull=True).count()
|
||||||
],
|
],
|
||||||
'whitelisted_user': [
|
'whitelisted_user': [
|
||||||
"Utilisateurs bénéficiant d'une connexion gracieuse",
|
_("Users benefiting from a free connection"),
|
||||||
_all_whitelisted.count(),
|
_all_whitelisted.count(),
|
||||||
_all_whitelisted.exclude(adherent__isnull=True).count(),
|
_all_whitelisted.exclude(adherent__isnull=True).count(),
|
||||||
_all_whitelisted.exclude(club__isnull=True).count()
|
_all_whitelisted.exclude(club__isnull=True).count()
|
||||||
],
|
],
|
||||||
'actives_interfaces': [
|
'actives_interfaces': [
|
||||||
"Interfaces actives (ayant accès au reseau)",
|
_("Active interfaces (with access to the network)"),
|
||||||
_all_active_interfaces_count.count(),
|
_all_active_interfaces_count.count(),
|
||||||
(_all_active_interfaces_count
|
(_all_active_interfaces_count
|
||||||
.exclude(machine__user__adherent__isnull=True)
|
.exclude(machine__user__adherent__isnull=True)
|
||||||
|
@ -289,7 +289,7 @@ def stats_general(request):
|
||||||
.count())
|
.count())
|
||||||
],
|
],
|
||||||
'actives_assigned_interfaces': [
|
'actives_assigned_interfaces': [
|
||||||
"Interfaces actives et assignées ipv4",
|
_("Active interfaces assigned IPv4"),
|
||||||
_all_active_assigned_interfaces_count.count(),
|
_all_active_assigned_interfaces_count.count(),
|
||||||
(_all_active_assigned_interfaces_count
|
(_all_active_assigned_interfaces_count
|
||||||
.exclude(machine__user__adherent__isnull=True)
|
.exclude(machine__user__adherent__isnull=True)
|
||||||
|
@ -302,12 +302,12 @@ def stats_general(request):
|
||||||
],
|
],
|
||||||
[ # Second set of data (about ip adresses)
|
[ # Second set of data (about ip adresses)
|
||||||
[ # Headers
|
[ # Headers
|
||||||
"Range d'ip",
|
_("IP range"),
|
||||||
"Vlan",
|
_("VLAN"),
|
||||||
"Nombre d'ip totales",
|
_("Total number of IP addresses"),
|
||||||
"Ip assignées",
|
_("Number of assigned IP addresses"),
|
||||||
"Ip assignées à une machine active",
|
_("Number of IP address assigned to an activated machine"),
|
||||||
"Ip non assignées"
|
_("Number of nonassigned IP addresses")
|
||||||
],
|
],
|
||||||
ip_dict # Data already prepared
|
ip_dict # Data already prepared
|
||||||
]
|
]
|
||||||
|
@ -322,79 +322,87 @@ def stats_models(request):
|
||||||
nombre d'users, d'écoles, de droits, de bannissements,
|
nombre d'users, d'écoles, de droits, de bannissements,
|
||||||
de factures, de ventes, de banque, de machines, etc"""
|
de factures, de ventes, de banque, de machines, etc"""
|
||||||
stats = {
|
stats = {
|
||||||
'Users': {
|
_("Users"): {
|
||||||
'users': [User.PRETTY_NAME, User.objects.count()],
|
'users': [User._meta.verbose_name, User.objects.count()],
|
||||||
'adherents': [Adherent.PRETTY_NAME, Adherent.objects.count()],
|
'adherents': [Adherent._meta.verbose_name, Adherent.objects.count()],
|
||||||
'clubs': [Club.PRETTY_NAME, Club.objects.count()],
|
'clubs': [Club._meta.verbose_name, Club.objects.count()],
|
||||||
'serviceuser': [ServiceUser.PRETTY_NAME,
|
'serviceuser': [ServiceUser._meta.verbose_name,
|
||||||
ServiceUser.objects.count()],
|
ServiceUser.objects.count()],
|
||||||
'school': [School.PRETTY_NAME, School.objects.count()],
|
'school': [School._meta.verbose_name, School.objects.count()],
|
||||||
'listright': [ListRight.PRETTY_NAME, ListRight.objects.count()],
|
'listright': [ListRight._meta.verbose_name, ListRight.objects.count()],
|
||||||
'listshell': [ListShell.PRETTY_NAME, ListShell.objects.count()],
|
'listshell': [ListShell._meta.verbose_name, ListShell.objects.count()],
|
||||||
'ban': [Ban.PRETTY_NAME, Ban.objects.count()],
|
'ban': [Ban._meta.verbose_name, Ban.objects.count()],
|
||||||
'whitelist': [Whitelist.PRETTY_NAME, Whitelist.objects.count()]
|
'whitelist': [Whitelist._meta.verbose_name, Whitelist.objects.count()]
|
||||||
},
|
},
|
||||||
'Cotisations': {
|
_("Subscriptions"): {
|
||||||
'factures': [
|
'factures': [
|
||||||
Facture._meta.verbose_name.title(),
|
Facture._meta.verbose_name,
|
||||||
Facture.objects.count()
|
Facture.objects.count()
|
||||||
],
|
],
|
||||||
'vente': [
|
'vente': [
|
||||||
Vente._meta.verbose_name.title(),
|
Vente._meta.verbose_name,
|
||||||
Vente.objects.count()
|
Vente.objects.count()
|
||||||
],
|
],
|
||||||
'cotisation': [
|
'cotisation': [
|
||||||
Cotisation._meta.verbose_name.title(),
|
Cotisation._meta.verbose_name,
|
||||||
Cotisation.objects.count()
|
Cotisation.objects.count()
|
||||||
],
|
],
|
||||||
'article': [
|
'article': [
|
||||||
Article._meta.verbose_name.title(),
|
Article._meta.verbose_name,
|
||||||
Article.objects.count()
|
Article.objects.count()
|
||||||
],
|
],
|
||||||
'banque': [
|
'banque': [
|
||||||
Banque._meta.verbose_name.title(),
|
Banque._meta.verbose_name,
|
||||||
Banque.objects.count()
|
Banque.objects.count()
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
'Machines': {
|
_("Machines"): {
|
||||||
'machine': [Machine.PRETTY_NAME, Machine.objects.count()],
|
'machine': [Machine._meta.verbose_name,
|
||||||
'typemachine': [MachineType.PRETTY_NAME,
|
Machine.objects.count()],
|
||||||
|
'typemachine': [MachineType._meta.verbose_name,
|
||||||
MachineType.objects.count()],
|
MachineType.objects.count()],
|
||||||
'typeip': [IpType.PRETTY_NAME, IpType.objects.count()],
|
'typeip': [IpType._meta.verbose_name,
|
||||||
'extension': [Extension.PRETTY_NAME, Extension.objects.count()],
|
IpType.objects.count()],
|
||||||
'interface': [Interface.PRETTY_NAME, Interface.objects.count()],
|
'extension': [Extension._meta.verbose_name,
|
||||||
'alias': [Domain.PRETTY_NAME,
|
Extension.objects.count()],
|
||||||
|
'interface': [Interface._meta.verbose_name,
|
||||||
|
Interface.objects.count()],
|
||||||
|
'alias': [Domain._meta.verbose_name,
|
||||||
Domain.objects.exclude(cname=None).count()],
|
Domain.objects.exclude(cname=None).count()],
|
||||||
'iplist': [IpList.PRETTY_NAME, IpList.objects.count()],
|
'iplist': [IpList._meta.verbose_name,
|
||||||
'service': [Service.PRETTY_NAME, Service.objects.count()],
|
IpList.objects.count()],
|
||||||
|
'service': [Service._meta.verbose_name,
|
||||||
|
Service.objects.count()],
|
||||||
'ouvertureportlist': [
|
'ouvertureportlist': [
|
||||||
OuverturePortList.PRETTY_NAME,
|
OuverturePortList._meta.verbose_name,
|
||||||
OuverturePortList.objects.count()
|
OuverturePortList.objects.count()
|
||||||
],
|
],
|
||||||
'vlan': [Vlan.PRETTY_NAME, Vlan.objects.count()],
|
'vlan': [Vlan._meta.verbose_name, Vlan.objects.count()],
|
||||||
'SOA': [SOA.PRETTY_NAME, SOA.objects.count()],
|
'SOA': [SOA._meta.verbose_name, SOA.objects.count()],
|
||||||
'Mx': [Mx.PRETTY_NAME, Mx.objects.count()],
|
'Mx': [Mx._meta.verbose_name, Mx.objects.count()],
|
||||||
'Ns': [Ns.PRETTY_NAME, Ns.objects.count()],
|
'Ns': [Ns._meta.verbose_name, Ns.objects.count()],
|
||||||
'nas': [Nas.PRETTY_NAME, Nas.objects.count()],
|
'nas': [Nas._meta.verbose_name, Nas.objects.count()],
|
||||||
},
|
},
|
||||||
'Topologie': {
|
_("Topology"): {
|
||||||
'switch': [Switch.PRETTY_NAME, Switch.objects.count()],
|
'switch': [Switch._meta.verbose_name,
|
||||||
'bornes': [AccessPoint.PRETTY_NAME, AccessPoint.objects.count()],
|
Switch.objects.count()],
|
||||||
'port': [Port.PRETTY_NAME, Port.objects.count()],
|
'bornes': [AccessPoint._meta.verbose_name,
|
||||||
'chambre': [Room.PRETTY_NAME, Room.objects.count()],
|
AccessPoint.objects.count()],
|
||||||
'stack': [Stack.PRETTY_NAME, Stack.objects.count()],
|
'port': [Port._meta.verbose_name, Port.objects.count()],
|
||||||
|
'chambre': [Room._meta.verbose_name, Room.objects.count()],
|
||||||
|
'stack': [Stack._meta.verbose_name, Stack.objects.count()],
|
||||||
'modelswitch': [
|
'modelswitch': [
|
||||||
ModelSwitch.PRETTY_NAME,
|
ModelSwitch._meta.verbose_name,
|
||||||
ModelSwitch.objects.count()
|
ModelSwitch.objects.count()
|
||||||
],
|
],
|
||||||
'constructorswitch': [
|
'constructorswitch': [
|
||||||
ConstructorSwitch.PRETTY_NAME,
|
ConstructorSwitch._meta.verbose_name,
|
||||||
ConstructorSwitch.objects.count()
|
ConstructorSwitch.objects.count()
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
'Actions effectuées sur la base':
|
_("Actions performed"):
|
||||||
{
|
{
|
||||||
'revision': ["Nombre d'actions", Revision.objects.count()],
|
'revision': [_("Number of actions"), Revision.objects.count()],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
return render(request, 'logs/stats_models.html', {'stats_list': stats})
|
return render(request, 'logs/stats_models.html', {'stats_list': stats})
|
||||||
|
@ -408,35 +416,35 @@ def stats_users(request):
|
||||||
de moyens de paiements par user, de banque par user,
|
de moyens de paiements par user, de banque par user,
|
||||||
de bannissement par user, etc"""
|
de bannissement par user, etc"""
|
||||||
stats = {
|
stats = {
|
||||||
'Utilisateur': {
|
_("User"): {
|
||||||
'Machines': User.objects.annotate(
|
_("Machines"): User.objects.annotate(
|
||||||
num=Count('machine')
|
num=Count('machine')
|
||||||
).order_by('-num')[:10],
|
).order_by('-num')[:10],
|
||||||
'Facture': User.objects.annotate(
|
_("Invoice"): User.objects.annotate(
|
||||||
num=Count('facture')
|
num=Count('facture')
|
||||||
).order_by('-num')[:10],
|
).order_by('-num')[:10],
|
||||||
'Bannissement': User.objects.annotate(
|
_("Ban"): User.objects.annotate(
|
||||||
num=Count('ban')
|
num=Count('ban')
|
||||||
).order_by('-num')[:10],
|
).order_by('-num')[:10],
|
||||||
'Accès gracieux': User.objects.annotate(
|
_("Whitelist"): User.objects.annotate(
|
||||||
num=Count('whitelist')
|
num=Count('whitelist')
|
||||||
).order_by('-num')[:10],
|
).order_by('-num')[:10],
|
||||||
'Droits': User.objects.annotate(
|
_("Rights"): User.objects.annotate(
|
||||||
num=Count('groups')
|
num=Count('groups')
|
||||||
).order_by('-num')[:10],
|
).order_by('-num')[:10],
|
||||||
},
|
},
|
||||||
'Etablissement': {
|
_("School"): {
|
||||||
'Utilisateur': School.objects.annotate(
|
_("User"): School.objects.annotate(
|
||||||
num=Count('user')
|
num=Count('user')
|
||||||
).order_by('-num')[:10],
|
).order_by('-num')[:10],
|
||||||
},
|
},
|
||||||
'Moyen de paiement': {
|
_("Payment method"): {
|
||||||
'Utilisateur': Paiement.objects.annotate(
|
_("User"): Paiement.objects.annotate(
|
||||||
num=Count('facture')
|
num=Count('facture')
|
||||||
).order_by('-num')[:10],
|
).order_by('-num')[:10],
|
||||||
},
|
},
|
||||||
'Banque': {
|
_("Bank"): {
|
||||||
'Utilisateur': Banque.objects.annotate(
|
_("User"): Banque.objects.annotate(
|
||||||
num=Count('facture')
|
num=Count('facture')
|
||||||
).order_by('-num')[:10],
|
).order_by('-num')[:10],
|
||||||
},
|
},
|
||||||
|
@ -451,8 +459,8 @@ def stats_actions(request):
|
||||||
utilisateurs.
|
utilisateurs.
|
||||||
Affiche le nombre de modifications aggrégées par utilisateurs"""
|
Affiche le nombre de modifications aggrégées par utilisateurs"""
|
||||||
stats = {
|
stats = {
|
||||||
'Utilisateur': {
|
_("User"): {
|
||||||
'Action': User.objects.annotate(
|
_("Action"): User.objects.annotate(
|
||||||
num=Count('revision')
|
num=Count('revision')
|
||||||
).order_by('-num')[:40],
|
).order_by('-num')[:40],
|
||||||
},
|
},
|
||||||
|
@ -489,14 +497,14 @@ def history(request, application, object_name, object_id):
|
||||||
try:
|
try:
|
||||||
instance = model.get_instance(**kwargs)
|
instance = model.get_instance(**kwargs)
|
||||||
except model.DoesNotExist:
|
except model.DoesNotExist:
|
||||||
messages.error(request, _("No entry found."))
|
messages.error(request, _("Nonexistent entry."))
|
||||||
return redirect(reverse(
|
return redirect(reverse(
|
||||||
'users:profil',
|
'users:profil',
|
||||||
kwargs={'userid': str(request.user.id)}
|
kwargs={'userid': str(request.user.id)}
|
||||||
))
|
))
|
||||||
can, msg = instance.can_view(request.user)
|
can, msg = instance.can_view(request.user)
|
||||||
if not can:
|
if not can:
|
||||||
messages.error(request, msg or _("You cannot acces to this menu"))
|
messages.error(request, msg or _("You don't have the right to access this menu."))
|
||||||
return redirect(reverse(
|
return redirect(reverse(
|
||||||
'users:profil',
|
'users:profil',
|
||||||
kwargs={'userid': str(request.user.id)}
|
kwargs={'userid': str(request.user.id)}
|
||||||
|
@ -513,3 +521,4 @@ def history(request, application, object_name, object_id):
|
||||||
're2o/history.html',
|
're2o/history.html',
|
||||||
{'reversions': reversions, 'object': instance}
|
{'reversions': reversions, 'object': instance}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue