mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-05 01:16:27 +00:00
add translations for preferences/
This commit is contained in:
parent
62d09760b3
commit
77e62df3b8
15 changed files with 1113 additions and 452 deletions
|
@ -359,7 +359,7 @@ class DelMailContactForm(Form):
|
||||||
"""Delete contact email adress"""
|
"""Delete contact email adress"""
|
||||||
mailcontacts = forms.ModelMultipleChoiceField(
|
mailcontacts = forms.ModelMultipleChoiceField(
|
||||||
queryset=MailContact.objects.none(),
|
queryset=MailContact.objects.none(),
|
||||||
label="Enregistrements adresses actuels",
|
label=_("Current email addresses"),
|
||||||
widget=forms.CheckboxSelectMultiple
|
widget=forms.CheckboxSelectMultiple
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
208
preferences/migrations/0058_auto_20190108_1650.py
Normal file
208
preferences/migrations/0058_auto_20190108_1650.py
Normal 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),
|
||||||
|
),
|
||||||
|
]
|
|
@ -73,11 +73,11 @@ class OptionalUser(AclMixin, PreferencesModel):
|
||||||
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=_("Users can create a 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=_("Users can create a member"),
|
help_text=_("Users can create a member."),
|
||||||
)
|
)
|
||||||
|
|
||||||
shell_default = models.OneToOneField(
|
shell_default = models.OneToOneField(
|
||||||
|
@ -88,15 +88,15 @@ class OptionalUser(AclMixin, PreferencesModel):
|
||||||
)
|
)
|
||||||
self_change_shell = models.BooleanField(
|
self_change_shell = models.BooleanField(
|
||||||
default=False,
|
default=False,
|
||||||
help_text=_("Users can edit their shell")
|
help_text=_("Users can edit their shell.")
|
||||||
)
|
)
|
||||||
self_change_room = models.BooleanField(
|
self_change_room = models.BooleanField(
|
||||||
default=False,
|
default=False,
|
||||||
help_text=_("Users can edit their room")
|
help_text=_("Users can edit their room.")
|
||||||
)
|
)
|
||||||
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,
|
||||||
|
@ -106,20 +106,21 @@ class OptionalUser(AclMixin, PreferencesModel):
|
||||||
max_email_address = models.IntegerField(
|
max_email_address = models.IntegerField(
|
||||||
default=15,
|
default=15,
|
||||||
help_text=_("Maximum number of local email addresses for a standard"
|
help_text=_("Maximum number of local email addresses for a standard"
|
||||||
" user")
|
" user.")
|
||||||
)
|
)
|
||||||
delete_notyetactive = models.IntegerField(
|
delete_notyetactive = models.IntegerField(
|
||||||
default=15,
|
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(
|
self_adhesion = models.BooleanField(
|
||||||
default=False,
|
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(
|
all_users_active = models.BooleanField(
|
||||||
default=False,
|
default=False,
|
||||||
help_text=_("If True, all new created and connected users are active.\
|
help_text=_("If True, all new created and connected users are active."
|
||||||
If False, only when a valid registration has been paid")
|
" If False, only when a valid registration has been paid.")
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -206,40 +207,41 @@ class OptionalTopologie(AclMixin, PreferencesModel):
|
||||||
|
|
||||||
switchs_web_management = models.BooleanField(
|
switchs_web_management = models.BooleanField(
|
||||||
default=False,
|
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(
|
switchs_web_management_ssl = models.BooleanField(
|
||||||
default=False,
|
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(
|
switchs_rest_management = models.BooleanField(
|
||||||
default=False,
|
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(
|
switchs_ip_type = models.OneToOneField(
|
||||||
'machines.IpType',
|
'machines.IpType',
|
||||||
on_delete=models.PROTECT,
|
on_delete=models.PROTECT,
|
||||||
blank=True,
|
blank=True,
|
||||||
null=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(
|
switchs_provision = models.CharField(
|
||||||
max_length=32,
|
max_length=32,
|
||||||
choices=CHOICE_PROVISION,
|
choices=CHOICE_PROVISION,
|
||||||
default='tftp',
|
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(
|
sftp_login = models.CharField(
|
||||||
max_length=32,
|
max_length=32,
|
||||||
null=True,
|
null=True,
|
||||||
blank=True,
|
blank=True,
|
||||||
help_text="Login sftp des switchs"
|
help_text=_("SFTP login for switches")
|
||||||
)
|
)
|
||||||
sftp_pass = AESEncryptedField(
|
sftp_pass = AESEncryptedField(
|
||||||
max_length=63,
|
max_length=63,
|
||||||
null=True,
|
null=True,
|
||||||
blank=True,
|
blank=True,
|
||||||
help_text="Mot de passe sftp"
|
help_text=_("SFTP password")
|
||||||
)
|
)
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
|
@ -314,52 +316,56 @@ class RadiusKey(AclMixin, models.Model):
|
||||||
"""Class of a radius key"""
|
"""Class of a radius key"""
|
||||||
radius_key = AESEncryptedField(
|
radius_key = AESEncryptedField(
|
||||||
max_length=255,
|
max_length=255,
|
||||||
help_text="Clef radius"
|
help_text=_("RADIUS key")
|
||||||
)
|
)
|
||||||
comment = models.CharField(
|
comment = models.CharField(
|
||||||
max_length=255,
|
max_length=255,
|
||||||
null=True,
|
null=True,
|
||||||
blank=True,
|
blank=True,
|
||||||
help_text="Commentaire de cette clef"
|
help_text=_("Comment for this key")
|
||||||
)
|
)
|
||||||
default_switch = models.BooleanField(
|
default_switch = models.BooleanField(
|
||||||
default=True,
|
default=True,
|
||||||
unique=True,
|
unique=True,
|
||||||
help_text= "Clef par défaut des switchs"
|
help_text=_("Default key for switches")
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
permissions = (
|
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):
|
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 SwitchManagementCred(AclMixin, models.Model):
|
||||||
"""Class of a management creds of a switch, for rest management"""
|
"""Class of a management creds of a switch, for rest management"""
|
||||||
management_id = models.CharField(
|
management_id = models.CharField(
|
||||||
max_length=63,
|
max_length=63,
|
||||||
help_text="Login du switch"
|
help_text=_("Switch login")
|
||||||
)
|
)
|
||||||
management_pass = AESEncryptedField(
|
management_pass = AESEncryptedField(
|
||||||
max_length=63,
|
max_length=63,
|
||||||
help_text="Mot de passe"
|
help_text=_("Password")
|
||||||
)
|
)
|
||||||
default_switch = models.BooleanField(
|
default_switch = models.BooleanField(
|
||||||
default=True,
|
default=True,
|
||||||
unique=True,
|
unique=True,
|
||||||
help_text= "Creds par défaut des switchs"
|
help_text=_("Default credentials for switches")
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
permissions = (
|
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):
|
def __str__(self):
|
||||||
return "Identifiant " + str(self.management_id)
|
return _("Switch login ") + str(self.management_id)
|
||||||
|
|
||||||
|
|
||||||
class Reminder(AclMixin, models.Model):
|
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é
|
Days: liste des nombres de jours pour lesquells un mail est envoyé
|
||||||
optionalMessage: message additionel pour le mail
|
optionalMessage: message additionel pour le mail
|
||||||
"""
|
"""
|
||||||
PRETTY_NAME="Options pour le mail de fin d'adhésion"
|
|
||||||
|
|
||||||
days = models.IntegerField(
|
days = models.IntegerField(
|
||||||
default=7,
|
default=7,
|
||||||
unique=True,
|
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(
|
message = models.CharField(
|
||||||
max_length=255,
|
max_length=255,
|
||||||
default="",
|
default="",
|
||||||
null=True,
|
null=True,
|
||||||
blank=True,
|
blank=True,
|
||||||
help_text="Message affiché spécifiquement pour ce rappel"
|
help_text=_("Message displayed specifically for this reminder")
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
permissions = (
|
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):
|
def users_to_remind(self):
|
||||||
from re2o.utils import all_has_access
|
from re2o.utils import all_has_access
|
||||||
|
@ -472,8 +479,7 @@ class MailContact(AclMixin, models.Model):
|
||||||
commentary = models.CharField(
|
commentary = models.CharField(
|
||||||
blank = True,
|
blank = True,
|
||||||
null = True,
|
null = True,
|
||||||
help_text = _(
|
help_text = _("Description of the associated email address."),
|
||||||
"Description of the associated email address."),
|
|
||||||
max_length = 256
|
max_length = 256
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -564,8 +570,8 @@ 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"""
|
||||||
|
|
||||||
welcome_mail_fr = models.TextField(default="", help_text="Mail de bienvenue en français")
|
welcome_mail_fr = models.TextField(default="", help_text=_("Welcome email in French"))
|
||||||
welcome_mail_en = models.TextField(default="", help_text="Mail de bienvenue en anglais")
|
welcome_mail_en = models.TextField(default="", help_text=_("Welcome email in English"))
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
permissions = (
|
permissions = (
|
||||||
|
@ -577,7 +583,8 @@ class MailMessageOption(AclMixin, models.Model):
|
||||||
|
|
||||||
class RadiusOption(AclMixin, PreferencesModel):
|
class RadiusOption(AclMixin, PreferencesModel):
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _("radius policies")
|
verbose_name = _("RADIUS policy")
|
||||||
|
verbose_name_plural = _("RADIUS policies")
|
||||||
|
|
||||||
MACHINE = 'MACHINE'
|
MACHINE = 'MACHINE'
|
||||||
DEFINED = 'DEFINED'
|
DEFINED = 'DEFINED'
|
||||||
|
@ -588,8 +595,8 @@ class RadiusOption(AclMixin, PreferencesModel):
|
||||||
REJECT = 'REJECT'
|
REJECT = 'REJECT'
|
||||||
SET_VLAN = 'SET_VLAN'
|
SET_VLAN = 'SET_VLAN'
|
||||||
CHOICE_POLICY = (
|
CHOICE_POLICY = (
|
||||||
(REJECT, _('Reject the machine')),
|
(REJECT, _("Reject the machine")),
|
||||||
(SET_VLAN, _('Place the machine on the VLAN'))
|
(SET_VLAN, _("Place the machine on the VLAN"))
|
||||||
)
|
)
|
||||||
radius_general_policy = models.CharField(
|
radius_general_policy = models.CharField(
|
||||||
max_length=32,
|
max_length=32,
|
||||||
|
@ -608,16 +615,14 @@ class RadiusOption(AclMixin, PreferencesModel):
|
||||||
related_name='unknown_machine_vlan',
|
related_name='unknown_machine_vlan',
|
||||||
blank=True,
|
blank=True,
|
||||||
null=True,
|
null=True,
|
||||||
verbose_name=_('Unknown machine Vlan'),
|
verbose_name=_("Unknown machines VLAN"),
|
||||||
help_text=_(
|
help_text=_("VLAN for unknown machines if not rejected")
|
||||||
'Vlan for unknown machines if not rejected.'
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
unknown_port = models.CharField(
|
unknown_port = models.CharField(
|
||||||
max_length=32,
|
max_length=32,
|
||||||
choices=CHOICE_POLICY,
|
choices=CHOICE_POLICY,
|
||||||
default=REJECT,
|
default=REJECT,
|
||||||
verbose_name=_("Policy for unknown port"),
|
verbose_name=_("Policy for unknown ports"),
|
||||||
)
|
)
|
||||||
unknown_port_vlan = models.ForeignKey(
|
unknown_port_vlan = models.ForeignKey(
|
||||||
'machines.Vlan',
|
'machines.Vlan',
|
||||||
|
@ -625,20 +630,15 @@ class RadiusOption(AclMixin, PreferencesModel):
|
||||||
related_name='unknown_port_vlan',
|
related_name='unknown_port_vlan',
|
||||||
blank=True,
|
blank=True,
|
||||||
null=True,
|
null=True,
|
||||||
verbose_name=_('Unknown port Vlan'),
|
verbose_name=_("Unknown ports VLAN"),
|
||||||
help_text=_(
|
help_text=_("VLAN for unknown ports if not rejected")
|
||||||
'Vlan for unknown ports if not rejected.'
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
unknown_room = models.CharField(
|
unknown_room = models.CharField(
|
||||||
max_length=32,
|
max_length=32,
|
||||||
choices=CHOICE_POLICY,
|
choices=CHOICE_POLICY,
|
||||||
default=REJECT,
|
default=REJECT,
|
||||||
verbose_name=_(
|
verbose_name=_("Policy for machines connecting from unregistered rooms"
|
||||||
"Policy for machine connecting from "
|
" (relevant on ports with STRICT RADIUS mode)"),
|
||||||
"unregistered room (relevant on ports with STRICT "
|
|
||||||
"radius mode)"
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
unknown_room_vlan = models.ForeignKey(
|
unknown_room_vlan = models.ForeignKey(
|
||||||
'machines.Vlan',
|
'machines.Vlan',
|
||||||
|
@ -646,16 +646,14 @@ class RadiusOption(AclMixin, PreferencesModel):
|
||||||
on_delete=models.PROTECT,
|
on_delete=models.PROTECT,
|
||||||
blank=True,
|
blank=True,
|
||||||
null=True,
|
null=True,
|
||||||
verbose_name=_('Unknown room Vlan'),
|
verbose_name=_("Unknown rooms VLAN"),
|
||||||
help_text=_(
|
help_text=_("VLAN for unknown rooms if not rejected")
|
||||||
'Vlan for unknown room if not rejected.'
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
non_member = models.CharField(
|
non_member = models.CharField(
|
||||||
max_length=32,
|
max_length=32,
|
||||||
choices=CHOICE_POLICY,
|
choices=CHOICE_POLICY,
|
||||||
default=REJECT,
|
default=REJECT,
|
||||||
verbose_name=_("Policy non member users."),
|
verbose_name=_("Policy for non members"),
|
||||||
)
|
)
|
||||||
non_member_vlan = models.ForeignKey(
|
non_member_vlan = models.ForeignKey(
|
||||||
'machines.Vlan',
|
'machines.Vlan',
|
||||||
|
@ -663,16 +661,14 @@ class RadiusOption(AclMixin, PreferencesModel):
|
||||||
on_delete=models.PROTECT,
|
on_delete=models.PROTECT,
|
||||||
blank=True,
|
blank=True,
|
||||||
null=True,
|
null=True,
|
||||||
verbose_name=_('Non member Vlan'),
|
verbose_name=_("Non members VLAN"),
|
||||||
help_text=_(
|
help_text=_("VLAN for non members if not rejected")
|
||||||
'Vlan for non members if not rejected.'
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
banned = models.CharField(
|
banned = models.CharField(
|
||||||
max_length=32,
|
max_length=32,
|
||||||
choices=CHOICE_POLICY,
|
choices=CHOICE_POLICY,
|
||||||
default=REJECT,
|
default=REJECT,
|
||||||
verbose_name=_("Policy for banned users."),
|
verbose_name=_("Policy for banned users"),
|
||||||
)
|
)
|
||||||
banned_vlan = models.ForeignKey(
|
banned_vlan = models.ForeignKey(
|
||||||
'machines.Vlan',
|
'machines.Vlan',
|
||||||
|
@ -680,10 +676,8 @@ class RadiusOption(AclMixin, PreferencesModel):
|
||||||
on_delete=models.PROTECT,
|
on_delete=models.PROTECT,
|
||||||
blank=True,
|
blank=True,
|
||||||
null=True,
|
null=True,
|
||||||
verbose_name=_('Banned Vlan'),
|
verbose_name=_("Banned users VLAN"),
|
||||||
help_text=_(
|
help_text=_("VLAN for banned users if not rejected")
|
||||||
'Vlan for banned if not rejected.'
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
vlan_decision_ok = models.OneToOneField(
|
vlan_decision_ok = models.OneToOneField(
|
||||||
'machines.Vlan',
|
'machines.Vlan',
|
||||||
|
|
|
@ -23,13 +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>Id Clef</th>
|
<th>{% trans "RADIUS key ID" %}</th>
|
||||||
<th>Commentaire</th>
|
<th>{% trans "Comment" %}</th>
|
||||||
<th>Clef par default des switchs</th>
|
<th>{% trans "Default RADIUS key for switches" %}</th>
|
||||||
<th>Clef utilisée par les switchs</th>
|
<th>{% trans "RADIUS key used by the swithes" %}</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -45,9 +47,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% include 'buttons/edit.html' with href='preferences:edit-radiuskey' id=radiuskey.id %}
|
{% include 'buttons/edit.html' with href='preferences:edit-radiuskey' id=radiuskey.id %}
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
{% can_delete radiuskey %}
|
{% can_delete radiuskey %}
|
||||||
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'preferences:del-radiuskey' radiuskey.pk %}">
|
{% include 'buttons/suppr.html' with href='preferences:del-radiuskey' id=radiuskey.id %}
|
||||||
<i class="fa fa-trash"></i>
|
|
||||||
</a>
|
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
{% history_button radiuskey %}
|
{% history_button radiuskey %}
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -31,7 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{% trans "VLAN for machines accepted by RADIUS" %}</th>
|
<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>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<hr/>
|
<hr/>
|
||||||
|
@ -39,7 +39,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{% trans "Situation" %}</th>
|
<th>{% trans "Situation" %}</th>
|
||||||
<th>{% trans "Behavior" %}</th>
|
<th>{% trans "Behaviour" %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -48,7 +48,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% if radiusoptions.unknown_machine == 'REJECT' %}
|
{% if radiusoptions.unknown_machine == 'REJECT' %}
|
||||||
<span class="label label-danger">{% trans "Reject" %}</span>
|
<span class="label label-danger">{% trans "Reject" %}</span>
|
||||||
{% else %}
|
{% 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 %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -58,7 +58,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% if radiusoptions.unknown_port == 'REJECT' %}
|
{% if radiusoptions.unknown_port == 'REJECT' %}
|
||||||
<span class="label label-danger">{% trans "Reject" %}</span>
|
<span class="label label-danger">{% trans "Reject" %}</span>
|
||||||
{% else %}
|
{% 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 %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -68,7 +68,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% if radiusoptions.unknown_room == 'REJECT' %}
|
{% if radiusoptions.unknown_room == 'REJECT' %}
|
||||||
<span class="label label-danger">{% trans "Reject" %}</span>
|
<span class="label label-danger">{% trans "Reject" %}</span>
|
||||||
{% else %}
|
{% 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 %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -78,7 +78,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% if radiusoptions.non_member == 'REJECT' %}
|
{% if radiusoptions.non_member == 'REJECT' %}
|
||||||
<span class="label label-danger">{% trans "Reject" %}</span>
|
<span class="label label-danger">{% trans "Reject" %}</span>
|
||||||
{% else %}
|
{% 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 %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -88,7 +88,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% if radiusoptions.unknown_port == 'REJECT' %}
|
{% if radiusoptions.unknown_port == 'REJECT' %}
|
||||||
<span class="label label-danger">{% trans "Reject" %}</span>
|
<span class="label label-danger">{% trans "Reject" %}</span>
|
||||||
{% else %}
|
{% 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 %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -23,11 +23,13 @@ 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>Nombre de jours avant le rappel</th>
|
<th>{% trans "Number of days before the reminder" %}</th>
|
||||||
<th>Message custom pour ce rappel</th>
|
<th>{% trans "Message for this reminder" %}</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -39,11 +41,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
{% can_edit reminder %}
|
{% can_edit reminder %}
|
||||||
{% include 'buttons/edit.html' with href='preferences:edit-reminder' id=reminder.id %}
|
{% 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 %}
|
||||||
|
{% can_delete reminder %}
|
||||||
|
{% include 'buttons/suppr.html' with href='preferences:del-reminder' id=reminder.id %}
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
{% history_button reminder %}
|
{% history_button reminder %}
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -44,11 +44,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
{% can_edit service%}
|
{% can_edit service%}
|
||||||
{% include 'buttons/edit.html' with href='preferences:edit-service' id=service.id %}
|
{% 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 %}
|
||||||
|
{% can_delete service %}
|
||||||
|
{% include 'buttons/suppr.html' with href='preferences:del-service' id=service.id %}
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
{% history_button service %}
|
{% history_button service %}
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -23,12 +23,14 @@ 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>Identifiant</th>
|
<th>{% trans "Switch login" %}</th>
|
||||||
<th>Creds par default des switchs</th>
|
<th>{% trans "Default switch management credentials" %}</th>
|
||||||
<th>Utilisé pour les switchs</th>
|
<th>{% trans "Management credentials used by the switches" %}</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -43,9 +45,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% include 'buttons/edit.html' with href='preferences:edit-switchmanagementcred' id=switchmanagementcred.id %}
|
{% include 'buttons/edit.html' with href='preferences:edit-switchmanagementcred' id=switchmanagementcred.id %}
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
{% can_delete switchmanagementcred %}
|
{% can_delete switchmanagementcred %}
|
||||||
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'preferences:del-switchmanagementcred' switchmanagementcred.pk %}">
|
{% include 'buttons/suppr.html' with href='preferences:del-switchmanagementcred' id=switchmanagementcred.id %}
|
||||||
<i class="fa fa-trash"></i>
|
|
||||||
</a>
|
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
{% history_button switchmanagementcred %}
|
{% history_button switchmanagementcred %}
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% extends "topologie/sidebar.html" %}
|
{% extends 'preferences/sidebar.html' %}
|
||||||
{% comment %}
|
{% comment %}
|
||||||
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
|
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
|
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 %}
|
{% endcomment %}
|
||||||
|
|
||||||
{% load bootstrap3 %}
|
{% load bootstrap3 %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
{% block title %}Création et modification de machines{% endblock %}
|
{% block title %}{% trans "Deletion of preferences" %}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<form class="form" method="post">
|
<form class="form" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<h4>Attention, voulez-vous vraiment supprimer cet objet {{ objet_name }} ( {{ objet }} ) ?</h4>
|
<h4>{% blocktrans %}Warning: are you sure you want to delete this {{ objet_name }} object ( {{ objet }} )?{% endblocktrans %}</h4>
|
||||||
{% bootstrap_button "Confirmer" button_type="submit" icon="trash" %}
|
{% trans "Confirm" as tr_confirm %}
|
||||||
|
{% bootstrap_button tr_confirm button_type="submit" icon="trash" %}
|
||||||
</form>
|
</form>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% extends "preferences/sidebar.html" %}
|
{% extends 'preferences/sidebar.html' %}
|
||||||
{% comment %}
|
{% comment %}
|
||||||
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
|
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
|
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>
|
<tr>
|
||||||
<th>{% trans "General message displayed on the website" %}</th>
|
<th>{% trans "General message displayed on the website" %}</th>
|
||||||
<td>{{ generaloptions.general_message }}</td>
|
<td>{{ generaloptions.general_message }}</td>
|
||||||
<th>{% trans "Main site url" %}</th>
|
<th>{% trans "Main site URL" %}</th>
|
||||||
<td>{{ generaloptions.main_site_url }}</td>
|
<td>{{ generaloptions.main_site_url }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -120,7 +120,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<th>{% trans "Self registration" %}</th>
|
<th>{% trans "Self registration" %}</th>
|
||||||
<td>{{ useroptions.self_adhesion|tick }}</td>
|
<td>{{ useroptions.self_adhesion|tick }}</td>
|
||||||
<th>{% trans "Delete not yet active users after" %}</th>
|
<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>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{% trans "All users are active by default" %}</th>
|
<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>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h4>Clef radius</h4>
|
<h4>{% trans "RADIUS keys" %}</h4>
|
||||||
{% can_create RadiusKey%}
|
{% 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 %}
|
{% acl_end %}
|
||||||
{% include "preferences/aff_radiuskey.html" with radiuskey_list=radiuskey_list %}
|
{% include 'preferences/aff_radiuskey.html' with radiuskey_list=radiuskey_list %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</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 panel-default" id="switches">
|
||||||
<div class="panel-heading" data-toggle="collapse" href="#collapse_switches">
|
<div class="panel-heading" data-toggle="collapse" href="#collapse_switches">
|
||||||
<h4 class="panel-title">
|
<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>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div id="collapse_switches" class="panel-collapse panel-body collapse">
|
<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">
|
<table class="table table-striped">
|
||||||
<tr>
|
<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>
|
<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>
|
<td>{{ topologieoptions.switchs_rest_management }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</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">
|
<table class="table table-striped">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Switchs configurés automatiquement</th>
|
<th>{% trans "Switches with automatic provision" %}</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>
|
<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>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Plage d'ip de management des switchs</th>
|
<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"> OK{% else %}<span class="label label-danger">Manquant{% endif %}</span></td>
|
<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>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Serveur des config des switchs</th>
|
<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"> OK{% else %}<span class="label label-danger">Manquant{% endif %}</span></td>
|
<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>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Mode de provision des switchs</th>
|
<th>{% trans "Provision of configuration mode for switches" %}</th>
|
||||||
<td>{{ topologieoptions.switchs_provision }}</td>
|
<td>{{ topologieoptions.switchs_provision }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Mode TFTP</th>
|
<th>{% trans "TFTP mode" %}</th>
|
||||||
<td><span class="label label-success"> OK</span></td>
|
<td><span class="label label-success">{% trans "OK" %}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Mode SFTP</th>
|
<th>{% trans "SFTP mode" %}</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>
|
<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>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h6>Creds de management des switchs</h6>
|
<h6>{% trans "Switch management credentials" %}</h6>
|
||||||
{% can_create SwitchManagementCred%}
|
{% 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 %}
|
{% acl_end %}
|
||||||
<p>
|
<p>
|
||||||
</p>
|
</p>
|
||||||
{% if switchmanagementcred_list %}<span class="label label-success"> OK{% else %}<span class="label label-danger">Manquant{% endif %}</span>
|
{% 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 %}
|
{% include 'preferences/aff_switchmanagementcred.html' with switchmanagementcred_list=switchmanagementcred_list %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="panel panel-default" id="radius">
|
<div class="panel panel-default" id="radius">
|
||||||
<div class="panel-heading" data-toggle="collapse" href="#collapse_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>
|
||||||
<div id="collapse_radius" class="panel-collapse panel-body collapse">
|
<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' %}">
|
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'RadiusOption' %}">
|
||||||
<i class="fa fa-edit"></i>
|
<i class="fa fa-edit"></i>
|
||||||
{% trans "Edit" %}
|
{% trans "Edit" %}
|
||||||
</a>
|
</a>
|
||||||
{% include "preferences/aff_radiusoptions.html" %}
|
{% include 'preferences/aff_radiusoptions.html' %}
|
||||||
</div>
|
</div>
|
||||||
</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 panel-default" id="mail">
|
||||||
<div class="panel-heading" data-toggle="collapse" href="#collapse_mail">
|
<div class="panel-heading" data-toggle="collapse" href="#collapse_mail">
|
||||||
<h4 class="panel-title">
|
<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>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div id="collapse_mail" class="panel-collapse panel-body collapse">
|
<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 panel-default" id="rappels">
|
||||||
<div class="panel-heading" data-toggle="collapse" href="#collapse_rappels">
|
<div class="panel-heading" data-toggle="collapse" href="#collapse_rappels">
|
||||||
<h4 class="panel-title">
|
<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>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div id="collapse_rappels" class="panel-collapse panel-body collapse">
|
<div id="collapse_rappels" class="panel-collapse panel-body collapse">
|
||||||
{% can_create preferences.Reminder%}
|
{% 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>
|
<p></p>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
{% include "preferences/aff_reminder.html" with reminder_list=reminder_list %}
|
{% include 'preferences/aff_reminder.html' with reminder_list=reminder_list %}
|
||||||
</div>
|
</div>
|
||||||
</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>
|
<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>
|
<p></p>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
{% include "preferences/aff_service.html" with service_list=service_list %}
|
{% include 'preferences/aff_service.html' with service_list=service_list %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -421,14 +421,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% 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 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>
|
<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>
|
</div>
|
||||||
|
|
||||||
<div class="panel panel-default" id="social">
|
<div class="panel panel-default" id="social">
|
||||||
<div class="panel-heading" data-toggle="collapse" href="#collapse_social">
|
<div class="panel-heading" data-toggle="collapse" href="#collapse_social">
|
||||||
<h4 class="panel-title">
|
<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>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div id="collapse_social" class="panel-collapse panel-body collapse">
|
<div id="collapse_social" class="panel-collapse panel-body collapse">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% extends "preferences/sidebar.html" %}
|
{% extends 'preferences/sidebar.html' %}
|
||||||
{% comment %}
|
{% comment %}
|
||||||
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
|
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
|
se veut agnostique au réseau considéré, de manière à être installable en
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% extends "preferences/sidebar.html" %}
|
{% extends 'preferences/sidebar.html' %}
|
||||||
{% comment %}
|
{% comment %}
|
||||||
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
|
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
|
se veut agnostique au réseau considéré, de manière à être installable en
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% extends "base.html" %}
|
{% extends 'base.html' %}
|
||||||
{% comment %}
|
{% comment %}
|
||||||
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
|
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
|
se veut agnostique au réseau considéré, de manière à être installable en
|
||||||
|
|
|
@ -111,7 +111,7 @@ 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, _("Unknown object"))
|
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()
|
||||||
|
@ -186,7 +186,7 @@ def del_service(request, service_instance, **_kwargs):
|
||||||
"""Suppression d'un service de la page d'accueil"""
|
"""Suppression d'un service de la page d'accueil"""
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
service_instance.delete()
|
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 redirect(reverse('preferences:display-options'))
|
||||||
return form(
|
return form(
|
||||||
{'objet': service_instance, 'objet_name': 'service'},
|
{'objet': service_instance, 'objet_name': 'service'},
|
||||||
|
@ -204,7 +204,7 @@ def add_reminder(request):
|
||||||
messages.success(request, _("The reminder was added."))
|
messages.success(request, _("The reminder was added."))
|
||||||
return redirect(reverse('preferences:display-options'))
|
return redirect(reverse('preferences:display-options'))
|
||||||
return form(
|
return form(
|
||||||
{'preferenceform': reminder, 'action_name': _("Add a service")},
|
{'preferenceform': reminder, 'action_name': _("Add a reminder")},
|
||||||
'preferences/preferences.html',
|
'preferences/preferences.html',
|
||||||
request
|
request
|
||||||
)
|
)
|
||||||
|
@ -220,7 +220,7 @@ def edit_reminder(request, reminder_instance, **_kwargs):
|
||||||
)
|
)
|
||||||
if reminder.is_valid():
|
if reminder.is_valid():
|
||||||
reminder.save()
|
reminder.save()
|
||||||
messages.success(request, _("The service was edited."))
|
messages.success(request, _("The reminder was edited."))
|
||||||
return redirect(reverse('preferences:display-options'))
|
return redirect(reverse('preferences:display-options'))
|
||||||
return form(
|
return form(
|
||||||
{'preferenceform': reminder, 'action_name': _("Edit")},
|
{'preferenceform': reminder, 'action_name': _("Edit")},
|
||||||
|
@ -236,7 +236,7 @@ def del_reminder(request, reminder_instance, **_kwargs):
|
||||||
"""Destruction d'un reminder"""
|
"""Destruction d'un reminder"""
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
reminder_instance.delete()
|
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 redirect(reverse('preferences:display-options'))
|
||||||
return form(
|
return form(
|
||||||
{'objet': reminder_instance, 'objet_name': 'reminder'},
|
{'objet': reminder_instance, 'objet_name': 'reminder'},
|
||||||
|
@ -252,10 +252,10 @@ def add_radiuskey(request):
|
||||||
radiuskey = RadiusKeyForm(request.POST or None)
|
radiuskey = RadiusKeyForm(request.POST or None)
|
||||||
if radiuskey.is_valid():
|
if radiuskey.is_valid():
|
||||||
radiuskey.save()
|
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 redirect(reverse('preferences:display-options'))
|
||||||
return form(
|
return form(
|
||||||
{'preferenceform': radiuskey, 'action_name': 'Ajouter'},
|
{'preferenceform': radiuskey, 'action_name': _("Add a RADIUS key")},
|
||||||
'preferences/preferences.html',
|
'preferences/preferences.html',
|
||||||
request
|
request
|
||||||
)
|
)
|
||||||
|
@ -266,10 +266,10 @@ def edit_radiuskey(request, radiuskey_instance, **_kwargs):
|
||||||
radiuskey = RadiusKeyForm(request.POST or None, instance=radiuskey_instance)
|
radiuskey = RadiusKeyForm(request.POST or None, instance=radiuskey_instance)
|
||||||
if radiuskey.is_valid():
|
if radiuskey.is_valid():
|
||||||
radiuskey.save()
|
radiuskey.save()
|
||||||
messages.success(request, "Radiuskey modifié")
|
messages.success(request, _("The RADIUS key was edited."))
|
||||||
return redirect(reverse('preferences:display-options'))
|
return redirect(reverse('preferences:display-options'))
|
||||||
return form(
|
return form(
|
||||||
{'preferenceform': radiuskey, 'action_name': 'Editer'},
|
{'preferenceform': radiuskey, 'action_name': _("Edit")},
|
||||||
'preferences/preferences.html',
|
'preferences/preferences.html',
|
||||||
request
|
request
|
||||||
)
|
)
|
||||||
|
@ -282,10 +282,10 @@ def del_radiuskey(request, radiuskey_instance, **_kwargs):
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
try:
|
try:
|
||||||
radiuskey_instance.delete()
|
radiuskey_instance.delete()
|
||||||
messages.success(request, "La radiuskey a été détruite")
|
messages.success(request, _("The RADIUS key was deleted."))
|
||||||
except ProtectedError:
|
except ProtectedError:
|
||||||
messages.error(request, "Erreur la\
|
messages.error(request, _("The RADIUS key is assigned to at least"
|
||||||
clef ne peut être supprimé, elle est affectée à des switchs")
|
" one switch, you can't delete it."))
|
||||||
return redirect(reverse('preferences:display-options'))
|
return redirect(reverse('preferences:display-options'))
|
||||||
return form(
|
return form(
|
||||||
{'objet': radiuskey_instance, 'objet_name': 'radiuskey'},
|
{'objet': radiuskey_instance, 'objet_name': 'radiuskey'},
|
||||||
|
@ -301,10 +301,10 @@ def add_switchmanagementcred(request):
|
||||||
switchmanagementcred = SwitchManagementCredForm(request.POST or None)
|
switchmanagementcred = SwitchManagementCredForm(request.POST or None)
|
||||||
if switchmanagementcred.is_valid():
|
if switchmanagementcred.is_valid():
|
||||||
switchmanagementcred.save()
|
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 redirect(reverse('preferences:display-options'))
|
||||||
return form(
|
return form(
|
||||||
{'preferenceform': switchmanagementcred, 'action_name': 'Ajouter'},
|
{'preferenceform': switchmanagementcred, 'action_name': _("Add switch management credentials")},
|
||||||
'preferences/preferences.html',
|
'preferences/preferences.html',
|
||||||
request
|
request
|
||||||
)
|
)
|
||||||
|
@ -315,10 +315,10 @@ def edit_switchmanagementcred(request, switchmanagementcred_instance, **_kwargs)
|
||||||
switchmanagementcred = SwitchManagementCredForm(request.POST or None, instance=switchmanagementcred_instance)
|
switchmanagementcred = SwitchManagementCredForm(request.POST or None, instance=switchmanagementcred_instance)
|
||||||
if switchmanagementcred.is_valid():
|
if switchmanagementcred.is_valid():
|
||||||
switchmanagementcred.save()
|
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 redirect(reverse('preferences:display-options'))
|
||||||
return form(
|
return form(
|
||||||
{'preferenceform': switchmanagementcred, 'action_name': 'Editer'},
|
{'preferenceform': switchmanagementcred, 'action_name': _("Edit")},
|
||||||
'preferences/preferences.html',
|
'preferences/preferences.html',
|
||||||
request
|
request
|
||||||
)
|
)
|
||||||
|
@ -331,10 +331,11 @@ def del_switchmanagementcred(request, switchmanagementcred_instance, **_kwargs):
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
try:
|
try:
|
||||||
switchmanagementcred_instance.delete()
|
switchmanagementcred_instance.delete()
|
||||||
messages.success(request, "Ces creds ont été détruits")
|
messages.success(request, _("The switch management credentials were deleted."))
|
||||||
except ProtectedError:
|
except ProtectedError:
|
||||||
messages.error(request, "Erreur ces\
|
messages.error(request, _("The switch management credentials are"
|
||||||
creds ne peuvent être supprimés, ils sont affectés à des switchs")
|
" assigned to at least one switch, you"
|
||||||
|
" can't delete them."))
|
||||||
return redirect(reverse('preferences:display-options'))
|
return redirect(reverse('preferences:display-options'))
|
||||||
return form(
|
return form(
|
||||||
{'objet': switchmanagementcred_instance, 'objet_name': 'switchmanagementcred'},
|
{'objet': switchmanagementcred_instance, 'objet_name': 'switchmanagementcred'},
|
||||||
|
|
Loading…
Reference in a new issue