Commit f6130c23 authored by Laouen Fernet's avatar Laouen Fernet

Translation of logs/ (front)

parent 2ecf6b86
......@@ -25,6 +25,7 @@
Here are defined some functions to check acl on the application.
"""
from django.utils.translation import ugettext as _
def can_view(user):
......@@ -38,4 +39,6 @@ def can_view(user):
viewing is granted and msg is a message (can be None).
"""
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.")
# 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."
......@@ -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.
{% endcomment %}
{% for stats in stats_list %}
{% for stats in stats_list %}
<table class="table table-striped">
<thead>
<tr>
......@@ -32,11 +32,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</tr>
</thead>
{% for key, stat in stats.1.items %}
<tr>
{% for item in stat %}
<td>{{ item }}</td>
{% endfor %}
</tr>
{% endfor %}
<tr>
{% for item in stat %}
<td>{{ item }}</td>
{% endfor %}
</tr>
{% endfor %}
</table>
{% endfor %}
{% endfor %}
......@@ -28,39 +28,43 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load logs_extra %}
{% load acl %}
{% load i18n %}
<table class="table table-striped">
<thead>
<table class="table table-striped">
<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>
<th>Objet modifié</th>
<th>Type de l'objet</th>
<th>{% include "buttons/sort.html" with prefix='logs' col='author' text='Modification par' %}</th>
<th>{% include "buttons/sort.html" with prefix='logs' col='date' text='Date de modification' %}</th>
<th>Commentaire</th>
<th></th>
<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>
{% trans "Cancel" %}
</a>
</td>
{% acl_end %}
</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 %}
</table>
{% endfor %}
</table>
{% if revisions_list.paginator %}
{% include "pagination.html" with list=revisions_list %}
{% endif %}
......@@ -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.
{% endcomment %}
{% for key, stats in stats_list.items %}
{% load i18n %}
{% for key, stats in stats_list.items %}
<table class="table table-striped">
<h4>Statistiques de l'ensemble {{ key }}</h4>
<thead>
<tr>
<th>Type d'objet</th>
<th>Nombre d'entrée stockées</th>
</tr>
</thead>
{% for key, stat in stats.items %}
<tr>
<td>{{ stat.0 }}</td>
<td>{{ stat.1 }}</td>
</tr>
{% endfor %}
<h4>{% blocktrans %}Statistics of the set {{ key }}{% endblocktrans %}</h4>
<thead>
<tr>
<th>{% trans "Object type" %}</th>
<th>{% trans "Number of stored entries" %}</th>
</tr>
</thead>
{% for key, stat in stats.items %}
<tr>
<td>{{ stat.0 }}</td>
<td>{{ stat.1 }}</td>
</tr>
{% endfor %}
</table>
{% endfor %}
{% endfor %}
......@@ -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.
{% 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 %}
<table class="table table-striped">
<thead>
<h4>Statistiques par {{ key_dict }} de {{ key }}</h4>
<tr>
<th>{{ key_dict }}</th>
<th>Nombre de {{ key }} par {{ key_dict }}</th>
<th>Rang</th>
</tr>
</thead>
{% for stat in stats %}
<tr>
<td>{{ stat|truncatechars:25 }}</td>
<td>{{ stat.num }}</td>
<td>{{ forloop.counter }}</td>
</tr>
{% endfor %}
</table>
{% endfor %}
{% endfor %}
<table class="table table-striped">
<thead>
<h4>{% blocktrans %}Statistics per {{ key_dict }} of {{ key }}{% endblocktrans %}</h4>
<tr>
<th>{{ key_dict }}</th>
<th>{% blocktrans %}Number of {{ key }} per {{ key_dict }}{% endblocktrans %}</th>
<th>{% trans "Rank" %}</th>
</tr>
</thead>
{% for stat in stats %}
<tr>
<td>{{ stat|truncatechars:25 }}</td>
<td>{{ stat.num }}</td>
<td>{{ forloop.counter }}</td>
</tr>
{% endfor %}
</table>
{% endfor %}
{% endfor %}
......@@ -28,122 +28,127 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load logs_extra %}
{% load acl %}
<table class="table table-striped">
<thead>
<tr>
<th>{% include "buttons/sort.html" with prefix='sum' col='date' text='Date' %}</th>
<th>Modification</th>
<th></th>
</tr>
</thead>
{% load i18n %}
<table class="table table-striped">
<thead>
<tr>
{% trans "Date" as tr_date %}
<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 %}
{% if v.version.content_type.model == 'ban' %}
<tr class="danger">
<td>{{ v.datetime }}</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>
(<i>
(<i>
{% if v.version.object.raison == '' %}
Aucune raison
{% trans "No reason" %}
{% else %}
{{ v.version.object.raison }}
{% endif %}
</i>)
</td>
{% can_edit_history %}
{% can_edit_history %}
<td>
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
<i class="fa fa-times"></i>
Annuler
{% trans "Cancel" %}
</a>
</td>
{% acl_end %}
{% acl_end %}
</tr>
{% elif v.version.content_type.model == 'whitelist' %}
<tr class="success">
<td>{{ v.datetime }}</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>
(<i>
{% if v.version.object.raison == '' %}
Aucune raison
{% trans "No reason" %}
{% else %}
{{ v.version.object.raison }}
{% endif %}
</i>)
</td>
{% can_edit_history%}
{% can_edit_history%}
<td>
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
<i class="fa fa-times"></i>
Annuler
{% trans "Cancel" %}
</a>
</td>
{% acl_end %}
{% acl_end %}
</tr>
{% elif v.version.content_type.model == 'user' %}
<tr>
<td>{{ v.datetime }}</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>
{% if v.comment != '' %}
(<i>{{ v.comment }}</i>)
{% endif %}
{% if v.comment != '' %}
(<i>{{ v.comment }}</i>)
{% endif %}
</td>
{% can_edit_history %}
{% can_edit_history %}
<td>
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
<i class="fa fa-times"></i>
Annuler
{% trans "Cancel" %}
</a>
</td>
{% acl_end %}
{% acl_end %}
</tr>
{% elif v.version.content_type.model == 'vente' %}
<tr>
<td>{{ v.datetime }}</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>
{% if v.version.object.iscotisation %}
(<i>+{{ v.version.object.duration }} mois</i>)
{% endif %}
{% if v.version.object.iscotisation %}
(<i>{% blocktrans with duration=v.version.object.duration %}+{{ duration }} months{% endblocktrans %}</i>)
{% endif %}
</td>
{% can_edit_history %}
{% can_edit_history %}
<td>
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
<i class="fa fa-times"></i>
Annuler
{% trans "Cancel" %}
</a>
</td>
{% acl_end %}
{% acl_end %}
</tr>
{% elif v.version.content_type.model == 'interface' %}
<tr>
<td>{{ v.datetime }}</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>
{% if v.comment != '' %}
(<i>{{ v.comment }}</i>)
{% endif %}
{% if v.comment != '' %}
(<i>{{ v.comment }}</i>)
{% endif %}
</td>
{% can_edit_history %}
{% can_edit_history %}
<td>
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
<i class="fa fa-times"></i>
Annuler
{% trans "Cancel" %}
</a>
</td>
{% acl_end %}
{% acl_end %}
</tr>
{% endif %}
{% endfor %}
</table>
</table>
{% if versions_list.paginator %}
{% include "pagination.html" with list=versions_list %}
{% endif %}
......@@ -24,17 +24,20 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load bootstrap3 %}
{% load i18n %}
{% block title %}Supression d'action{% endblock %}
{% block title %}{% trans "Deletion of actions" %}{% endblock %}
{% block content %}
<form class="form" method="post">
{% csrf_token %}
<h4>Attention, voulez-vous vraiment annuler cette action {{ objet_name }} ( {{ objet }} ) ?</h4>
{% bootstrap_button "Confirmer" button_type="submit" icon="trash" %}
<h4>{% blocktrans %}Warning: are you sure you want to delete this action {{ objet_name }} ( {{ objet }} )?{% endblocktrans %}</h4>
{% trans "Confirm" as tr_confirm %}
{% bootstrap_button tr_confirm button_type="submit" icon="trash" %}
</form>
<br />
<br />
<br />
<br />
<br />
<br />
{% endblock %}
......@@ -24,13 +24,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load bootstrap3 %}
{% load i18n %}
{% block title %}Statistiques{% endblock %}
{% block title %}{%trans "Statistics" %}{% endblock %}
{% block content %}
<h2>Actions effectuées</h2>
{% include "logs/aff_summary.html" with versions_list=versions_list %}
<br />
<br />
<br />
{% endblock %}
<h2>{% trans "Actions performed" %}</h2>
{% include "logs/aff_summary.html" with versions_list=versions_list %}
<br />