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

Translation of preferences/ (front)

This commit is contained in:
Laouen Fernet 2018-08-05 18:48:35 +02:00
parent 34bf50e7a9
commit c3b3146f39
12 changed files with 1136 additions and 412 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('preferences') can = user.has_module_perms('preferences')
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.")

View file

@ -27,7 +27,7 @@ from __future__ import unicode_literals
from django.forms import ModelForm, Form from django.forms import ModelForm, Form
from django import forms from django import forms
from django.utils.translation import ugettext_lazy as _
from re2o.mixins import FormRevMixin from re2o.mixins import FormRevMixin
from .models import ( from .models import (
OptionalUser, OptionalUser,
@ -56,9 +56,13 @@ class EditOptionalUserForm(ModelForm):
**kwargs **kwargs
) )
self.fields['is_tel_mandatory'].label = ( self.fields['is_tel_mandatory'].label = (
'Exiger un numéro de téléphone' _("Telephone number required")
) )
self.fields['self_adhesion'].label = 'Auto inscription' self.fields['gpg_fingerprint'].label = _("GPG fingerprint")
self.fields['all_can_create_club'].label = _("All can create a club")
self.fields['all_can_create_adherent'].label = _("All can create a member")
self.fields['self_adhesion'].label = _("Self registration")
self.fields['shell_default'].label = _("Default shell")
class EditOptionalMachineForm(ModelForm): class EditOptionalMachineForm(ModelForm):
@ -74,12 +78,17 @@ class EditOptionalMachineForm(ModelForm):
prefix=prefix, prefix=prefix,
**kwargs **kwargs
) )
self.fields['password_machine'].label = "Possibilité d'attribuer\ self.fields['password_machine'].label = _("Possibility to set a"
un mot de passe par interface" " password per machine")
self.fields['max_lambdauser_interfaces'].label = "Maximum\ self.fields['max_lambdauser_interfaces'].label = _("Maximum number of"
d'interfaces autorisées pour un user normal" " interfaces"
self.fields['max_lambdauser_aliases'].label = "Maximum d'alias\ " allowed for a"
dns autorisés pour un user normal" " standard user")
self.fields['max_lambdauser_aliases'].label = _("Maximum number of DNS"
" aliases allowed for"
" a standard user")
self.fields['ipv6_mode'].label = _("IPv6 mode")
self.fields['create_machine'].label = _("Can create a machine")
class EditOptionalTopologieForm(ModelForm): class EditOptionalTopologieForm(ModelForm):
@ -95,10 +104,11 @@ class EditOptionalTopologieForm(ModelForm):
prefix=prefix, prefix=prefix,
**kwargs **kwargs
) )
self.fields['vlan_decision_ok'].label = "Vlan où placer les\ self.fields['radius_general_policy'].label = _("RADIUS general policy")
machines après acceptation RADIUS" self.fields['vlan_decision_ok'].label = _("VLAN for machines accepted"
self.fields['vlan_decision_nok'].label = "Vlan où placer les\ " by RADIUS")
machines après rejet RADIUS" self.fields['vlan_decision_nok'].label = _("VLAN for machines rejected"
" by RADIUS")
class EditGeneralOptionForm(ModelForm): class EditGeneralOptionForm(ModelForm):
@ -114,18 +124,25 @@ class EditGeneralOptionForm(ModelForm):
prefix=prefix, prefix=prefix,
**kwargs **kwargs
) )
self.fields['search_display_page'].label = 'Resultats\ self.fields['general_message'].label = _("General message")
affichés dans une recherche' self.fields['search_display_page'].label = _("Number of results"
self.fields['pagination_number'].label = 'Items par page,\ " displayed when"
taille normale (ex users)' " searching")
self.fields['pagination_large_number'].label = 'Items par page,\ self.fields['pagination_number'].label = _("Number of items per page,"
taille élevée (machines)' " standard size (e.g."
self.fields['req_expire_hrs'].label = 'Temps avant expiration du lien\ " users)")
de reinitialisation de mot de passe (en heures)' self.fields['pagination_large_number'].label = _("Number of items per"
self.fields['site_name'].label = 'Nom du site web' " page, large size"
self.fields['email_from'].label = "Adresse mail d\ " (e.g. machines)")
'expedition automatique" self.fields['req_expire_hrs'].label = _("Time before expiration of the"
self.fields['GTU_sum_up'].label = "Résumé des CGU" " reset password link (in"
" hours)")
self.fields['site_name'].label = _("Website name")
self.fields['email_from'].label = _("Email address for automatic"
" emailing")
self.fields['GTU_sum_up'].label = _("Summary of the General Terms of"
" Use")
self.fields['GTU'].label = _("General Terms of Use")
class EditAssoOptionForm(ModelForm): class EditAssoOptionForm(ModelForm):
@ -141,15 +158,19 @@ class EditAssoOptionForm(ModelForm):
prefix=prefix, prefix=prefix,
**kwargs **kwargs
) )
self.fields['name'].label = 'Nom de l\'asso' self.fields['name'].label = _("Organisation name")
self.fields['siret'].label = 'SIRET' self.fields['siret'].label = _("SIRET number")
self.fields['adresse1'].label = 'Adresse (ligne 1)' self.fields['adresse1'].label = _("Address (line 1)")
self.fields['adresse2'].label = 'Adresse (ligne 2)' self.fields['adresse2'].label = _("Address (line 2)")
self.fields['contact'].label = 'Email de contact' self.fields['contact'].label = _("Contact email address")
self.fields['telephone'].label = 'Numéro de téléphone' self.fields['telephone'].label = _("Telephone number")
self.fields['pseudo'].label = 'Pseudo d\'usage' self.fields['pseudo'].label = _("Usual name")
self.fields['utilisateur_asso'].label = 'Compte utilisé pour\ self.fields['utilisateur_asso'].label = _("Account used for editing"
faire les modifications depuis /admin' " from /admin")
self.fields['payment'].label = _("Payment")
self.fields['payment_id'].label = _("Payment ID")
self.fields['payment_pass'].label = _("Payment password")
self.fields['description'].label = _("Description")
class EditMailMessageOptionForm(ModelForm): class EditMailMessageOptionForm(ModelForm):
@ -165,10 +186,10 @@ class EditMailMessageOptionForm(ModelForm):
prefix=prefix, prefix=prefix,
**kwargs **kwargs
) )
self.fields['welcome_mail_fr'].label = 'Message dans le\ self.fields['welcome_mail_fr'].label = _("Message for the French"
mail de bienvenue en français' " welcome email")
self.fields['welcome_mail_en'].label = 'Message dans le\ self.fields['welcome_mail_en'].label = _("Message for the English"
mail de bienvenue en anglais' " welcome email")
class EditHomeOptionForm(ModelForm): class EditHomeOptionForm(ModelForm):
@ -184,6 +205,9 @@ class EditHomeOptionForm(ModelForm):
prefix=prefix, prefix=prefix,
**kwargs **kwargs
) )
self.fields['facebook_url'].label = _("Facebook URL")
self.fields['twitter_url'].label = _("Twitter URL")
self.fields['twitter_account_name'].label = _("Twitter account name")
class ServiceForm(ModelForm): class ServiceForm(ModelForm):
@ -195,13 +219,17 @@ class ServiceForm(ModelForm):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
prefix = kwargs.pop('prefix', self.Meta.model.__name__) prefix = kwargs.pop('prefix', self.Meta.model.__name__)
super(ServiceForm, self).__init__(*args, prefix=prefix, **kwargs) super(ServiceForm, self).__init__(*args, prefix=prefix, **kwargs)
self.fields['name'].label = _("Name")
self.fields['url'].label = _("URL")
self.fields['description'].label = _("Description")
self.fields['image'].label = _("Image")
class DelServiceForm(Form): class DelServiceForm(Form):
"""Suppression de services sur la page d'accueil""" """Suppression de services sur la page d'accueil"""
services = forms.ModelMultipleChoiceField( services = forms.ModelMultipleChoiceField(
queryset=Service.objects.none(), queryset=Service.objects.none(),
label="Enregistrements service actuels", label=_("Current services"),
widget=forms.CheckboxSelectMultiple widget=forms.CheckboxSelectMultiple
) )
@ -239,3 +267,4 @@ class DelMailContactForm(Form):
self.fields['mailcontacts'].queryset = instances self.fields['mailcontacts'].queryset = instances
else: else:
self.fields['mailcontacts'].queryset = MailContact.objects.all() self.fields['mailcontacts'].queryset = MailContact.objects.all()

View file

@ -1,70 +1,609 @@
# SOME DESCRIPTIVE TITLE. # Re2o est un logiciel d'administration développé initiallement au rezometz. Il
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # se veut agnostique au réseau considéré, de manière à être installable en
# This file is distributed under the same license as the PACKAGE package. # quelques clics.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# #
#, fuzzy # 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 "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: 2.5\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-26 21:49+0200\n" "POT-Creation-Date: 2018-08-18 13:26+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: 2018-06-24 15:54+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Laouen Fernet <laouen.fernet@supelec.fr>\n"
"Language: \n" "Language-Team: \n"
"Language: fr_FR\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: models.py:256 #: acl.py:42
msgid "Contact email adress" msgid "You don't have the right to view this application."
msgstr "Adresse email de contact" msgstr "Vous n'avez pas le droit de voir cette application."
#: models.py:263 #: forms.py:59 templates/preferences/display_preferences.html:41
msgid "Description of the associated email adress." msgid "Telephone number required"
msgstr "Numéro de téléphone requis"
#: forms.py:61
msgid "GPG fingerprint"
msgstr "Empreinte GPG"
#: forms.py:62
msgid "All can create a club"
msgstr "Tous peuvent créer un club"
#: forms.py:63
msgid "All can create a member"
msgstr "Tous peuvent créer un adhérent"
#: forms.py:64 templates/preferences/display_preferences.html:43
msgid "Self registration"
msgstr "Autoinscription"
#: forms.py:65
msgid "Default shell"
msgstr "Interface système par défaut"
#: forms.py:81
msgid "Possibility to set a password per machine"
msgstr "Possibilité de mettre un mot de passe par machine"
#: forms.py:83 templates/preferences/display_preferences.html:87
msgid "Maximum number of interfaces allowed for a standard user"
msgstr "Nombre maximum d'interfaces autorisé pour un utilisateur standard"
#: forms.py:87 templates/preferences/display_preferences.html:91
msgid "Maximum number of DNS aliases allowed for a standard user"
msgstr "Nombre maximum d'alias DNS autorisé pour un utilisateur standard"
#: forms.py:90
msgid "IPv6 mode"
msgstr "Mode IPv6"
#: forms.py:91
msgid "Can create a machine"
msgstr "Peut créer une machine"
#: forms.py:107
msgid "RADIUS general policy"
msgstr "Politique générale de RADIUS"
#: forms.py:108 templates/preferences/display_preferences.html:116
msgid "VLAN for machines accepted by RADIUS"
msgstr "VLAN pour les machines acceptées par RADIUS"
#: forms.py:110 templates/preferences/display_preferences.html:118
msgid "VLAN for machines rejected by RADIUS"
msgstr "VLAN pour les machines rejetées par RADIUS"
#: forms.py:127
msgid "General message"
msgstr "Message général"
#: forms.py:128 templates/preferences/display_preferences.html:137
msgid "Number of results displayed when searching"
msgstr "Nombre de résultats affichés lors de la recherche"
#: forms.py:131
msgid "Number of items per page, standard size (e.g. users)"
msgstr "Nombre d'éléments par page, taille standard (ex : utilisateurs)"
#: forms.py:134
msgid "Number of items per page, large size (e.g. machines)"
msgstr "Nombre d'éléments par page, taille importante (ex : machines)"
#: forms.py:137 templates/preferences/display_preferences.html:145
msgid "Time before expiration of the reset password link (in hours)"
msgstr ""
"Temps avant expiration du lien de réinitialisation de mot de passe (en "
"heures)"
#: forms.py:140 templates/preferences/display_preferences.html:131
msgid "Website name"
msgstr "Nom du site"
#: forms.py:141 templates/preferences/display_preferences.html:133
msgid "Email address for automatic emailing"
msgstr "Adresse mail pour les mails automatiques"
#: forms.py:143 templates/preferences/display_preferences.html:151
msgid "Summary of the General Terms of Use"
msgstr "Résumé des Conditions Générales d'Utilisation"
#: forms.py:145 templates/preferences/display_preferences.html:155
msgid "General Terms of Use"
msgstr "Conditions Générales d'Utilisation"
#: forms.py:161
msgid "Organisation name"
msgstr "Nom de l'association"
#: forms.py:162 templates/preferences/display_preferences.html:170
msgid "SIRET number"
msgstr "Numéro SIRET"
#: forms.py:163
msgid "Address (line 1)"
msgstr "Adresse (ligne 1)"
#: forms.py:164
msgid "Address (line 2)"
msgstr "Adresse (ligne 2)"
#: forms.py:165 models.py:288
#: templates/preferences/display_preferences.html:178
msgid "Contact email address"
msgstr "Adresse mail de contact"
#: forms.py:166 templates/preferences/display_preferences.html:182
msgid "Telephone number"
msgstr "Numéro de téléphone"
#: forms.py:167 templates/preferences/display_preferences.html:184
msgid "Usual name"
msgstr "Nom d'usage"
#: forms.py:168
msgid "Account used for editing from /admin"
msgstr "Compte utilisé pour les modifications depuis /admin"
#: forms.py:170
msgid "Payment"
msgstr "Paiement"
#: forms.py:171
msgid "Payment ID"
msgstr "ID de paiement"
#: forms.py:172
msgid "Payment password"
msgstr "Mot de passe de paiement"
#: forms.py:173 forms.py:224 templates/preferences/aff_service.html:33
msgid "Description"
msgstr "Description"
#: forms.py:189
msgid "Message for the French welcome email"
msgstr "Message pour le mail de bienvenue en français"
#: forms.py:191
msgid "Message for the English welcome email"
msgstr "Message pour le mail de bienvenue en anglais"
#: forms.py:208
msgid "Facebook URL"
msgstr "URL du compte Facebook"
#: forms.py:209
msgid "Twitter URL"
msgstr "URL du compte Twitter"
#: forms.py:210 templates/preferences/display_preferences.html:233
msgid "Twitter account name"
msgstr "Nom du compte Twitter"
#: forms.py:222 templates/preferences/aff_service.html:31
#: templates/preferences/display_preferences.html:168
msgid "Name"
msgstr "Nom"
#: forms.py:223 templates/preferences/aff_service.html:32
msgid "URL"
msgstr "URL"
#: forms.py:225 templates/preferences/aff_service.html:34
msgid "Image"
msgstr "Image"
#: forms.py:232
msgid "Current services"
msgstr "Services actuels"
#: models.py:71
msgid "Users can create a club"
msgstr "Les utilisateurs peuvent créer un club"
#: models.py:75
msgid "Users can create a member"
msgstr "Les utilisateurs peuvent créer un adhérent"
#: models.py:79
msgid "A new user can create their account on Re2o"
msgstr "Un nouvel utilisateur peut créer son compte sur Re2o"
#: models.py:89 templates/preferences/display_preferences.html:49
msgid "Users can edit their shell"
msgstr "Les utilisateurs peuvent modifier leur interface système"
#: models.py:93
msgid "Enable local email accounts for users"
msgstr "Active les comptes mail locaux pour les utilisateurs"
#: models.py:98
msgid "Domain to use for local email accounts"
msgstr "Domaine à utiliser pour les comptes mail locaux"
#: models.py:102
msgid "Maximum number of local email addresses for a standard user"
msgstr ""
"Nombre maximum d'adresses mail locales autorisé pour un utilisateur standard"
#: models.py:108
msgid "Can view the user options"
msgstr "Peut voir les options d'utilisateur"
#: models.py:110
msgid "user options"
msgstr "options d'utilisateur"
#: models.py:117
msgid "Email domain must begin with @"
msgstr "Un domaine mail doit commencer par @"
#: models.py:135
msgid "Autoconfiguration by RA"
msgstr "Configuration automatique par RA"
#: models.py:136
msgid "IP addresses assigning by DHCPv6"
msgstr "Attribution d'adresses IP par DHCPv6"
#: models.py:137
msgid "Disabled"
msgstr "Désactivé"
#: models.py:159
msgid "Can view the machine options"
msgstr "Peut voir les options de machine"
#: models.py:161
msgid "machine options"
msgstr "options de machine"
#: models.py:180
msgid "On the IP range's VLAN of the machine"
msgstr "Sur le VLAN de la plage d'IP de la machine"
#: models.py:181
msgid "Preset in 'VLAN for machines accepted by RADIUS'"
msgstr "Prédéfinie dans 'VLAN pour les machines acceptées par RADIUS'"
#: models.py:206
msgid "Can view the topology options"
msgstr "Peut voir les options de topologie"
#: models.py:208
msgid "topology options"
msgstr "options de topologie"
#: models.py:225
msgid ""
"General message displayed on the French version of the website (e.g. in case "
"of maintenance)"
msgstr ""
"Message général affiché sur la version française du site (ex : en cas de "
"maintenance)"
#: models.py:231
msgid ""
"General message displayed on the English version of the website (e.g. in "
"case of maintenance)"
msgstr ""
"Message général affiché sur la version anglaise du site (ex : en cas de "
"maintenance)"
#: models.py:253
msgid "Can view the general options"
msgstr "Peut voir les options générales"
#: models.py:255
msgid "general options"
msgstr "options générales"
#: models.py:275
msgid "Can view the service options"
msgstr "Peut voir les options de service"
#: models.py:277
msgid "service"
msgstr "service"
#: models.py:278
msgid "services"
msgstr "services"
#: models.py:295
msgid "Description of the associated email address."
msgstr "Description de l'adresse mail associée." msgstr "Description de l'adresse mail associée."
#: models.py:273 #: models.py:305
msgid "Can see contact email" msgid "Can view a contact email address object"
msgstr "Peut voir un mail de contact" msgstr "Peut voir un objet adresse mail de contact"
#: templates/preferences/aff_mailcontact.html:30 #: models.py:307
msgid "Adress" msgid "contact email address"
msgstr "Adresse" msgstr "adresse mail de contact"
#: models.py:308
msgid "contact email addresses"
msgstr "adresses mail de contact"
#: models.py:318
msgid "Networking organisation school Something"
msgstr "Association de réseau de l'école Machin"
#: models.py:322
msgid "Threadneedle Street"
msgstr "1 rue de la Vrillière"
#: models.py:323
msgid "London EC2R 8AH"
msgstr "75001 Paris"
#: models.py:326
msgid "Organisation"
msgstr "Association"
#: models.py:340
msgid "Can view the organisation options"
msgstr "Peut voir les options d'association"
#: models.py:342
msgid "organisation options"
msgstr "options d'association"
#: models.py:371
msgid "Can view the homepage options"
msgstr "Peut voir les options de page d'accueil"
#: models.py:373
msgid "homepage options"
msgstr "options de page d'accueil"
#: models.py:391
msgid "Can view the email message options"
msgstr "Peut voir les options de message pour les mails"
#: models.py:394
msgid "email message options"
msgstr "options de messages pour les mails"
#: templates/preferences/aff_mailcontact.html:31 #: templates/preferences/aff_mailcontact.html:31
msgid "Remark" #: templates/preferences/display_preferences.html:174
msgid "Address"
msgstr "Adresse"
#: templates/preferences/aff_mailcontact.html:32
msgid "Comment"
msgstr "Commentaire" msgstr "Commentaire"
#: templates/preferences/display_preferences.html:205 #: templates/preferences/display_preferences.html:31
msgid "Contact email adresses list" #: templates/preferences/edit_preferences.html:30
msgstr "Liste des adresses email de contact" #: templates/preferences/preferences.html:29
msgid "Preferences"
msgstr "Préférences"
#: templates/preferences/display_preferences.html:34
msgid "User preferences"
msgstr "Préférences d'utilisateur"
#: templates/preferences/display_preferences.html:37
#: templates/preferences/display_preferences.html:79
#: templates/preferences/display_preferences.html:104
#: templates/preferences/display_preferences.html:125
#: templates/preferences/display_preferences.html:162
#: templates/preferences/display_preferences.html:197
#: templates/preferences/display_preferences.html:219
#: templates/preferences/edit_preferences.html:40 views.py:170 views.py:234
msgid "Edit"
msgstr "Modifier"
#: templates/preferences/display_preferences.html:47
msgid "Default shell for users"
msgstr "Interface système par défaut pour les utilisateurs"
#: templates/preferences/display_preferences.html:53
msgid "Creation of members by everyone"
msgstr "Création d'adhérents par tous"
#: templates/preferences/display_preferences.html:55
msgid "Creation of clubs by everyone"
msgstr "Création de clubs par tous"
#: templates/preferences/display_preferences.html:59
msgid "GPG fingerprint field"
msgstr "Champ empreinte GPG"
#: templates/preferences/display_preferences.html:63
msgid "Email accounts preferences"
msgstr "Préférences de comptes mail"
#: templates/preferences/display_preferences.html:66
msgid "Local email accounts enabled"
msgstr "Comptes mail locaux activés"
#: templates/preferences/display_preferences.html:68
msgid "Local email domain"
msgstr "Domaine de mail local"
#: templates/preferences/display_preferences.html:72
msgid "Maximum number of email aliases allowed"
msgstr "Nombre maximum d'alias mail autorisé pour un utilisateur standard"
#: templates/preferences/display_preferences.html:76
msgid "Machines preferences"
msgstr "Préférences de machines"
#: templates/preferences/display_preferences.html:85
msgid "Password per machine"
msgstr "Mot de passe par machine"
#: templates/preferences/display_preferences.html:93
msgid "IPv6 support"
msgstr "Support de l'IPv6"
#: templates/preferences/display_preferences.html:97
msgid "Creation of machines"
msgstr "Création de machines"
#: templates/preferences/display_preferences.html:101
msgid "Topology preferences"
msgstr "Préférences de topologie"
#: templates/preferences/display_preferences.html:110
msgid "General policy for VLAN setting"
msgstr "Politique générale pour le placement sur un VLAN"
#: templates/preferences/display_preferences.html:112
msgid ""
"This setting defines the VLAN policy after acceptance by RADIUS: either on "
"the IP range's VLAN of the machine, or a VLAN preset in 'VLAN for machines "
"accepted by RADIUS'"
msgstr ""
"Ce réglage définit la politique de placement sur un VLAN après acceptation "
"par RADIUS: soit sur le VLAN de la plage d'IP de la machine, soit sur le "
"VLAN prédéfini dans 'VLAN pour les machines acceptées par RADIUS'"
#: templates/preferences/display_preferences.html:122
msgid "General preferences"
msgstr "Préférences générales"
#: templates/preferences/display_preferences.html:139
msgid "Number of items per page (standard size)"
msgstr "Nombre d'éléments par page (taille standard)"
#: templates/preferences/display_preferences.html:143
msgid "Number of items per page (large size)"
msgstr "Nombre d'éléments par page (taille importante)"
#: templates/preferences/display_preferences.html:149
msgid "General message displayed on the website"
msgstr "Message général affiché sur le site"
#: templates/preferences/display_preferences.html:159
msgid "Information about the organisation"
msgstr "Informations sur l'association"
#: templates/preferences/display_preferences.html:188
msgid "User object of the organisation"
msgstr "Objet utilisateur de l'association"
#: templates/preferences/display_preferences.html:190
msgid "Description of the organisation"
msgstr "Description de l'association"
#: templates/preferences/display_preferences.html:194
msgid "Custom email message"
msgstr "Message personnalisé pour les mails"
#: templates/preferences/display_preferences.html:203
msgid "Welcome email (in French)"
msgstr "Mail de bienvenue (en français)"
#: templates/preferences/display_preferences.html:207 #: templates/preferences/display_preferences.html:207
msgid "Add an adress" msgid "Welcome email (in English)"
msgstr "Mail de bienvenue (en anglais)"
#: templates/preferences/display_preferences.html:211
msgid "List of services and homepage preferences"
msgstr "Liste des services et préférences de page d'accueil"
#: templates/preferences/display_preferences.html:213
msgid " Add a service"
msgstr " Ajouter un service"
#: templates/preferences/display_preferences.html:215
msgid " Delete one or several services"
msgstr " Supprimer un ou plusieurs services"
#: templates/preferences/display_preferences.html:221
msgid "List of contact email addresses"
msgstr "Liste des adresses mail de contact"
#: templates/preferences/display_preferences.html:223
msgid "Add an address"
msgstr "Ajouter une adresse" msgstr "Ajouter une adresse"
#: templates/preferences/display_preferences.html:209 #: templates/preferences/display_preferences.html:225
msgid "Delete one or multiple adresses" msgid "Delete one or several addresses"
msgstr " Supprimer une ou plusieurs adresses" msgstr " Supprimer une ou plusieurs adresses"
#: views.py:210 #: templates/preferences/display_preferences.html:231
msgid "The adress was created." msgid "Twitter account URL"
msgstr "L'adresse a été créée." msgstr "URL du compte Twitter"
#: views.py:230 #: templates/preferences/display_preferences.html:237
msgid "Email adress updated." msgid "Facebook account URL"
msgstr "L'adresse email a été mise à jour." msgstr "URL du compte Facebook"
#: views.py:233 #: templates/preferences/edit_preferences.html:35
msgid "Edit" msgid "Editing of preferences"
msgstr "Éditer" msgstr "Modification des préférences"
#: views.py:251 #: views.py:98
msgid "The email adress was deleted." msgid "Unknown object"
msgstr "L'adresse email a été supprimée." msgstr "Objet inconnu"
#: views.py:254 #: views.py:104
msgid "You don't have the right to edit this option."
msgstr "Vous n'avez pas le droit de modifier cette option."
#: views.py:121
msgid "The preferences were edited."
msgstr "Les préférences ont été modifiées."
#: views.py:140
msgid "The service was added."
msgstr "Le service a été ajouté."
#: views.py:143
msgid "Add a service"
msgstr " Ajouter un service"
#: views.py:167
msgid "The service was edited."
msgstr "Le service a été modifié."
#: views.py:188
msgid "The service was deleted."
msgstr "Le service a été supprimé."
#: views.py:190
#, python-format
msgid "Error: the service %s can't be deleted."
msgstr "Erreur : le service %s ne peut pas être supprimé."
#: views.py:194 views.py:256
msgid "Delete" msgid "Delete"
msgstr "Supprimer" msgstr "Supprimer"
#: views.py:210
msgid "The contact email address was created."
msgstr "L'adresse mail de contact a été supprimée."
#: views.py:214
msgid "Add a contact email address"
msgstr "Ajouter une adresse mail de contact"
#: views.py:231
msgid "The contact email address was edited."
msgstr "L'adresse mail de contact a été modifiée."
#: views.py:253
msgid "The contact email adress was deleted."
msgstr "L'adresse mail de contact a été supprimée."

View file

@ -0,0 +1,146 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2018-08-18 11:29
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('preferences', '0049_optionaluser_self_change_shell'),
]
operations = [
migrations.AlterModelOptions(
name='assooption',
options={'permissions': (('view_assooption', 'Can view the organisation options'),), 'verbose_name': 'organisation options'},
),
migrations.AlterModelOptions(
name='generaloption',
options={'permissions': (('view_generaloption', 'Can view the general options'),), 'verbose_name': 'general options'},
),
migrations.AlterModelOptions(
name='homeoption',
options={'permissions': (('view_homeoption', 'Can view the homepage options'),), 'verbose_name': 'homepage options'},
),
migrations.AlterModelOptions(
name='mailcontact',
options={'permissions': (('view_mailcontact', 'Can view a contact email address object'),), 'verbose_name': 'contact email address', 'verbose_name_plural': 'contact email addresses'},
),
migrations.AlterModelOptions(
name='mailmessageoption',
options={'permissions': (('view_mailmessageoption', 'Can view the email message options'),), 'verbose_name': 'email message options'},
),
migrations.AlterModelOptions(
name='optionalmachine',
options={'permissions': (('view_optionalmachine', 'Can view the machine options'),), 'verbose_name': 'machine options'},
),
migrations.AlterModelOptions(
name='optionaltopologie',
options={'permissions': (('view_optionaltopologie', 'Can view the topology options'),), 'verbose_name': 'topology options'},
),
migrations.AlterModelOptions(
name='optionaluser',
options={'permissions': (('view_optionaluser', 'Can view the user options'),), 'verbose_name': 'user options'},
),
migrations.AlterModelOptions(
name='service',
options={'permissions': (('view_service', 'Can view the service options'),), 'verbose_name': 'service', 'verbose_name_plural': 'services'},
),
migrations.AlterField(
model_name='assooption',
name='adresse1',
field=models.CharField(default='Threadneedle Street', max_length=128),
),
migrations.AlterField(
model_name='assooption',
name='adresse2',
field=models.CharField(default='London EC2R 8AH', max_length=128),
),
migrations.AlterField(
model_name='assooption',
name='name',
field=models.CharField(default='Networking organisation school Something', max_length=256),
),
migrations.AlterField(
model_name='assooption',
name='pseudo',
field=models.CharField(default='Organisation', max_length=32),
),
migrations.AlterField(
model_name='generaloption',
name='general_message_en',
field=models.TextField(blank=True, default='', help_text='General message displayed on the English version of the website (e.g. in case of maintenance)'),
),
migrations.AlterField(
model_name='generaloption',
name='general_message_fr',
field=models.TextField(blank=True, default='', help_text='General message displayed on the French version of the website (e.g. in case of maintenance)'),
),
migrations.AlterField(
model_name='homeoption',
name='facebook_url',
field=models.URLField(blank=True, null=True),
),
migrations.AlterField(
model_name='homeoption',
name='twitter_account_name',
field=models.CharField(blank=True, max_length=32, null=True),
),
migrations.AlterField(
model_name='homeoption',
name='twitter_url',
field=models.URLField(blank=True, null=True),
),
migrations.AlterField(
model_name='mailcontact',
name='address',
field=models.EmailField(default='contact@example.org', help_text='Contact email address', max_length=254),
),
migrations.AlterField(
model_name='mailcontact',
name='commentary',
field=models.CharField(blank=True, help_text='Description of the associated email address.', max_length=256, null=True),
),
migrations.AlterField(
model_name='optionalmachine',
name='create_machine',
field=models.BooleanField(default=True),
),
migrations.AlterField(
model_name='optionalmachine',
name='ipv6_mode',
field=models.CharField(choices=[('SLAAC', 'Autoconfiguration by RA'), ('DHCPV6', 'IP addresses assigning by DHCPv6'), ('DISABLED', 'Disabled')], default='DISABLED', max_length=32),
),
migrations.AlterField(
model_name='optionaltopologie',
name='radius_general_policy',
field=models.CharField(choices=[('MACHINE', "On the IP range's VLAN of the machine"), ('DEFINED', "Preset in 'VLAN for machines accepted by RADIUS'")], default='DEFINED', max_length=32),
),
migrations.AlterField(
model_name='optionaluser',
name='all_can_create_adherent',
field=models.BooleanField(default=False, help_text='Users can create a member'),
),
migrations.AlterField(
model_name='optionaluser',
name='all_can_create_club',
field=models.BooleanField(default=False, help_text='Users can create a club'),
),
migrations.AlterField(
model_name='optionaluser',
name='max_email_address',
field=models.IntegerField(default=15, help_text='Maximum number of local email addresses for a standard user'),
),
migrations.AlterField(
model_name='optionaluser',
name='self_adhesion',
field=models.BooleanField(default=False, help_text='A new user can create their account on Re2o'),
),
migrations.AlterField(
model_name='optionaluser',
name='self_change_shell',
field=models.BooleanField(default=False, help_text='Users can edit their shell'),
),
]

View file

@ -63,21 +63,20 @@ class PreferencesModel(models.Model):
class OptionalUser(AclMixin, PreferencesModel): class OptionalUser(AclMixin, PreferencesModel):
"""Options pour l'user : obligation ou nom du telephone, """Options pour l'user : obligation ou nom du telephone,
activation ou non du solde, autorisation du negatif, fingerprint etc""" activation ou non du solde, autorisation du negatif, fingerprint etc"""
PRETTY_NAME = "Options utilisateur"
is_tel_mandatory = models.BooleanField(default=True) is_tel_mandatory = models.BooleanField(default=True)
gpg_fingerprint = models.BooleanField(default=True) gpg_fingerprint = models.BooleanField(default=True)
all_can_create_club = models.BooleanField( all_can_create_club = models.BooleanField(
default=False, default=False,
help_text="Les users peuvent créer un club" help_text=_("Users can create a club")
) )
all_can_create_adherent = models.BooleanField( all_can_create_adherent = models.BooleanField(
default=False, default=False,
help_text="Les users peuvent créer d'autres adhérents", help_text=_("Users can create a member"),
) )
self_adhesion = models.BooleanField( self_adhesion = models.BooleanField(
default=False, default=False,
help_text="Un nouvel utilisateur peut se créer son compte sur re2o" help_text=_("A new user can create their account on Re2o")
) )
shell_default = models.OneToOneField( shell_default = models.OneToOneField(
'users.ListShell', 'users.ListShell',
@ -87,33 +86,35 @@ class OptionalUser(AclMixin, PreferencesModel):
) )
self_change_shell = models.BooleanField( self_change_shell = models.BooleanField(
default=False, default=False,
help_text="Users can change their shell" help_text=_("Users can edit their shell")
) )
local_email_accounts_enabled = models.BooleanField( local_email_accounts_enabled = models.BooleanField(
default=False, default=False,
help_text="Enable local email accounts for users" help_text=_("Enable local email accounts for users")
) )
local_email_domain = models.CharField( local_email_domain = models.CharField(
max_length=32, max_length=32,
default="@example.org", default="@example.org",
help_text="Domain to use for local email accounts", help_text=_("Domain to use for local email accounts")
) )
max_email_address = models.IntegerField( max_email_address = models.IntegerField(
default=15, default=15,
help_text = "Maximum number of local email address for a standard user" help_text=_("Maximum number of local email addresses for a standard"
" user")
) )
class Meta: class Meta:
permissions = ( permissions = (
("view_optionaluser", "Peut voir les options de l'user"), ("view_optionaluser", _("Can view the user options")),
) )
verbose_name = _("user options")
def clean(self): def clean(self):
"""Clean model: """Clean model:
Check the mail_extension Check the mail_extension
""" """
if self.local_email_domain[0] != "@": if self.local_email_domain[0] != "@":
raise ValidationError("Mail domain must begin with @") raise ValidationError(_("Email domain must begin with @"))
@receiver(post_save, sender=OptionalUser) @receiver(post_save, sender=OptionalUser)
@ -126,15 +127,14 @@ def optionaluser_post_save(**kwargs):
class OptionalMachine(AclMixin, PreferencesModel): class OptionalMachine(AclMixin, PreferencesModel):
"""Options pour les machines : maximum de machines ou d'alias par user """Options pour les machines : maximum de machines ou d'alias par user
sans droit, activation de l'ipv6""" sans droit, activation de l'ipv6"""
PRETTY_NAME = "Options machines"
SLAAC = 'SLAAC' SLAAC = 'SLAAC'
DHCPV6 = 'DHCPV6' DHCPV6 = 'DHCPV6'
DISABLED = 'DISABLED' DISABLED = 'DISABLED'
CHOICE_IPV6 = ( CHOICE_IPV6 = (
(SLAAC, 'Autoconfiguration par RA'), (SLAAC, _("Autoconfiguration by RA")),
(DHCPV6, 'Attribution des ip par dhcpv6'), (DHCPV6, _("IP addresses assigning by DHCPv6")),
(DISABLED, 'Désactivé'), (DISABLED, _("Disabled")),
) )
password_machine = models.BooleanField(default=False) password_machine = models.BooleanField(default=False)
@ -146,8 +146,7 @@ class OptionalMachine(AclMixin, PreferencesModel):
default='DISABLED' default='DISABLED'
) )
create_machine = models.BooleanField( create_machine = models.BooleanField(
default=True, default=True
help_text="Permet à l'user de créer une machine"
) )
@cached_property @cached_property
@ -157,8 +156,9 @@ class OptionalMachine(AclMixin, PreferencesModel):
class Meta: class Meta:
permissions = ( permissions = (
("view_optionalmachine", "Peut voir les options de machine"), ("view_optionalmachine", _("Can view the machine options")),
) )
verbose_name = _("machine options")
@receiver(post_save, sender=OptionalMachine) @receiver(post_save, sender=OptionalMachine)
@ -174,13 +174,11 @@ def optionalmachine_post_save(**kwargs):
class OptionalTopologie(AclMixin, PreferencesModel): class OptionalTopologie(AclMixin, PreferencesModel):
"""Reglages pour la topologie : mode d'accès radius, vlan où placer """Reglages pour la topologie : mode d'accès radius, vlan où placer
les machines en accept ou reject""" les machines en accept ou reject"""
PRETTY_NAME = "Options topologie"
MACHINE = 'MACHINE' MACHINE = 'MACHINE'
DEFINED = 'DEFINED' DEFINED = 'DEFINED'
CHOICE_RADIUS = ( CHOICE_RADIUS = (
(MACHINE, 'Sur le vlan de la plage ip machine'), (MACHINE, _("On the IP range's VLAN of the machine")),
(DEFINED, 'Prédéfini dans "Vlan où placer les machines\ (DEFINED, _("Preset in 'VLAN for machines accepted by RADIUS'")),
après acceptation RADIUS"'),
) )
radius_general_policy = models.CharField( radius_general_policy = models.CharField(
@ -205,8 +203,9 @@ class OptionalTopologie(AclMixin, PreferencesModel):
class Meta: class Meta:
permissions = ( permissions = (
("view_optionaltopologie", "Peut voir les options de topologie"), ("view_optionaltopologie", _("Can view the topology options")),
) )
verbose_name = _("topology options")
@receiver(post_save, sender=OptionalTopologie) @receiver(post_save, sender=OptionalTopologie)
@ -219,17 +218,18 @@ def optionaltopologie_post_save(**kwargs):
class GeneralOption(AclMixin, PreferencesModel): class GeneralOption(AclMixin, PreferencesModel):
"""Options générales : nombre de resultats par page, nom du site, """Options générales : nombre de resultats par page, nom du site,
temps les liens sont valides""" temps les liens sont valides"""
PRETTY_NAME = "Options générales"
general_message_fr = models.TextField( general_message_fr = models.TextField(
default="", default="",
blank=True, blank=True,
help_text="Message général affiché sur le site (maintenance, etc)" help_text=_("General message displayed on the French version of the"
" website (e.g. in case of maintenance)")
) )
general_message_en = models.TextField( general_message_en = models.TextField(
default="", default="",
blank=True, blank=True,
help_text="General message displayed on the English version of the website." help_text=_("General message displayed on the English version of the"
" website (e.g. in case of maintenance)")
) )
search_display_page = models.IntegerField(default=15) search_display_page = models.IntegerField(default=15)
pagination_number = models.IntegerField(default=25) pagination_number = models.IntegerField(default=25)
@ -250,8 +250,9 @@ class GeneralOption(AclMixin, PreferencesModel):
class Meta: class Meta:
permissions = ( permissions = (
("view_generaloption", "Peut voir les options générales"), ("view_generaloption", _("Can view the general options")),
) )
verbose_name = _("general options")
@receiver(post_save, sender=GeneralOption) @receiver(post_save, sender=GeneralOption)
@ -271,8 +272,10 @@ class Service(AclMixin, models.Model):
class Meta: class Meta:
permissions = ( permissions = (
("view_service", "Peut voir les options de service"), ("view_service", _("Can view the service options")),
) )
verbose_name = _("service")
verbose_name_plural =_("services")
def __str__(self): def __str__(self):
return str(self.name) return str(self.name)
@ -282,14 +285,14 @@ class MailContact(AclMixin, models.Model):
address = models.EmailField( address = models.EmailField(
default = "contact@example.org", default = "contact@example.org",
help_text = _("Contact email adress") help_text = _("Contact email address")
) )
commentary = models.CharField( commentary = models.CharField(
blank = True, blank = True,
null = True, null = True,
help_text = _( help_text = _(
"Description of the associated email adress."), "Description of the associated email address."),
max_length = 256 max_length = 256
) )
@ -299,8 +302,10 @@ class MailContact(AclMixin, models.Model):
class Meta: class Meta:
permissions = ( permissions = (
("view_mailcontact", _("Can see contact email")), ("view_mailcontact", _("Can view a contact email address object")),
) )
verbose_name = _("contact email address")
verbose_name_plural = _("contact email addresses")
def __str__(self): def __str__(self):
return(self.address) return(self.address)
@ -308,18 +313,17 @@ class MailContact(AclMixin, models.Model):
class AssoOption(AclMixin, PreferencesModel): class AssoOption(AclMixin, PreferencesModel):
"""Options générales de l'asso : siret, addresse, nom, etc""" """Options générales de l'asso : siret, addresse, nom, etc"""
PRETTY_NAME = "Options de l'association"
name = models.CharField( name = models.CharField(
default="Association réseau école machin", default=_("Networking organisation school Something"),
max_length=256 max_length=256
) )
siret = models.CharField(default="00000000000000", max_length=32) siret = models.CharField(default="00000000000000", max_length=32)
adresse1 = models.CharField(default="1 Rue de exemple", max_length=128) adresse1 = models.CharField(default=_("Threadneedle Street"), max_length=128)
adresse2 = models.CharField(default="94230 Cachan", max_length=128) adresse2 = models.CharField(default=_("London EC2R 8AH"), max_length=128)
contact = models.EmailField(default="contact@example.org") contact = models.EmailField(default="contact@example.org")
telephone = models.CharField(max_length=15, default="0000000000") telephone = models.CharField(max_length=15, default="0000000000")
pseudo = models.CharField(default="Asso", max_length=32) pseudo = models.CharField(default=_("Organisation"), max_length=32)
utilisateur_asso = models.OneToOneField( utilisateur_asso = models.OneToOneField(
'users.User', 'users.User',
on_delete=models.PROTECT, on_delete=models.PROTECT,
@ -333,8 +337,9 @@ class AssoOption(AclMixin, PreferencesModel):
class Meta: class Meta:
permissions = ( permissions = (
("view_assooption", "Peut voir les options de l'asso"), ("view_assooption", _("Can view the organisation options")),
) )
verbose_name = _("organisation options")
@receiver(post_save, sender=AssoOption) @receiver(post_save, sender=AssoOption)
@ -346,29 +351,26 @@ def assooption_post_save(**kwargs):
class HomeOption(AclMixin, PreferencesModel): class HomeOption(AclMixin, PreferencesModel):
"""Settings of the home page (facebook/twitter etc)""" """Settings of the home page (facebook/twitter etc)"""
PRETTY_NAME = "Options de la page d'accueil"
facebook_url = models.URLField( facebook_url = models.URLField(
null=True, null=True,
blank=True, blank=True
help_text="Url du compte facebook"
) )
twitter_url = models.URLField( twitter_url = models.URLField(
null=True, null=True,
blank=True, blank=True
help_text="Url du compte twitter"
) )
twitter_account_name = models.CharField( twitter_account_name = models.CharField(
max_length=32, max_length=32,
null=True, null=True,
blank=True, blank=True
help_text="Nom du compte à afficher"
) )
class Meta: class Meta:
permissions = ( permissions = (
("view_homeoption", "Peut voir les options de l'accueil"), ("view_homeoption", _("Can view the homepage options")),
) )
verbose_name = _("homepage options")
@receiver(post_save, sender=HomeOption) @receiver(post_save, sender=HomeOption)
@ -380,12 +382,14 @@ def homeoption_post_save(**kwargs):
class MailMessageOption(AclMixin, models.Model): class MailMessageOption(AclMixin, models.Model):
"""Reglages, mail de bienvenue et autre""" """Reglages, mail de bienvenue et autre"""
PRETTY_NAME = "Options de corps de mail"
welcome_mail_fr = models.TextField(default="") welcome_mail_fr = models.TextField(default="")
welcome_mail_en = models.TextField(default="") welcome_mail_en = models.TextField(default="")
class Meta: class Meta:
permissions = ( permissions = (
("view_mailmessageoption", "Peut voir les options de mail"), ("view_mailmessageoption", _("Can view the email message"
" options")),
) )
verbose_name = _("email message options")

View file

@ -24,11 +24,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load i18n %} {% load i18n %}
{% load acl %} {% load acl %}
{% load logs_extra %} {% load logs_extra %}
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th>{% trans "Adress" %}</th> <th>{% trans "Address" %}</th>
<th>{% trans "Remark" %}</th> <th>{% trans "Comment" %}</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
@ -45,3 +46,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>

View file

@ -23,14 +23,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %} {% endcomment %}
{% load acl %} {% load acl %}
{% load logs_extra %} {% load logs_extra %}
{% load i18n %}
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th>Nom</th> <th>{% trans "Name" %}</th>
<th>Url</th> <th>{% trans "URL" %}</th>
<th>Description</th> <th>{% trans "Description" %}</th>
<th>Image</th> <th>{% trans "Image" %}</th>
<th></th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>

View file

@ -28,223 +28,215 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load design %} {% load design %}
{% load i18n %} {% load i18n %}
{% block title %}Création et modification des préférences{% endblock %} {% block title %}{% trans "Preferences" %}{% endblock %}
{% block content %} {% block content %}
<h4>Préférences utilisateur</h4> <h4>{% trans "User preferences" %}</h4>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'OptionalUser' %}"> <a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'OptionalUser' %}">
<i class="fa fa-edit"></i> Editer <i class="fa fa-edit"></i>
{% trans "Edit" %}
</a> </a>
<h5>Généralités</h5>
<table class="table table-striped"> <table class="table table-striped">
<tr> <tr>
<th>Téléphone obligatoirement requis</th> <th>{% trans "Telephone number required" %}</th>
<td>{{ useroptions.is_tel_mandatory|tick }}</td> <td>{{ useroptions.is_tel_mandatory|tick }}</td>
<th>Auto inscription</th> <th>{% trans "Self registration" %}</th>
<td>{{ useroptions.self_adhesion|tick }}</td> <td>{{ useroptions.self_adhesion|tick }}</td>
</tr> </tr>
<tr> <tr>
<th>{% trans "Default shell for users" %}</th>
<th>Shell par défaut des utilisateurs</th>
<td>{{ useroptions.shell_default }}</td> <td>{{ useroptions.shell_default }}</td>
<th>Les utilisateurs peuvent changer leur shell</th> <th>{% trans "Users can edit their shell" %}</th>
<td>{{ useroptions.self_change_shell|tick }}</td> <td>{{ useroptions.self_change_shell|tick }}</td>
</tr> </tr>
<tr> <tr>
<th>Creations d'adhérents par tous</th> <th>{% trans "Creation of members by everyone" %}</th>
<td>{{ useroptions.all_can_create_adherent|tick }}</td> <td>{{ useroptions.all_can_create_adherent|tick }}</td>
<th>Creations de clubs par tous</th> <th>{% trans "Creation of clubs by everyone" %}</th>
<td>{{ useroptions.all_can_create_club|tick }}</td> <td>{{ useroptions.all_can_create_club|tick }}</td>
</tr> </tr>
<tr> <tr>
<th>Champ gpg fingerprint</th> <th>{% trans "GPG fingerprint field" %}</th>
<td>{{ useroptions.gpg_fingerprint|tick }}</td> <td>{{ useroptions.gpg_fingerprint|tick }}</td>
</tr> </tr>
</table> </table>
<h5>{% trans "Email accounts preferences" %}
<h5>Comptes mails</h5>
<table class="table table-striped"> <table class="table table-striped">
<tr> <tr>
<th>Gestion des comptes mails</th> <th>{% trans "Local email accounts enabled" %}</th>
<td>{{ useroptions.local_email_accounts_enabled|tick }}</td> <td>{{ useroptions.local_email_accounts_enabled|tick }}</td>
<th>Extension mail interne</th> <th>{% trans "Local email domain" %}</th>
<td>{{ useroptions.local_email_domain }}</td> <td>{{ useroptions.local_email_domain }}</td>
</tr> </tr>
<tr> <tr>
<th>Nombre d'alias mail max</th> <th>{% trans "Maximum number of email aliases allowed" %}</th>
<td>{{ useroptions.max_email_address }}</td> <td>{{ useroptions.max_email_address }}</td>
</tr> </tr>
</table> </table>
<h4>{% trans "Machines preferences" %}</h4>
<h4>Préférences machines</h4>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'OptionalMachine' %}"> <a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'OptionalMachine' %}">
<i class="fa fa-edit"></i> Editer <i class="fa fa-edit"></i>
{% trans "Edit" %}
</a> </a>
<p>
</p>
<table class="table table-striped"> <table class="table table-striped">
<tr> <tr>
<th>Mot de passe par machine</th> <th>{% trans "Password per machine" %}</th>
<td>{{ machineoptions.password_machine|tick }}</td> <td>{{ machineoptions.password_machine|tick }}</td>
<th>Machines/interfaces autorisées par utilisateurs</th> <th>{% trans "Maximum number of interfaces allowed for a standard user" %}</th>
<td>{{ machineoptions.max_lambdauser_interfaces }}</td> <td>{{ machineoptions.max_lambdauser_interfaces }}</td>
</tr> </tr>
<tr> <tr>
<th>Alias dns autorisé par utilisateur</th> <th>{% trans "Maximum number of DNS aliases allowed for a standard user" %}</th>
<td>{{ machineoptions.max_lambdauser_aliases }}</td> <td>{{ machineoptions.max_lambdauser_aliases }}</td>
<th>Support de l'ipv6</th> <th>{% trans "IPv6 support" %}</th>
<td>{{ machineoptions.ipv6_mode }}</td> <td>{{ machineoptions.ipv6_mode }}</td>
</tr> </tr>
<tr> <tr>
<th>Creation de machines</th> <th>{% trans "Creation of machines" %}</th>
<td>{{ machineoptions.create_machine|tick }}</td> <td>{{ machineoptions.create_machine|tick }}</td>
</tr> </tr>
</table> </table>
<h4>{% trans "Topology preferences" %}</h4>
<h4>Préférences topologie</h4>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'OptionalTopologie' %}"> <a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'OptionalTopologie' %}">
<i class="fa fa-edit"></i> Editer <i class="fa fa-edit"></i>
{% trans "Edit" %}
</a> </a>
<p>
</p>
<table class="table table-striped"> <table class="table table-striped">
<tr> <tr>
<th>Politique générale de placement de vlan</th> <th>{% trans "General policy for VLAN setting" %}</th>
<td>{{ topologieoptions.radius_general_policy }}</td> <td>{{ topologieoptions.radius_general_policy }}</td>
<th> <th>{% trans "This setting defines the VLAN policy after acceptance by RADIUS: either on the IP range's VLAN of the machine, or a VLAN preset in 'VLAN for machines accepted by RADIUS'" %}</th>
Ce réglage défini la politique vlan après acceptation radius :
soit sur le vlan de la plage d'ip de la machine, soit sur un
vlan prédéfini dans "Vlan où placer les machines après acceptation
RADIUS"
</th>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<th>Vlan où placer les machines après acceptation RADIUS</th> <th>{% trans "VLAN for machines accepted by RADIUS" %}</th>
<td>{{ topologieoptions.vlan_decision_ok }}</td> <td>{{ topologieoptions.vlan_decision_ok }}</td>
<th>Vlan où placer les machines après rejet RADIUS</th> <th>{% trans "VLAN for machines rejected by RADIUS" %}</th>
<td>{{ topologieoptions.vlan_decision_nok }}</td> <td>{{ topologieoptions.vlan_decision_nok }}</td>
</tr> </tr>
</table> </table>
<h4>{% trans "General preferences" %}</h4>
<h4>Préférences generales</h4>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'GeneralOption' %}"> <a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'GeneralOption' %}">
<i class="fa fa-edit"></i> Editer <i class="fa fa-edit"></i>
{% trans "Edit" %}
</a> </a>
<p>
</p>
<table class="table table-striped"> <table class="table table-striped">
<tr> <tr>
<th>Nom du site web</th> <th>{% trans "Website name" %}</th>
<td>{{ generaloptions.site_name }}</td> <td>{{ generaloptions.site_name }}</td>
<th>Adresse mail d'expedition automatique</th> <th>{% trans "Email address for automatic emailing" %}</th>
<td>{{ generaloptions.email_from }}</td> <td>{{ generaloptions.email_from }}</td>
</tr> </tr>
<tr> <tr>
<th>Affichage de résultats dans le champ de recherche</th> <th>{% trans "Number of results displayed when searching" %}</th>
<td>{{ generaloptions.search_display_page }}</td> <td>{{ generaloptions.search_display_page }}</td>
<th>Nombre d'items affichés en liste (taille normale)</th> <th>{% trans "Number of items per page (standard size)" %}</th>
<td>{{ generaloptions.pagination_number }}</td> <td>{{ generaloptions.pagination_number }}</td>
</tr> </tr>
<tr> <tr>
<th>Nombre d'items affichés en liste (taille élevée)</th> <th>{% trans "Number of items per page (large size)" %}</th>
<td>{{ generaloptions.pagination_large_number }}</td> <td>{{ generaloptions.pagination_large_number }}</td>
<th>Temps avant expiration du lien de reinitialisation de mot de passe (en heures)</th> <th>{% trans "Time before expiration of the reset password link (in hours)" %}</th>
<td>{{ generaloptions.req_expire_hrs }}</td> <td>{{ generaloptions.req_expire_hrs }}</td>
</tr> </tr>
<tr> <tr>
<th>Message global affiché sur le site</th> <th>{% trans "General message displayed on the website" %}</th>
<td>{{ generaloptions.general_message }}</td> <td>{{ generaloptions.general_message }}</td>
<th>Résumé des CGU</th> <th>{% trans "Summary of the General Terms of Use" %}</th>
<td>{{ generaloptions.GTU_sum_up }}</td> <td>{{ generaloptions.GTU_sum_up }}</td>
</tr>
<tr> <tr>
<tr> <th>{% trans "General Terms of Use" %}</th>
<th>CGU</th>
<td>{{ generaloptions.GTU }}</th> <td>{{ generaloptions.GTU }}</th>
</tr> </tr>
</table> </table>
<h4>{% trans "Information about the organisation" %}</h4>
<h4>Données de l'association</h4>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'AssoOption' %}"> <a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'AssoOption' %}">
<i class="fa fa-edit"></i> Editer <i class="fa fa-edit"></i>
{% trans "Edit" %}
</a> </a>
<p>
</p>
<table class="table table-striped"> <table class="table table-striped">
<tr> <tr>
<th>Nom</th> <th>{% trans "Name" %}</th>
<td>{{ assooptions.name }}</td> <td>{{ assooptions.name }}</td>
<th>SIRET</th> <th>{% trans "SIRET number" %}</th>
<td>{{ assooptions.siret }}</td> <td>{{ assooptions.siret }}</td>
</tr> </tr>
<tr> <tr>
<th>Adresse</th> <th>{% trans "Address" %}</th>
<td>{{ assooptions.adresse1 }}<br> <td>{{ assooptions.adresse1 }}<br>
{{ assooptions.adresse2 }}</td> {{ assooptions.adresse2 }}
<th>Contact mail</th> </td>
<th>{% trans "Contact email address" %}</th>
<td>{{ assooptions.contact }}</td> <td>{{ assooptions.contact }}</td>
</tr> </tr>
<tr> <tr>
<th>Telephone</th> <th>{% trans "Telephone number" %}</th>
<td>{{ assooptions.telephone }}</td> <td>{{ assooptions.telephone }}</td>
<th>Pseudo d'usage</th> <th>{% trans "Usual name" %}</th>
<td>{{ assooptions.pseudo }}</td> <td>{{ assooptions.pseudo }}</td>
</tr> </tr>
<tr> <tr>
<th>Objet utilisateur de l'association</th> <th>{% trans "User object of the organisation" %}</th>
<td>{{ assooptions.utilisateur_asso }}</td> <td>{{ assooptions.utilisateur_asso }}</td>
<th>Description de l'association</th> <th>{% trans "Description of the organisation" %}</th>
<td>{{ assooptions.description|safe }}</td> <td>{{ assooptions.description|safe }}</td>
</tr> </tr>
</table> </table>
<h4>{% trans "Custom email message" %}</h4>
<h4>Messages personalisé dans les mails</h4>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'MailMessageOption' %}"> <a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'MailMessageOption' %}">
<i class="fa fa-edit"></i> Editer <i class="fa fa-edit"></i>
{% trans "Edit" %}
</a> </a>
<p>
</p>
<table class="table table-striped"> <table class="table table-striped">
<tr> <tr>
<th>Mail de bienvenue (Français)</th> <th>{% trans "Welcome email (in French)" %}</th>
<td>{{ mailmessageoptions.welcome_mail_fr|safe }}</td> <td>{{ mailmessageoptions.welcome_mail_fr|safe }}</td>
</tr> </tr>
<tr> <tr>
<th>Mail de bienvenue (Anglais)</th> <th>{% trans "Welcome email (in English)" %}</th>
<td>{{ mailmessageoptions.welcome_mail_en|safe }}</td> <td>{{ mailmessageoptions.welcome_mail_en|safe }}</td>
</tr> </tr>
</table> </table>
<h4>{% trans "List of services and homepage preferences" %}</h4>
<h4>Liste des services et préférences page d'accueil</h4>
{% can_create preferences.Service%} {% can_create preferences.Service%}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-service' %}"><i class="fa fa-plus"> <a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-service' %}"><i class="fa fa-plus"></i>{% trans " Add a service" %}</a>
</i> Ajouter un service
</a>
{% acl_end %} {% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'preferences:del-service' %}"><i class="fa fa-trash"> <a class="btn btn-danger btn-sm" role="button" href="{% url 'preferences:del-service' %}"><i class="fa fa-trash"></i>{% trans " Delete one or several services" %}</a>
</i> Supprimer un ou plusieurs service
</a>
{% include "preferences/aff_service.html" with service_list=service_list %} {% include "preferences/aff_service.html" with service_list=service_list %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'HomeOption' %}"> <a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'HomeOption' %}">
<i class="fa fa-edit"></i> Editer <i class="fa fa-edit"></i>
{% trans "Edit" %}
</a> </a>
<h2>{% trans "List of contact email addresses" %}</h2>
<h2>{% trans "Contact email adresses list" %}</h2>
{% can_create preferences.MailContact %} {% can_create preferences.MailContact %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-mailcontact' %}"><i class="fa fa-plus"></i>{% trans "Add an adress" %}</a> <a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-mailcontact' %}"><i class="fa fa-plus"></i>{% trans "Add an address" %}</a>
{% acl_end %} {% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'preferences:del-mailcontact' %}"><i class="fa fa-trash"></i>{% trans "Delete one or multiple adresses" %}</a> <a class="btn btn-danger btn-sm" role="button" href="{% url 'preferences:del-mailcontact' %}"><i class="fa fa-trash"></i>{% trans "Delete one or several addresses" %}</a>
{% include "preferences/aff_mailcontact.html" with mailcontact_list=mailcontact_list %} {% include "preferences/aff_mailcontact.html" with mailcontact_list=mailcontact_list %}
<p> <p>
</p>
<table class="table table-striped"> <table class="table table-striped">
<tr> <tr>
<th>Url du compte twitter</th> <th>{% trans "Twitter account URL" %}</th>
<td>{{ homeoptions.twitter_url }}</td> <td>{{ homeoptions.twitter_url }}</td>
<th>Nom utilisé pour afficher le compte</th> <th>{% trans "Twitter account name" %}</th>
<td>{{ homeoptions.twitter_account_name }}</td> <td>{{ homeoptions.twitter_account_name }}</td>
</tr> </tr>
<tr> <tr>
<th>Url du compte facebook</th> <th>{% trans "Facebook account URL" %}</th>
<td>{{ homeoptions.facebook_url }}</td> <td>{{ homeoptions.facebook_url }}</td>
</tr> </tr>
</table> </table>
{% endblock %} {% endblock %}

View file

@ -25,20 +25,23 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load bootstrap3 %} {% load bootstrap3 %}
{% load massive_bootstrap_form %} {% load massive_bootstrap_form %}
{% load i18n %}
{% block title %}Création et modification des préférences{% endblock %} {% block title %}{% trans "Preferences" %}{% endblock %}
{% block content %} {% block content %}
{% bootstrap_form_errors options %} {% bootstrap_form_errors options %}
<h3>Edition des préférences</h3> <h3>{% trans "Editing of preferences" %}</h3>
<form class="form" method="post" enctype="multipart/form-data"> <form class="form" method="post" enctype="multipart/form-data">
{% csrf_token %} {% csrf_token %}
{% massive_bootstrap_form options 'utilisateur_asso' %} {% massive_bootstrap_form options 'utilisateur_asso' %}
{% bootstrap_button "Modifier" button_type="submit" icon="star" %} {% trans "Edit" as tr_edit %}
{% bootstrap_button tr_edit button_type="submit" icon="star" %}
</form> </form>
<br /> <br />
<br /> <br />
<br /> <br />
{% endblock %} {% endblock %}

View file

@ -24,8 +24,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %} {% endcomment %}
{% load bootstrap3 %} {% load bootstrap3 %}
{% load i18n %}
{% block title %}Création et modification des preferences{% endblock %} {% block title %}{% trans "Preferences" %}{% endblock %}
{% block content %} {% block content %}
{% if preferenceform %} {% if preferenceform %}
@ -44,3 +45,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<br /> <br />
<br /> <br />
{% endblock %} {% endblock %}

View file

@ -95,14 +95,14 @@ def edit_options(request, section):
model = getattr(models, section, None) model = getattr(models, section, None)
form_instance = getattr(forms, 'Edit' + section + 'Form', None) form_instance = getattr(forms, 'Edit' + section + 'Form', None)
if not (model or form_instance): if not (model or form_instance):
messages.error(request, "Objet inconnu") messages.error(request, _("Unknown object"))
return redirect(reverse('preferences:display-options')) return redirect(reverse('preferences:display-options'))
options_instance, _created = model.objects.get_or_create() options_instance, _created = model.objects.get_or_create()
can, msg = options_instance.can_edit(request.user) can, msg = options_instance.can_edit(request.user)
if not can: if not can:
messages.error(request, msg or "Vous ne pouvez pas éditer cette\ messages.error(request, msg or _("You don't have the right to edit"
option.") " this option."))
return redirect(reverse('index')) return redirect(reverse('index'))
options = form_instance( options = form_instance(
request.POST or None, request.POST or None,
@ -114,11 +114,11 @@ def edit_options(request, section):
options.save() options.save()
reversion.set_user(request.user) reversion.set_user(request.user)
reversion.set_comment( reversion.set_comment(
"Champs modifié(s) : %s" % ', '.join( "Field(s) edited: %s" % ', '.join(
field for field in options.changed_data field for field in options.changed_data
) )
) )
messages.success(request, "Préférences modifiées") messages.success(request, _("The preferences were edited."))
return redirect(reverse('preferences:display-options')) return redirect(reverse('preferences:display-options'))
return form( return form(
{'options': options}, {'options': options},
@ -136,11 +136,11 @@ def add_service(request):
with transaction.atomic(), reversion.create_revision(): with transaction.atomic(), reversion.create_revision():
service.save() service.save()
reversion.set_user(request.user) reversion.set_user(request.user)
reversion.set_comment("Création") reversion.set_comment("Creation")
messages.success(request, "Ce service a été ajouté") messages.success(request, _("The service was added."))
return redirect(reverse('preferences:display-options')) return redirect(reverse('preferences:display-options'))
return form( return form(
{'preferenceform': service, 'action_name': 'Ajouter'}, {'preferenceform': service, 'action_name': _("Add a service")},
'preferences/preferences.html', 'preferences/preferences.html',
request request
) )
@ -160,14 +160,14 @@ def edit_service(request, service_instance, **_kwargs):
service.save() service.save()
reversion.set_user(request.user) reversion.set_user(request.user)
reversion.set_comment( reversion.set_comment(
"Champs modifié(s) : %s" % ', '.join( "Field(s) edited: %s" % ', '.join(
field for field in service.changed_data field for field in service.changed_data
) )
) )
messages.success(request, "Service modifié") messages.success(request, _("The service was edited."))
return redirect(reverse('preferences:display-options')) return redirect(reverse('preferences:display-options'))
return form( return form(
{'preferenceform': service, 'action_name': 'Editer'}, {'preferenceform': service, 'action_name': _("Edit")},
'preferences/preferences.html', 'preferences/preferences.html',
request request
) )
@ -185,13 +185,13 @@ def del_service(request, instances):
with transaction.atomic(), reversion.create_revision(): with transaction.atomic(), reversion.create_revision():
services_del.delete() services_del.delete()
reversion.set_user(request.user) reversion.set_user(request.user)
messages.success(request, "Le service a été supprimé") messages.success(request, _("The service was deleted."))
except ProtectedError: except ProtectedError:
messages.error(request, "Erreur le service\ messages.error(request, _("Error: the service %s can't be"
suivant %s ne peut être supprimé" % services_del) " deleted.") % services_del)
return redirect(reverse('preferences:display-options')) return redirect(reverse('preferences:display-options'))
return form( return form(
{'preferenceform': services, 'action_name': 'Supprimer'}, {'preferenceform': services, 'action_name': _("Delete")},
'preferences/preferences.html', 'preferences/preferences.html',
request request
) )
@ -207,10 +207,11 @@ def add_mailcontact(request):
) )
if mailcontact.is_valid(): if mailcontact.is_valid():
mailcontact.save() mailcontact.save()
messages.success(request, _("The adress was created.")) messages.success(request, _("The contact email address was created."))
return redirect(reverse('preferences:display-options')) return redirect(reverse('preferences:display-options'))
return form( return form(
{'preferenceform': mailcontact, 'action_name': 'Ajouter'}, {'preferenceform': mailcontact,
'action_name': _("Add a contact email address")},
'preferences/preferences.html', 'preferences/preferences.html',
request request
) )
@ -227,10 +228,10 @@ def edit_mailcontact(request, mailcontact_instance, **_kwargs):
) )
if mailcontact.is_valid(): if mailcontact.is_valid():
mailcontact.save() mailcontact.save()
messages.success(request, _("Email adress updated.")) messages.success(request, _("The contact email address was edited."))
return redirect(reverse('preferences:display-options')) return redirect(reverse('preferences:display-options'))
return form( return form(
{'preferenceform': mailcontact, 'action_name': _('Edit')}, {'preferenceform': mailcontact, 'action_name': _("Edit")},
'preferences/preferences.html', 'preferences/preferences.html',
request request
) )
@ -248,10 +249,12 @@ def del_mailcontact(request, instances):
mailcontacts_dels = mailcontacts.cleaned_data['mailcontacts'] mailcontacts_dels = mailcontacts.cleaned_data['mailcontacts']
for mailcontacts_del in mailcontacts_dels: for mailcontacts_del in mailcontacts_dels:
mailcontacts_del.delete() mailcontacts_del.delete()
messages.success(request, _("The email adress was deleted.")) messages.success(request,
_("The contact email adress was deleted."))
return redirect(reverse('preferences:display-options')) return redirect(reverse('preferences:display-options'))
return form( return form(
{'preferenceform': mailcontacts, 'action_name': _('Delete')}, {'preferenceform': mailcontacts, 'action_name': _("Delete")},
'preferences/preferences.html', 'preferences/preferences.html',
request request
) )