8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-09 03:16:25 +00:00

Translation of logs/ (front)

This commit is contained in:
Laouen Fernet 2018-08-05 18:57:36 +02:00
parent 2ecf6b86f1
commit f6130c2335
16 changed files with 619 additions and 238 deletions

View file

@ -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.")

Binary file not shown.

View 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."

View file

@ -22,7 +22,7 @@ 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 %}
{% for stats in stats_list %} {% for stats in stats_list %}
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
@ -32,11 +32,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</tr> </tr>
</thead> </thead>
{% for key, stat in stats.1.items %} {% for key, stat in stats.1.items %}
<tr> <tr>
{% for item in stat %} {% for item in stat %}
<td>{{ item }}</td> <td>{{ item }}</td>
{% endfor %} {% endfor %}
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>
{% endfor %} {% endfor %}

View file

@ -28,39 +28,43 @@ 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>
<th>{% trans "Edited object" %}</th>
<th>{% trans "Object type" %}</th>
{% trans "Edited by" as tr_edited_by %}
<th>{% include "buttons/sort.html" with prefix='logs' col='author' text=tr_edited_by %}</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>
</tr>
</thead>
{% for revision in revisions_list %}
{% for reversion in revision.version_set.all %}
<tr> <tr>
<th>Objet modifié</th> <td>{{ reversion.object|truncatechars:20 }}</td>
<th>Type de l'objet</th> <td>{{ reversion.object|classname }}</td>
<th>{% include "buttons/sort.html" with prefix='logs' col='author' text='Modification par' %}</th> <td>{{ revision.user }}</td>
<th>{% include "buttons/sort.html" with prefix='logs' col='date' text='Date de modification' %}</th> <td>{{ revision.date_created }}</td>
<th>Commentaire</th> <td>{{ revision.comment }}</td>
<th></th> {% can_edit_history %}
<td>
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' revision.id %}">
<i class="fa fa-times"></i>
{% trans "Cancel" %}
</a>
</td>
{% acl_end %}
</tr> </tr>
</thead>
{% for revision in revisions_list %}
{% for reversion in revision.version_set.all %}
<tr>
<td>{{ reversion.object|truncatechars:20 }}</td>
<td>{{ reversion.object|classname }}</td>
<td>{{ revision.user }}</td>
<td>{{ revision.date_created }}</td>
<td>{{ revision.comment }}</td>
{% can_edit_history %}
<td>
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' revision.id %}">
<i class="fa fa-times"></i>
Annuler
</a>
</td>
{% acl_end %}
</tr>
{% endfor %}
{% endfor %} {% endfor %}
</table> {% endfor %}
</table>
{% if revisions_list.paginator %} {% if revisions_list.paginator %}
{% include "pagination.html" with list=revisions_list %} {% include "pagination.html" with list=revisions_list %}
{% endif %} {% endif %}

View file

@ -22,20 +22,23 @@ 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 %}
{% for key, stats in stats_list.items %} {% load i18n %}
{% 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 %}
<tr> <tr>
<td>{{ stat.0 }}</td> <td>{{ stat.0 }}</td>
<td>{{ stat.1 }}</td> <td>{{ stat.1 }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>
{% endfor %} {% endfor %}

View file

@ -22,24 +22,27 @@ 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 %}
{% for key_dict, stats_dict in stats_list.items %} {% load i18n %}
{% 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 %}
<tr> <tr>
<td>{{ stat|truncatechars:25 }}</td> <td>{{ stat|truncatechars:25 }}</td>
<td>{{ stat.num }}</td> <td>{{ stat.num }}</td>
<td>{{ forloop.counter }}</td> <td>{{ forloop.counter }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}

View file

@ -28,122 +28,127 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load logs_extra %} {% load logs_extra %}
{% load acl %} {% load acl %}
<table class="table table-striped">
<thead> {% load i18n %}
<tr>
<th>{% include "buttons/sort.html" with prefix='sum' col='date' text='Date' %}</th> <table class="table table-striped">
<th>Modification</th> <thead>
<th></th> <tr>
</tr> {% trans "Date" as tr_date %}
</thead> <th>{% include "buttons/sort.html" with prefix='sum' col='date' text=tr_date %}</th>
<th>{% trans "Editing" %}</th>
<th></th>
</tr>
</thead>
{% for v in versions_list %} {% for v in versions_list %}
{% if v.version.content_type.model == 'ban' %} {% if v.version.content_type.model == 'ban' %}
<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 %}
</i>) </i>)
</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 %}
</tr> </tr>
{% elif v.version.content_type.model == 'whitelist' %} {% elif v.version.content_type.model == 'whitelist' %}
<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 %}
</i>) </i>)
</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 %}
</tr> </tr>
{% elif v.version.content_type.model == 'user' %} {% elif v.version.content_type.model == 'user' %}
<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>)
{% 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 %}
</tr> </tr>
{% elif v.version.content_type.model == 'vente' %} {% elif v.version.content_type.model == 'vente' %}
<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 %}
</tr> </tr>
{% elif v.version.content_type.model == 'interface' %} {% elif v.version.content_type.model == 'interface' %}
<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>)
{% 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 %}
</tr> </tr>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</table> </table>
{% if versions_list.paginator %} {% if versions_list.paginator %}
{% include "pagination.html" with list=versions_list %} {% include "pagination.html" with list=versions_list %}
{% endif %} {% endif %}

View file

@ -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 %}

View file

@ -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 %}

View file

@ -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 %}

View file

@ -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 %}

View file

@ -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 %}

View file

@ -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 %}

View file

@ -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 %}

View file

@ -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}
) )