8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-23 07:23:46 +00:00

add translations for preferences/

This commit is contained in:
Laouen Fernet 2019-01-09 00:39:47 +01:00
parent 62d09760b3
commit 77e62df3b8
15 changed files with 1113 additions and 452 deletions

View file

@ -359,7 +359,7 @@ class DelMailContactForm(Form):
"""Delete contact email adress"""
mailcontacts = forms.ModelMultipleChoiceField(
queryset=MailContact.objects.none(),
label="Enregistrements adresses actuels",
label=_("Current email addresses"),
widget=forms.CheckboxSelectMultiple
)

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,208 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2019-01-08 22:50
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import re2o.aes_field
class Migration(migrations.Migration):
dependencies = [
('preferences', '0057_optionaluser_all_users_active'),
]
operations = [
migrations.AlterModelOptions(
name='radiuskey',
options={'permissions': (('view_radiuskey', 'Can view a RADIUS key object'),), 'verbose_name': 'RADIUS key', 'verbose_name_plural': 'RADIUS keys'},
),
migrations.AlterModelOptions(
name='radiusoption',
options={'verbose_name': 'RADIUS policy', 'verbose_name_plural': 'RADIUS policies'},
),
migrations.AlterModelOptions(
name='reminder',
options={'permissions': (('view_reminder', 'Can view a reminder object'),), 'verbose_name': 'reminder', 'verbose_name_plural': 'reminders'},
),
migrations.AlterModelOptions(
name='switchmanagementcred',
options={'permissions': (('view_switchmanagementcred', 'Can view a switch management credentials object'),), 'verbose_name': 'switch management credentials'},
),
migrations.AlterField(
model_name='mailmessageoption',
name='welcome_mail_en',
field=models.TextField(default='', help_text='Welcome email in English'),
),
migrations.AlterField(
model_name='mailmessageoption',
name='welcome_mail_fr',
field=models.TextField(default='', help_text='Welcome email in French'),
),
migrations.AlterField(
model_name='optionaltopologie',
name='sftp_login',
field=models.CharField(blank=True, help_text='SFTP login for switches', max_length=32, null=True),
),
migrations.AlterField(
model_name='optionaltopologie',
name='sftp_pass',
field=re2o.aes_field.AESEncryptedField(blank=True, help_text='SFTP password', max_length=63, null=True),
),
migrations.AlterField(
model_name='optionaltopologie',
name='switchs_ip_type',
field=models.OneToOneField(blank=True, help_text='IP range for the management of switches', null=True, on_delete=django.db.models.deletion.PROTECT, to='machines.IpType'),
),
migrations.AlterField(
model_name='optionaltopologie',
name='switchs_provision',
field=models.CharField(choices=[('sftp', 'sftp'), ('tftp', 'tftp')], default='tftp', help_text='Provision of configuration mode for switches', max_length=32),
),
migrations.AlterField(
model_name='optionaltopologie',
name='switchs_rest_management',
field=models.BooleanField(default=False, help_text='REST management, activated in case of automatic provision'),
),
migrations.AlterField(
model_name='optionaltopologie',
name='switchs_web_management',
field=models.BooleanField(default=False, help_text='Web management, activated in case of automatic provision'),
),
migrations.AlterField(
model_name='optionaltopologie',
name='switchs_web_management_ssl',
field=models.BooleanField(default=False, help_text='SSL web management, make sure that a certificate is installed on the switch'),
),
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='all_users_active',
field=models.BooleanField(default=False, help_text='If True, all new created and connected users are active. If False, only when a valid registration has been paid.'),
),
migrations.AlterField(
model_name='optionaluser',
name='delete_notyetactive',
field=models.IntegerField(default=15, help_text='Not yet active users will be deleted after this number of days.'),
),
migrations.AlterField(
model_name='optionaluser',
name='local_email_accounts_enabled',
field=models.BooleanField(default=False, help_text='Enable local email accounts for users.'),
),
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_room',
field=models.BooleanField(default=False, help_text='Users can edit their room.'),
),
migrations.AlterField(
model_name='optionaluser',
name='self_change_shell',
field=models.BooleanField(default=False, help_text='Users can edit their shell.'),
),
migrations.AlterField(
model_name='radiuskey',
name='comment',
field=models.CharField(blank=True, help_text='Comment for this key', max_length=255, null=True),
),
migrations.AlterField(
model_name='radiuskey',
name='default_switch',
field=models.BooleanField(default=True, help_text='Default key for switches', unique=True),
),
migrations.AlterField(
model_name='radiuskey',
name='radius_key',
field=re2o.aes_field.AESEncryptedField(help_text='RADIUS key', max_length=255),
),
migrations.AlterField(
model_name='radiusoption',
name='banned',
field=models.CharField(choices=[('REJECT', 'Reject the machine'), ('SET_VLAN', 'Place the machine on the VLAN')], default='REJECT', max_length=32, verbose_name='Policy for banned users'),
),
migrations.AlterField(
model_name='radiusoption',
name='banned_vlan',
field=models.ForeignKey(blank=True, help_text='VLAN for banned users if not rejected', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='banned_vlan', to='machines.Vlan', verbose_name='Banned users VLAN'),
),
migrations.AlterField(
model_name='radiusoption',
name='non_member',
field=models.CharField(choices=[('REJECT', 'Reject the machine'), ('SET_VLAN', 'Place the machine on the VLAN')], default='REJECT', max_length=32, verbose_name='Policy for non members'),
),
migrations.AlterField(
model_name='radiusoption',
name='non_member_vlan',
field=models.ForeignKey(blank=True, help_text='VLAN for non members if not rejected', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='non_member_vlan', to='machines.Vlan', verbose_name='Non members VLAN'),
),
migrations.AlterField(
model_name='radiusoption',
name='unknown_machine_vlan',
field=models.ForeignKey(blank=True, help_text='VLAN for unknown machines if not rejected', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='unknown_machine_vlan', to='machines.Vlan', verbose_name='Unknown machines VLAN'),
),
migrations.AlterField(
model_name='radiusoption',
name='unknown_port',
field=models.CharField(choices=[('REJECT', 'Reject the machine'), ('SET_VLAN', 'Place the machine on the VLAN')], default='REJECT', max_length=32, verbose_name='Policy for unknown ports'),
),
migrations.AlterField(
model_name='radiusoption',
name='unknown_port_vlan',
field=models.ForeignKey(blank=True, help_text='VLAN for unknown ports if not rejected', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='unknown_port_vlan', to='machines.Vlan', verbose_name='Unknown ports VLAN'),
),
migrations.AlterField(
model_name='radiusoption',
name='unknown_room',
field=models.CharField(choices=[('REJECT', 'Reject the machine'), ('SET_VLAN', 'Place the machine on the VLAN')], default='REJECT', max_length=32, verbose_name='Policy for machines connecting from unregistered rooms (relevant on ports with STRICT RADIUS mode)'),
),
migrations.AlterField(
model_name='radiusoption',
name='unknown_room_vlan',
field=models.ForeignKey(blank=True, help_text='VLAN for unknown rooms if not rejected', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='unknown_room_vlan', to='machines.Vlan', verbose_name='Unknown rooms VLAN'),
),
migrations.AlterField(
model_name='reminder',
name='days',
field=models.IntegerField(default=7, help_text="Delay between the email and the membership's end", unique=True),
),
migrations.AlterField(
model_name='reminder',
name='message',
field=models.CharField(blank=True, default='', help_text='Message displayed specifically for this reminder', max_length=255, null=True),
),
migrations.AlterField(
model_name='switchmanagementcred',
name='default_switch',
field=models.BooleanField(default=True, help_text='Default credentials for switches', unique=True),
),
migrations.AlterField(
model_name='switchmanagementcred',
name='management_id',
field=models.CharField(help_text='Switch login', max_length=63),
),
migrations.AlterField(
model_name='switchmanagementcred',
name='management_pass',
field=re2o.aes_field.AESEncryptedField(help_text='Password', max_length=63),
),
]

View file

@ -73,11 +73,11 @@ class OptionalUser(AclMixin, PreferencesModel):
gpg_fingerprint = models.BooleanField(default=True)
all_can_create_club = models.BooleanField(
default=False,
help_text=_("Users can create a club")
help_text=_("Users can create a club.")
)
all_can_create_adherent = models.BooleanField(
default=False,
help_text=_("Users can create a member"),
help_text=_("Users can create a member."),
)
shell_default = models.OneToOneField(
@ -88,15 +88,15 @@ class OptionalUser(AclMixin, PreferencesModel):
)
self_change_shell = models.BooleanField(
default=False,
help_text=_("Users can edit their shell")
help_text=_("Users can edit their shell.")
)
self_change_room = models.BooleanField(
default=False,
help_text=_("Users can edit their room")
help_text=_("Users can edit their room.")
)
local_email_accounts_enabled = models.BooleanField(
default=False,
help_text=_("Enable local email accounts for users")
help_text=_("Enable local email accounts for users.")
)
local_email_domain = models.CharField(
max_length=32,
@ -106,20 +106,21 @@ class OptionalUser(AclMixin, PreferencesModel):
max_email_address = models.IntegerField(
default=15,
help_text=_("Maximum number of local email addresses for a standard"
" user")
" user.")
)
delete_notyetactive = models.IntegerField(
default=15,
help_text=_("Inactive users will be deleted after this number of days")
help_text=_("Not yet active users will be deleted after this number of"
" days.")
)
self_adhesion = models.BooleanField(
default=False,
help_text=_("A new user can create their account on Re2o")
help_text=_("A new user can create their account on Re2o.")
)
all_users_active = models.BooleanField(
default=False,
help_text=_("If True, all new created and connected users are active.\
If False, only when a valid registration has been paid")
help_text=_("If True, all new created and connected users are active."
" If False, only when a valid registration has been paid.")
)
class Meta:
@ -206,40 +207,41 @@ class OptionalTopologie(AclMixin, PreferencesModel):
switchs_web_management = models.BooleanField(
default=False,
help_text="Web management, activé si provision automatique"
help_text=_("Web management, activated in case of automatic provision")
)
switchs_web_management_ssl = models.BooleanField(
default=False,
help_text="Web management ssl. Assurez-vous que un certif est installé sur le switch !"
help_text=_("SSL web management, make sure that a certificate is"
" installed on the switch")
)
switchs_rest_management = models.BooleanField(
default=False,
help_text="Rest management, activé si provision auto"
help_text=_("REST management, activated in case of automatic provision")
)
switchs_ip_type = models.OneToOneField(
'machines.IpType',
on_delete=models.PROTECT,
blank=True,
null=True,
help_text="Plage d'ip de management des switchs"
help_text=_("IP range for the management of switches")
)
switchs_provision = models.CharField(
max_length=32,
choices=CHOICE_PROVISION,
default='tftp',
help_text="Mode de récupération des confs par les switchs"
help_text=_("Provision of configuration mode for switches")
)
sftp_login = models.CharField(
max_length=32,
null=True,
blank=True,
help_text="Login sftp des switchs"
help_text=_("SFTP login for switches")
)
sftp_pass = AESEncryptedField(
max_length=63,
null=True,
blank=True,
help_text="Mot de passe sftp"
help_text=_("SFTP password")
)
@cached_property
@ -314,52 +316,56 @@ class RadiusKey(AclMixin, models.Model):
"""Class of a radius key"""
radius_key = AESEncryptedField(
max_length=255,
help_text="Clef radius"
help_text=_("RADIUS key")
)
comment = models.CharField(
max_length=255,
null=True,
blank=True,
help_text="Commentaire de cette clef"
help_text=_("Comment for this key")
)
default_switch = models.BooleanField(
default=True,
unique=True,
help_text= "Clef par défaut des switchs"
help_text=_("Default key for switches")
)
class Meta:
permissions = (
("view_radiuskey", "Peut voir un objet radiuskey"),
("view_radiuskey", _("Can view a RADIUS key object")),
)
verbose_name = _("RADIUS key")
verbose_name_plural = _("RADIUS keys")
def __str__(self):
return "Clef radius " + str(self.id) + " " + str(self.comment)
return _("RADIUS key ") + str(self.id) + " " + str(self.comment)
class SwitchManagementCred(AclMixin, models.Model):
"""Class of a management creds of a switch, for rest management"""
management_id = models.CharField(
max_length=63,
help_text="Login du switch"
help_text=_("Switch login")
)
management_pass = AESEncryptedField(
max_length=63,
help_text="Mot de passe"
help_text=_("Password")
)
default_switch = models.BooleanField(
default=True,
unique=True,
help_text= "Creds par défaut des switchs"
help_text=_("Default credentials for switches")
)
class Meta:
permissions = (
("view_switchmanagementcred", "Peut voir un objet switchmanagementcred"),
("view_switchmanagementcred", _("Can view a switch management"
" credentials object")),
)
verbose_name = _("switch management credentials")
def __str__(self):
return "Identifiant " + str(self.management_id)
return _("Switch login ") + str(self.management_id)
class Reminder(AclMixin, models.Model):
@ -367,25 +373,26 @@ class Reminder(AclMixin, models.Model):
Days: liste des nombres de jours pour lesquells un mail est envoyé
optionalMessage: message additionel pour le mail
"""
PRETTY_NAME="Options pour le mail de fin d'adhésion"
days = models.IntegerField(
default=7,
unique=True,
help_text="Délais entre le mail et la fin d'adhésion"
help_text=_("Delay between the email and the membership's end")
)
message = models.CharField(
max_length=255,
default="",
null=True,
blank=True,
help_text="Message affiché spécifiquement pour ce rappel"
help_text=_("Message displayed specifically for this reminder")
)
class Meta:
permissions = (
("view_reminder", "Peut voir un objet reminder"),
("view_reminder", _("Can view a reminder object")),
)
verbose_name = _("reminder")
verbose_name_plural = _("reminders")
def users_to_remind(self):
from re2o.utils import all_has_access
@ -472,8 +479,7 @@ class MailContact(AclMixin, models.Model):
commentary = models.CharField(
blank = True,
null = True,
help_text = _(
"Description of the associated email address."),
help_text = _("Description of the associated email address."),
max_length = 256
)
@ -564,8 +570,8 @@ def homeoption_post_save(**kwargs):
class MailMessageOption(AclMixin, models.Model):
"""Reglages, mail de bienvenue et autre"""
welcome_mail_fr = models.TextField(default="", help_text="Mail de bienvenue en français")
welcome_mail_en = models.TextField(default="", help_text="Mail de bienvenue en anglais")
welcome_mail_fr = models.TextField(default="", help_text=_("Welcome email in French"))
welcome_mail_en = models.TextField(default="", help_text=_("Welcome email in English"))
class Meta:
permissions = (
@ -577,7 +583,8 @@ class MailMessageOption(AclMixin, models.Model):
class RadiusOption(AclMixin, PreferencesModel):
class Meta:
verbose_name = _("radius policies")
verbose_name = _("RADIUS policy")
verbose_name_plural = _("RADIUS policies")
MACHINE = 'MACHINE'
DEFINED = 'DEFINED'
@ -588,8 +595,8 @@ class RadiusOption(AclMixin, PreferencesModel):
REJECT = 'REJECT'
SET_VLAN = 'SET_VLAN'
CHOICE_POLICY = (
(REJECT, _('Reject the machine')),
(SET_VLAN, _('Place the machine on the VLAN'))
(REJECT, _("Reject the machine")),
(SET_VLAN, _("Place the machine on the VLAN"))
)
radius_general_policy = models.CharField(
max_length=32,
@ -608,16 +615,14 @@ class RadiusOption(AclMixin, PreferencesModel):
related_name='unknown_machine_vlan',
blank=True,
null=True,
verbose_name=_('Unknown machine Vlan'),
help_text=_(
'Vlan for unknown machines if not rejected.'
)
verbose_name=_("Unknown machines VLAN"),
help_text=_("VLAN for unknown machines if not rejected")
)
unknown_port = models.CharField(
max_length=32,
choices=CHOICE_POLICY,
default=REJECT,
verbose_name=_("Policy for unknown port"),
verbose_name=_("Policy for unknown ports"),
)
unknown_port_vlan = models.ForeignKey(
'machines.Vlan',
@ -625,20 +630,15 @@ class RadiusOption(AclMixin, PreferencesModel):
related_name='unknown_port_vlan',
blank=True,
null=True,
verbose_name=_('Unknown port Vlan'),
help_text=_(
'Vlan for unknown ports if not rejected.'
)
verbose_name=_("Unknown ports VLAN"),
help_text=_("VLAN for unknown ports if not rejected")
)
unknown_room = models.CharField(
max_length=32,
choices=CHOICE_POLICY,
default=REJECT,
verbose_name=_(
"Policy for machine connecting from "
"unregistered room (relevant on ports with STRICT "
"radius mode)"
),
verbose_name=_("Policy for machines connecting from unregistered rooms"
" (relevant on ports with STRICT RADIUS mode)"),
)
unknown_room_vlan = models.ForeignKey(
'machines.Vlan',
@ -646,16 +646,14 @@ class RadiusOption(AclMixin, PreferencesModel):
on_delete=models.PROTECT,
blank=True,
null=True,
verbose_name=_('Unknown room Vlan'),
help_text=_(
'Vlan for unknown room if not rejected.'
)
verbose_name=_("Unknown rooms VLAN"),
help_text=_("VLAN for unknown rooms if not rejected")
)
non_member = models.CharField(
max_length=32,
choices=CHOICE_POLICY,
default=REJECT,
verbose_name=_("Policy non member users."),
verbose_name=_("Policy for non members"),
)
non_member_vlan = models.ForeignKey(
'machines.Vlan',
@ -663,16 +661,14 @@ class RadiusOption(AclMixin, PreferencesModel):
on_delete=models.PROTECT,
blank=True,
null=True,
verbose_name=_('Non member Vlan'),
help_text=_(
'Vlan for non members if not rejected.'
)
verbose_name=_("Non members VLAN"),
help_text=_("VLAN for non members if not rejected")
)
banned = models.CharField(
max_length=32,
choices=CHOICE_POLICY,
default=REJECT,
verbose_name=_("Policy for banned users."),
verbose_name=_("Policy for banned users"),
)
banned_vlan = models.ForeignKey(
'machines.Vlan',
@ -680,10 +676,8 @@ class RadiusOption(AclMixin, PreferencesModel):
on_delete=models.PROTECT,
blank=True,
null=True,
verbose_name=_('Banned Vlan'),
help_text=_(
'Vlan for banned if not rejected.'
)
verbose_name=_("Banned users VLAN"),
help_text=_("VLAN for banned users if not rejected")
)
vlan_decision_ok = models.OneToOneField(
'machines.Vlan',

View file

@ -23,35 +23,35 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load acl %}
{% load logs_extra %}
<table class="table table-striped">
<thead>
<tr>
<th>Id Clef</th>
<th>Commentaire</th>
<th>Clef par default des switchs</th>
<th>Clef utilisée par les switchs</th>
<th></th>
<th></th>
{% load i18n %}
<table class="table table-striped">
<thead>
<tr>
<th>{% trans "RADIUS key ID" %}</th>
<th>{% trans "Comment" %}</th>
<th>{% trans "Default RADIUS key for switches" %}</th>
<th>{% trans "RADIUS key used by the swithes" %}</th>
<th></th>
<th></th>
</tr>
</thead>
{% for radiuskey in radiuskey_list %}
</thead>
{% for radiuskey in radiuskey_list %}
<tr>
<td>{{ radiuskey.id }}</td>
<td>{{ radiuskey.comment }}</td>
<td>{{ radiuskey.default_switch }}</td>
<td>{{ radiuskey.switch_set.all|join:", " }}</td>
<td>{{ radiuskey.switch_set.all|join:", " }}</td>
<td class="text-right">
{% can_edit radiuskey %}
{% include 'buttons/edit.html' with href='preferences:edit-radiuskey' id=radiuskey.id %}
{% acl_end %}
{% can_delete radiuskey %}
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'preferences:del-radiuskey' radiuskey.pk %}">
<i class="fa fa-trash"></i>
</a>
{% can_delete radiuskey %}
{% include 'buttons/suppr.html' with href='preferences:del-radiuskey' id=radiuskey.id %}
{% acl_end %}
{% history_button radiuskey %}
</td>
</tr>
{% endfor %}
</table>
{% endfor %}
</table>

View file

@ -31,7 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</tr>
<tr>
<th>{% trans "VLAN for machines accepted by RADIUS" %}</th>
<td><span class="label label-success">Vlan {{ radiusoptions.vlan_decision_ok }}</span></td>
<td><span class="label label-success">{% blocktrans with vlan_decision_ok=radiusoptions.vlan_decision_ok %}VLAN {{ vlan_decision_ok }}{% endblocktrans %}</span></td>
</tr>
</table>
<hr/>
@ -39,7 +39,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<thead>
<tr>
<th>{% trans "Situation" %}</th>
<th>{% trans "Behavior" %}</th>
<th>{% trans "Behaviour" %}</th>
</tr>
</thead>
<tr>
@ -48,7 +48,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if radiusoptions.unknown_machine == 'REJECT' %}
<span class="label label-danger">{% trans "Reject" %}</span>
{% else %}
<span class="label label-success">Vlan {{ radiusoptions.unknown_machine_vlan }}</span>
<span class="label label-success">{% blocktrans with unknown_machine_vlan=radiusoptions.unknown_machine_vlan %}VLAN {{ unknown_machine_vlan }}{% endblocktrans %}</span>
{% endif %}
</td>
</tr>
@ -58,7 +58,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if radiusoptions.unknown_port == 'REJECT' %}
<span class="label label-danger">{% trans "Reject" %}</span>
{% else %}
<span class="label label-success">Vlan {{ radiusoptions.unknown_port_vlan }}</span>
<span class="label label-success">{% blocktrans with unknown_port_vlan=radiusoptions.unknown_port_vlan %}VLAN {{ unknown_port_vlan }}{% endblocktrans %}</span>
{% endif %}
</td>
</tr>
@ -68,7 +68,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if radiusoptions.unknown_room == 'REJECT' %}
<span class="label label-danger">{% trans "Reject" %}</span>
{% else %}
<span class="label label-success">Vlan {{ radiusoptions.unknown_room_vlan }}</span>
<span class="label label-success">{% blocktrans with unknown_room_vlan=radiusoptions.unknown_room_vlan %}VLAN {{ unknown_room_vlan }}{% endblocktrans %}</span>
{% endif %}
</td>
</tr>
@ -78,7 +78,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if radiusoptions.non_member == 'REJECT' %}
<span class="label label-danger">{% trans "Reject" %}</span>
{% else %}
<span class="label label-success">Vlan {{ radiusoptions.non_member_vlan }}</span>
<span class="label label-success">{% blocktrans with non_member_vlan=radiusoptions.non_member_vlan %}VLAN {{ non_member_vlan }}{% endblocktrans %}</span>
{% endif %}
</td>
</tr>
@ -88,7 +88,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if radiusoptions.unknown_port == 'REJECT' %}
<span class="label label-danger">{% trans "Reject" %}</span>
{% else %}
<span class="label label-success">Vlan {{ radiusoptions.banned_vlan }}</span>
<span class="label label-success">{% blocktrans with banned_vlan=radiusoptions.banned_vlan %}VLAN {{ banned_vlan }}{% endblocktrans %}</span>
{% endif %}
</td>
</tr>

View file

@ -23,31 +23,31 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load acl %}
{% load logs_extra %}
{% load i18n %}
<table class="table table-striped">
<thead>
<tr>
<th>Nombre de jours avant le rappel</th>
<th>Message custom pour ce rappel</th>
<th></th>
<th>{% trans "Number of days before the reminder" %}</th>
<th>{% trans "Message for this reminder" %}</th>
<th></th>
<th></th>
</tr>
</thead>
{% for reminder in reminder_list %}
<tr>
<td>{{ reminder.days }}</td>
<td>{{ reminder.message }}</td>
<td class="text-right">
{% can_edit reminder %}
{% include 'buttons/edit.html' with href='preferences:edit-reminder' id=reminder.id %}
{% can_delete reminder %}
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'preferences:del-reminder' reminder.id %}">
<i class="fa fa-trash"></i>
</a>
{% acl_end %}
{% acl_end %}
{% history_button reminder %}
</td>
</tr>
<tr>
<td>{{ reminder.days }}</td>
<td>{{ reminder.message }}</td>
<td class="text-right">
{% can_edit reminder %}
{% include 'buttons/edit.html' with href='preferences:edit-reminder' id=reminder.id %}
{% acl_end %}
{% can_delete reminder %}
{% include 'buttons/suppr.html' with href='preferences:del-reminder' id=reminder.id %}
{% acl_end %}
{% history_button reminder %}
</td>
</tr>
{% endfor %}
</table>

View file

@ -42,15 +42,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>{{ service.description }}</td>
<td>{{ service.image }}</td>
<td class="text-right">
{% can_edit service%}
{% include 'buttons/edit.html' with href='preferences:edit-service' id=service.id %}
{% can_delete service %}
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'preferences:del-service' service.id %}">
<i class="fa fa-trash"></i>
</a>
{% acl_end %}
{% acl_end %}
{% history_button service %}
{% can_edit service%}
{% include 'buttons/edit.html' with href='preferences:edit-service' id=service.id %}
{% acl_end %}
{% can_delete service %}
{% include 'buttons/suppr.html' with href='preferences:del-service' id=service.id %}
{% acl_end %}
{% history_button service %}
</td>
</tr>
{% endfor %}

View file

@ -23,17 +23,19 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load acl %}
{% load logs_extra %}
<table class="table table-striped">
<thead>
<tr>
<th>Identifiant</th>
<th>Creds par default des switchs</th>
<th>Utilisé pour les switchs</th>
<th></th>
<th></th>
</tr>
</thead>
{% for switchmanagementcred in switchmanagementcred_list %}
{% load i18n %}
<table class="table table-striped">
<thead>
<tr>
<th>{% trans "Switch login" %}</th>
<th>{% trans "Default switch management credentials" %}</th>
<th>{% trans "Management credentials used by the switches" %}</th>
<th></th>
<th></th>
</tr>
</thead>
{% for switchmanagementcred in switchmanagementcred_list %}
<tr>
<td>{{ switchmanagementcred.management_id }}</td>
<td>{{ switchmanagementcred.default_switch }}</td>
@ -43,13 +45,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% include 'buttons/edit.html' with href='preferences:edit-switchmanagementcred' id=switchmanagementcred.id %}
{% acl_end %}
{% can_delete switchmanagementcred %}
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'preferences:del-switchmanagementcred' switchmanagementcred.pk %}">
<i class="fa fa-trash"></i>
</a>
{% include 'buttons/suppr.html' with href='preferences:del-switchmanagementcred' id=switchmanagementcred.id %}
{% acl_end %}
{% history_button switchmanagementcred %}
</td>
</tr>
{% endfor %}
</table>
{% endfor %}
</table>

View file

@ -1,4 +1,4 @@
{% extends "topologie/sidebar.html" %}
{% extends 'preferences/sidebar.html' %}
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
@ -24,15 +24,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load bootstrap3 %}
{% load i18n %}
{% block title %}Création et modification de machines{% endblock %}
{% block title %}{% trans "Deletion of preferences" %}{% endblock %}
{% block content %}
<form class="form" method="post">
{% csrf_token %}
<h4>Attention, voulez-vous vraiment supprimer cet objet {{ objet_name }} ( {{ objet }} ) ?</h4>
{% bootstrap_button "Confirmer" button_type="submit" icon="trash" %}
<h4>{% blocktrans %}Warning: are you sure you want to delete this {{ objet_name }} object ( {{ objet }} )?{% endblocktrans %}</h4>
{% trans "Confirm" as tr_confirm %}
{% bootstrap_button tr_confirm button_type="submit" icon="trash" %}
</form>
<br />
<br />

View file

@ -1,4 +1,4 @@
{% extends "preferences/sidebar.html" %}
{% extends 'preferences/sidebar.html' %}
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
@ -69,7 +69,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr>
<th>{% trans "General message displayed on the website" %}</th>
<td>{{ generaloptions.general_message }}</td>
<th>{% trans "Main site url" %}</th>
<th>{% trans "Main site URL" %}</th>
<td>{{ generaloptions.main_site_url }}</td>
</tr>
<tr>
@ -120,7 +120,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<th>{% trans "Self registration" %}</th>
<td>{{ useroptions.self_adhesion|tick }}</td>
<th>{% trans "Delete not yet active users after" %}</th>
<td>{{ useroptions.delete_notyetactive }} days</td>
<td>{% blocktrans with delete_notyetactive=useroptions.delete_notyetactive %}{{ delete_notyetactive }} days{% endblocktrans %}</td>
</tr>
<tr>
<th>{% trans "All users are active by default" %}</th>
@ -218,11 +218,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</tr>
</table>
<h4>Clef radius</h4>
<h4>{% trans "RADIUS keys" %}</h4>
{% can_create RadiusKey%}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-radiuskey' %}"><i class="fa fa-plus"></i> Ajouter une clef radius</a>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-radiuskey' %}"><i class="fa fa-plus"></i>{% trans " Add a RADIUS key" %}</a>
{% acl_end %}
{% include "preferences/aff_radiuskey.html" with radiuskey_list=radiuskey_list %}
{% include 'preferences/aff_radiuskey.html' with radiuskey_list=radiuskey_list %}
</div>
</div>
@ -230,7 +230,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div class="panel panel-default" id="switches">
<div class="panel-heading" data-toggle="collapse" href="#collapse_switches">
<h4 class="panel-title">
<a><i class="fa fa-server"></i> Configuration des Switches</a>
<a><i class="fa fa-server"></i>{% trans "Configuration of switches" %}</a>
</h4>
</div>
<div id="collapse_switches" class="panel-collapse panel-body collapse">
@ -243,64 +243,64 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<table class="table table-striped">
<tr>
<th>Web management, activé si provision automatique</th>
<th>{% trans "Web management, activated in case of automatic provision" %}</th>
<td>{{ topologieoptions.switchs_web_management }}</td>
<th>Rest management, activé si provision auto</th>
<th>{% trans "REST management, activated in case of automatic provision" %}</th>
<td>{{ topologieoptions.switchs_rest_management }}</td>
</tr>
</table>
<h5>{% if topologieoptions.provision_switchs_enabled %}<span class="label label-success">Provision de la config des switchs{% else %}<span class="label label-danger">Provision de la config des switchs{% endif%}</span></h5>
<h5>{% if topologieoptions.provision_switchs_enabled %}<span class="label label-success">{% trans "Provision of configuration for switches" %}{% else %}<span class="label label-danger">{% trans "Provision of configuration for switches" %}{% endif%}</span></h5>
<table class="table table-striped">
<tr>
<th>Switchs configurés automatiquement</th>
<td>{{ topologieoptions.provisioned_switchs|join:", " }} {% if topologieoptions.provisioned_switchs %}<span class="label label-success"> OK{% else %}<span class="label label-danger">Manquant{% endif %}</span></td>
<th>{% trans "Switches with automatic provision" %}</th>
<td>{{ topologieoptions.provisioned_switchs|join:", " }} {% if topologieoptions.provisioned_switchs %}<span class="label label-success">{% trans "OK" %}{% else %}<span class="label label-danger">{% trans "Missing" %}{% endif %}</span></td>
</tr>
<tr>
<th>Plage d'ip de management des switchs</th>
<td>{{ topologieoptions.switchs_ip_type }} {% if topologieoptions.switchs_ip_type %}<span class="label label-success"> OK{% else %}<span class="label label-danger">Manquant{% endif %}</span></td>
<th>{% trans "IP range for the management of switches" %}</th>
<td>{{ topologieoptions.switchs_ip_type }} {% if topologieoptions.switchs_ip_type %}<span class="label label-success">{% trans "OK" %}{% else %}<span class="label label-danger">{% trans "Missing" %}{% endif %}</span></td>
</tr>
<tr>
<th>Serveur des config des switchs</th>
<td>{{ topologieoptions.switchs_management_interface }} {% if topologieoptions.switchs_management_interface %} - {{ topologieoptions.switchs_management_interface_ip }} <span class="label label-success"> OK{% else %}<span class="label label-danger">Manquant{% endif %}</span></td>
<th>{% trans "Server for the configuration of switches" %}</th>
<td>{{ topologieoptions.switchs_management_interface }} {% if topologieoptions.switchs_management_interface %} - {{ topologieoptions.switchs_management_interface_ip }} <span class="label label-success">{% trans "OK" %}{% else %}<span class="label label-danger">{% trans "Missing" %}{% endif %}</span></td>
</tr>
<tr>
<th>Mode de provision des switchs</th>
<th>{% trans "Provision of configuration mode for switches" %}</th>
<td>{{ topologieoptions.switchs_provision }}</td>
</tr>
<tr>
<th>Mode TFTP</th>
<td><span class="label label-success"> OK</span></td>
<th>{% trans "TFTP mode" %}</th>
<td><span class="label label-success">{% trans "OK" %}</span></td>
</tr>
<tr>
<th>Mode SFTP</th>
<td>{% if topologieoptions.switchs_management_sftp_creds %}<span class="label label-success"> OK{% else %}<span class="label label-danger">Creds manquants{% endif %}</span></td>
<th>{% trans "SFTP mode" %}</th>
<td>{% if topologieoptions.switchs_management_sftp_creds %}<span class="label label-success">{% trans "OK" %}{% else %}<span class="label label-danger">{% trans "Missing credentials" %}{% endif %}</span></td>
</tr>
</table>
<h6>Creds de management des switchs</h6>
<h6>{% trans "Switch management credentials" %}</h6>
{% can_create SwitchManagementCred%}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-switchmanagementcred' %}"><i class="fa fa-plus"></i> Ajouter un id/mdp de management switch</a>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-switchmanagementcred' %}"><i class="fa fa-plus"></i>{% trans " Add switch management credentials" %}</a>
{% acl_end %}
<p>
</p>
{% if switchmanagementcred_list %}<span class="label label-success"> OK{% else %}<span class="label label-danger">Manquant{% endif %}</span>
{% include "preferences/aff_switchmanagementcred.html" with switchmanagementcred_list=switchmanagementcred_list %}
{% if switchmanagementcred_list %}<span class="label label-success">{% trans "OK" %}{% else %}<span class="label label-danger">{% trans "Missing" %}{% endif %}</span>
{% include 'preferences/aff_switchmanagementcred.html' with switchmanagementcred_list=switchmanagementcred_list %}
</div>
</div>
<div class="panel panel-default" id="radius">
<div class="panel-heading" data-toggle="collapse" href="#collapse_radius">
<h4 class="panel-title"><a><i class="fa fa-circle"></i> {% trans "Radius preferences" %}</h4></a>
<h4 class="panel-title"><a><i class="fa fa-circle"></i> {% trans "RADIUS preferences" %}</h4></a>
</div>
<div id="collapse_radius" class="panel-collapse panel-body collapse">
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'RadiusOption' %}">
<i class="fa fa-edit"></i>
{% trans "Edit" %}
</a>
{% include "preferences/aff_radiusoptions.html" %}
{% include 'preferences/aff_radiusoptions.html' %}
</div>
</div>
@ -350,7 +350,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div class="panel panel-default" id="mail">
<div class="panel-heading" data-toggle="collapse" href="#collapse_mail">
<h4 class="panel-title">
<a><i class="fa fa-comment"></i> Message pour les mails</a>
<a><i class="fa fa-comment"></i>{% trans "Message for emails" %}</a>
</h4>
</div>
<div id="collapse_mail" class="panel-collapse panel-body collapse">
@ -377,16 +377,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div class="panel panel-default" id="rappels">
<div class="panel-heading" data-toggle="collapse" href="#collapse_rappels">
<h4 class="panel-title">
<a><i class="fa fa-bell"></i> Options pour le mail de fin d'adhésion</a>
<a><i class="fa fa-bell"></i>{% trans "Options for the membership's end email" %}</a>
</h4>
</div>
<div id="collapse_rappels" class="panel-collapse panel-body collapse">
{% can_create preferences.Reminder%}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-reminder' %}"><i class="fa fa-plus"></i> Ajouter un rappel</a>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-reminder' %}"><i class="fa fa-plus"></i>{% trans " Add a reminder" %}</a>
<p></p>
{% acl_end %}
{% include "preferences/aff_reminder.html" with reminder_list=reminder_list %}
{% include 'preferences/aff_reminder.html' with reminder_list=reminder_list %}
</div>
</div>
@ -403,7 +403,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<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>
<p></p>
{% acl_end %}
{% include "preferences/aff_service.html" with service_list=service_list %}
{% include 'preferences/aff_service.html' with service_list=service_list %}
</div>
</div>
@ -417,18 +417,18 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div id="collapse_contact" class="panel-collapse panel-body collapse">
{% 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 address" %}</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 %}
<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>
<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>
<p></p>
{% include "preferences/aff_mailcontact.html" with mailcontact_list=mailcontact_list %}
{% include 'preferences/aff_mailcontact.html' with mailcontact_list=mailcontact_list %}
</div>
</div>
<div class="panel panel-default" id="social">
<div class="panel-heading" data-toggle="collapse" href="#collapse_social">
<h4 class="panel-title">
<a><i class="fa fa-facebook"></i><i class="fa fa-twitter"></i> Réseaux sociaux</a>
<a><i class="fa fa-facebook"></i><i class="fa fa-twitter"></i>{% trans "Social networks" %}</a>
</h4>
</div>
<div id="collapse_social" class="panel-collapse panel-body collapse">

View file

@ -1,4 +1,4 @@
{% extends "preferences/sidebar.html" %}
{% extends 'preferences/sidebar.html' %}
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en

View file

@ -1,4 +1,4 @@
{% extends "preferences/sidebar.html" %}
{% extends 'preferences/sidebar.html' %}
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en

View file

@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends 'base.html' %}
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en

View file

@ -111,7 +111,7 @@ def edit_options(request, section):
model = getattr(models, section, None)
form_instance = getattr(forms, 'Edit' + section + 'Form', None)
if not (model or form_instance):
messages.error(request, _("Unknown object"))
messages.error(request, _("Unknown object."))
return redirect(reverse('preferences:display-options'))
options_instance, _created = model.objects.get_or_create()
@ -186,7 +186,7 @@ def del_service(request, service_instance, **_kwargs):
"""Suppression d'un service de la page d'accueil"""
if request.method == "POST":
service_instance.delete()
messages.success(request, "Le service a été détruit")
messages.success(request, _("The service was deleted."))
return redirect(reverse('preferences:display-options'))
return form(
{'objet': service_instance, 'objet_name': 'service'},
@ -204,7 +204,7 @@ def add_reminder(request):
messages.success(request, _("The reminder was added."))
return redirect(reverse('preferences:display-options'))
return form(
{'preferenceform': reminder, 'action_name': _("Add a service")},
{'preferenceform': reminder, 'action_name': _("Add a reminder")},
'preferences/preferences.html',
request
)
@ -220,7 +220,7 @@ def edit_reminder(request, reminder_instance, **_kwargs):
)
if reminder.is_valid():
reminder.save()
messages.success(request, _("The service was edited."))
messages.success(request, _("The reminder was edited."))
return redirect(reverse('preferences:display-options'))
return form(
{'preferenceform': reminder, 'action_name': _("Edit")},
@ -236,7 +236,7 @@ def del_reminder(request, reminder_instance, **_kwargs):
"""Destruction d'un reminder"""
if request.method == "POST":
reminder_instance.delete()
messages.success(request, "Le reminder a été détruit")
messages.success(request, _("The reminder was deleted."))
return redirect(reverse('preferences:display-options'))
return form(
{'objet': reminder_instance, 'objet_name': 'reminder'},
@ -252,10 +252,10 @@ def add_radiuskey(request):
radiuskey = RadiusKeyForm(request.POST or None)
if radiuskey.is_valid():
radiuskey.save()
messages.success(request, "Cette clef a été ajouté")
messages.success(request, _("The RADIUS key was added."))
return redirect(reverse('preferences:display-options'))
return form(
{'preferenceform': radiuskey, 'action_name': 'Ajouter'},
{'preferenceform': radiuskey, 'action_name': _("Add a RADIUS key")},
'preferences/preferences.html',
request
)
@ -266,10 +266,10 @@ def edit_radiuskey(request, radiuskey_instance, **_kwargs):
radiuskey = RadiusKeyForm(request.POST or None, instance=radiuskey_instance)
if radiuskey.is_valid():
radiuskey.save()
messages.success(request, "Radiuskey modifié")
messages.success(request, _("The RADIUS key was edited."))
return redirect(reverse('preferences:display-options'))
return form(
{'preferenceform': radiuskey, 'action_name': 'Editer'},
{'preferenceform': radiuskey, 'action_name': _("Edit")},
'preferences/preferences.html',
request
)
@ -282,10 +282,10 @@ def del_radiuskey(request, radiuskey_instance, **_kwargs):
if request.method == "POST":
try:
radiuskey_instance.delete()
messages.success(request, "La radiuskey a été détruite")
messages.success(request, _("The RADIUS key was deleted."))
except ProtectedError:
messages.error(request, "Erreur la\
clef ne peut être supprimé, elle est affectée à des switchs")
messages.error(request, _("The RADIUS key is assigned to at least"
" one switch, you can't delete it."))
return redirect(reverse('preferences:display-options'))
return form(
{'objet': radiuskey_instance, 'objet_name': 'radiuskey'},
@ -301,10 +301,10 @@ def add_switchmanagementcred(request):
switchmanagementcred = SwitchManagementCredForm(request.POST or None)
if switchmanagementcred.is_valid():
switchmanagementcred.save()
messages.success(request, "Ces creds ont été ajoutés")
messages.success(request, _("The switch management credentials were added."))
return redirect(reverse('preferences:display-options'))
return form(
{'preferenceform': switchmanagementcred, 'action_name': 'Ajouter'},
{'preferenceform': switchmanagementcred, 'action_name': _("Add switch management credentials")},
'preferences/preferences.html',
request
)
@ -315,10 +315,10 @@ def edit_switchmanagementcred(request, switchmanagementcred_instance, **_kwargs)
switchmanagementcred = SwitchManagementCredForm(request.POST or None, instance=switchmanagementcred_instance)
if switchmanagementcred.is_valid():
switchmanagementcred.save()
messages.success(request, "Creds de managament modifié")
messages.success(request, _("The switch management credentials were edited."))
return redirect(reverse('preferences:display-options'))
return form(
{'preferenceform': switchmanagementcred, 'action_name': 'Editer'},
{'preferenceform': switchmanagementcred, 'action_name': _("Edit")},
'preferences/preferences.html',
request
)
@ -331,10 +331,11 @@ def del_switchmanagementcred(request, switchmanagementcred_instance, **_kwargs):
if request.method == "POST":
try:
switchmanagementcred_instance.delete()
messages.success(request, "Ces creds ont été détruits")
messages.success(request, _("The switch management credentials were deleted."))
except ProtectedError:
messages.error(request, "Erreur ces\
creds ne peuvent être supprimés, ils sont affectés à des switchs")
messages.error(request, _("The switch management credentials are"
" assigned to at least one switch, you"
" can't delete them."))
return redirect(reverse('preferences:display-options'))
return form(
{'objet': switchmanagementcred_instance, 'objet_name': 'switchmanagementcred'},