mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-09-12 01:03:09 +00:00
Mark strings for translation in users
This commit is contained in:
parent
207c8ba206
commit
679e81ac7d
13 changed files with 96 additions and 97 deletions
|
@ -41,6 +41,6 @@ def can_view(user):
|
||||||
can = user.has_module_perms("users")
|
can = user.has_module_perms("users")
|
||||||
return (
|
return (
|
||||||
can,
|
can,
|
||||||
None if can else _("You don't have the right to view this" " application."),
|
None if can else _("You don't have the right to view this application."),
|
||||||
("users",),
|
("users",),
|
||||||
)
|
)
|
||||||
|
|
|
@ -150,7 +150,7 @@ class UserCreationForm(FormRevMixin, forms.ModelForm):
|
||||||
return self.cleaned_data.get("email").lower()
|
return self.cleaned_data.get("email").lower()
|
||||||
else:
|
else:
|
||||||
raise forms.ValidationError(
|
raise forms.ValidationError(
|
||||||
_("You can't use an internal address" " as your external address.")
|
_("You can't use an internal address as your external address.")
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -293,7 +293,7 @@ class MassArchiveForm(forms.Form):
|
||||||
date = forms.DateTimeField(help_text="%d/%m/%y")
|
date = forms.DateTimeField(help_text="%d/%m/%y")
|
||||||
full_archive = forms.BooleanField(
|
full_archive = forms.BooleanField(
|
||||||
label=_(
|
label=_(
|
||||||
"Make a full archive operation ? (WARNING : CRITICAL OPERATION IF TRUE)"
|
"Fully archive users? WARNING: CRITICAL OPERATION IF TRUE"
|
||||||
),
|
),
|
||||||
initial=False,
|
initial=False,
|
||||||
required=False,
|
required=False,
|
||||||
|
@ -384,15 +384,14 @@ class AdherentCreationForm(AdherentForm):
|
||||||
|
|
||||||
# Champ permettant d'éviter au maxium les doublons d'utilisateurs
|
# Champ permettant d'éviter au maxium les doublons d'utilisateurs
|
||||||
former_user_check_info = _(
|
former_user_check_info = _(
|
||||||
"If you already have an account, please use it. "
|
"If you already have an account, please use it. If your lost access to"
|
||||||
+ "If your lost access to it, please consider "
|
" it, please consider using the forgotten password button on the"
|
||||||
+ "using the forgotten password button on the "
|
" login page or contacting support."
|
||||||
+ "login page or contacting support."
|
|
||||||
)
|
)
|
||||||
former_user_check = forms.BooleanField(
|
former_user_check = forms.BooleanField(
|
||||||
required=True, help_text=former_user_check_info
|
required=True, help_text=former_user_check_info
|
||||||
)
|
)
|
||||||
former_user_check.label = _("I certify that I have not had an account before")
|
former_user_check.label = _("I certify that I have not had an account before.")
|
||||||
|
|
||||||
# Checkbox for GTU
|
# Checkbox for GTU
|
||||||
gtu_check = forms.BooleanField(required=True)
|
gtu_check = forms.BooleanField(required=True)
|
||||||
|
@ -657,7 +656,7 @@ class NewListRightForm(ListRightForm):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(NewListRightForm, self).__init__(*args, **kwargs)
|
super(NewListRightForm, self).__init__(*args, **kwargs)
|
||||||
self.fields["gid"].label = _(
|
self.fields["gid"].label = _(
|
||||||
"GID. Warning: this field must not be" " edited after creation."
|
"GID. Warning: this field must not be edited after creation."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -734,7 +733,7 @@ class EMailAddressForm(FormRevMixin, ModelForm):
|
||||||
prefix = kwargs.pop("prefix", self.Meta.model.__name__)
|
prefix = kwargs.pop("prefix", self.Meta.model.__name__)
|
||||||
super(EMailAddressForm, self).__init__(*args, prefix=prefix, **kwargs)
|
super(EMailAddressForm, self).__init__(*args, prefix=prefix, **kwargs)
|
||||||
self.fields["local_part"].label = _("Local part of the email address")
|
self.fields["local_part"].label = _("Local part of the email address")
|
||||||
self.fields["local_part"].help_text = _("Can't contain @")
|
self.fields["local_part"].help_text = _("Can't contain @.")
|
||||||
|
|
||||||
def clean_local_part(self):
|
def clean_local_part(self):
|
||||||
return self.cleaned_data.get("local_part").lower()
|
return self.cleaned_data.get("local_part").lower()
|
||||||
|
|
|
@ -102,7 +102,7 @@ def linux_user_validator(login):
|
||||||
pas les contraintes unix (maj, min, chiffres ou tiret)"""
|
pas les contraintes unix (maj, min, chiffres ou tiret)"""
|
||||||
if not linux_user_check(login):
|
if not linux_user_check(login):
|
||||||
raise forms.ValidationError(
|
raise forms.ValidationError(
|
||||||
_("The username '%(label)s' contains forbidden characters."),
|
_("The username \"%(label)s\" contains forbidden characters."),
|
||||||
params={"label": login},
|
params={"label": login},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ class User(
|
||||||
(1, _("Disabled")),
|
(1, _("Disabled")),
|
||||||
(2, _("Archived")),
|
(2, _("Archived")),
|
||||||
(3, _("Not yet active")),
|
(3, _("Not yet active")),
|
||||||
(4, _("Full Archived")),
|
(4, _("Fully archived")),
|
||||||
)
|
)
|
||||||
|
|
||||||
surname = models.CharField(max_length=255)
|
surname = models.CharField(max_length=255)
|
||||||
|
@ -213,7 +213,7 @@ class User(
|
||||||
"ListShell", on_delete=models.PROTECT, null=True, blank=True
|
"ListShell", on_delete=models.PROTECT, null=True, blank=True
|
||||||
)
|
)
|
||||||
comment = models.CharField(
|
comment = models.CharField(
|
||||||
help_text=_("Comment, school year"), max_length=255, blank=True
|
help_text=_("Comment, school year."), max_length=255, blank=True
|
||||||
)
|
)
|
||||||
pwd_ntlm = models.CharField(max_length=255)
|
pwd_ntlm = models.CharField(max_length=255)
|
||||||
state = models.IntegerField(choices=STATES, default=STATE_NOT_YET_ACTIVE)
|
state = models.IntegerField(choices=STATES, default=STATE_NOT_YET_ACTIVE)
|
||||||
|
@ -222,7 +222,7 @@ class User(
|
||||||
uid_number = models.PositiveIntegerField(default=get_fresh_user_uid, unique=True)
|
uid_number = models.PositiveIntegerField(default=get_fresh_user_uid, unique=True)
|
||||||
rezo_rez_uid = models.PositiveIntegerField(unique=True, blank=True, null=True)
|
rezo_rez_uid = models.PositiveIntegerField(unique=True, blank=True, null=True)
|
||||||
shortcuts_enabled = models.BooleanField(
|
shortcuts_enabled = models.BooleanField(
|
||||||
verbose_name=_("Enable shortcuts on Re2o website"), default=True
|
verbose_name=_("enable shortcuts on Re2o website"), default=True
|
||||||
)
|
)
|
||||||
|
|
||||||
USERNAME_FIELD = "pseudo"
|
USERNAME_FIELD = "pseudo"
|
||||||
|
@ -238,9 +238,9 @@ class User(
|
||||||
("change_user_shell", _("Can edit the shell of a user")),
|
("change_user_shell", _("Can edit the shell of a user")),
|
||||||
(
|
(
|
||||||
"change_user_groups",
|
"change_user_groups",
|
||||||
_("Can edit the groups of rights of a user (critical" " permission)"),
|
_("Can edit the groups of rights of a user (critical permission)"),
|
||||||
),
|
),
|
||||||
("change_all_users", _("Can edit all users, including those with rights.")),
|
("change_all_users", _("Can edit all users, including those with rights")),
|
||||||
("view_user", _("Can view a user object")),
|
("view_user", _("Can view a user object")),
|
||||||
)
|
)
|
||||||
verbose_name = _("user (member or club)")
|
verbose_name = _("user (member or club)")
|
||||||
|
@ -548,21 +548,21 @@ class User(
|
||||||
interfaces = self.user_interfaces()
|
interfaces = self.user_interfaces()
|
||||||
with transaction.atomic(), reversion.create_revision():
|
with transaction.atomic(), reversion.create_revision():
|
||||||
Interface.mass_assign_ipv4(interfaces)
|
Interface.mass_assign_ipv4(interfaces)
|
||||||
reversion.set_comment(_("IPv4 assigning"))
|
reversion.set_comment("IPv4 assignment")
|
||||||
|
|
||||||
def unassign_ips(self):
|
def unassign_ips(self):
|
||||||
""" Désassigne les ipv4 aux machines de l'user"""
|
""" Désassigne les ipv4 aux machines de l'user"""
|
||||||
interfaces = self.user_interfaces()
|
interfaces = self.user_interfaces()
|
||||||
with transaction.atomic(), reversion.create_revision():
|
with transaction.atomic(), reversion.create_revision():
|
||||||
Interface.mass_unassign_ipv4(interfaces)
|
Interface.mass_unassign_ipv4(interfaces)
|
||||||
reversion.set_comment(_("IPv4 unassigning"))
|
reversion.set_comment("IPv4 unassignment")
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def mass_unassign_ips(cls, users_list):
|
def mass_unassign_ips(cls, users_list):
|
||||||
interfaces = cls.users_interfaces(users_list)
|
interfaces = cls.users_interfaces(users_list)
|
||||||
with transaction.atomic(), reversion.create_revision():
|
with transaction.atomic(), reversion.create_revision():
|
||||||
Interface.mass_unassign_ipv4(interfaces)
|
Interface.mass_unassign_ipv4(interfaces)
|
||||||
reversion.set_comment(_("IPv4 assigning"))
|
reversion.set_comment("IPv4 assignment")
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def mass_disable_email(cls, queryset_users):
|
def mass_disable_email(cls, queryset_users):
|
||||||
|
@ -761,11 +761,10 @@ class User(
|
||||||
"url": request.build_absolute_uri(
|
"url": request.build_absolute_uri(
|
||||||
reverse("users:process", kwargs={"token": req.token})
|
reverse("users:process", kwargs={"token": req.token})
|
||||||
),
|
),
|
||||||
"expire_in": str(GeneralOption.get_cached_value("req_expire_hrs"))
|
"expire_in": str(GeneralOption.get_cached_value("req_expire_hrs")),
|
||||||
+ " hours",
|
|
||||||
}
|
}
|
||||||
send_mail(
|
send_mail(
|
||||||
"Changement de mot de passe du %(name)s / Password renewal for "
|
"Changement de mot de passe de %(name)s / Password change for "
|
||||||
"%(name)s" % {"name": AssoOption.get_cached_value("name")},
|
"%(name)s" % {"name": AssoOption.get_cached_value("name")},
|
||||||
template.render(context),
|
template.render(context),
|
||||||
GeneralOption.get_cached_value("email_from"),
|
GeneralOption.get_cached_value("email_from"),
|
||||||
|
@ -902,7 +901,7 @@ class User(
|
||||||
if self.groups.filter(listright__critical=True):
|
if self.groups.filter(listright__critical=True):
|
||||||
return (
|
return (
|
||||||
False,
|
False,
|
||||||
_("User with critical rights, can't be edited. "),
|
_("User with critical rights, can't be edited."),
|
||||||
("users.change_all_users",),
|
("users.change_all_users",),
|
||||||
)
|
)
|
||||||
elif self == AssoOption.get_cached_value("utilisateur_asso"):
|
elif self == AssoOption.get_cached_value("utilisateur_asso"):
|
||||||
|
@ -910,7 +909,7 @@ class User(
|
||||||
False,
|
False,
|
||||||
_(
|
_(
|
||||||
"Impossible to edit the organisation's"
|
"Impossible to edit the organisation's"
|
||||||
" user without the 'change_all_users' right."
|
" user without the \"change_all_users\" right."
|
||||||
),
|
),
|
||||||
("users.change_all_users",),
|
("users.change_all_users",),
|
||||||
)
|
)
|
||||||
|
@ -985,7 +984,7 @@ class User(
|
||||||
):
|
):
|
||||||
return (
|
return (
|
||||||
False,
|
False,
|
||||||
_("Permission required to change the room."),
|
_("You don't have the right to change the room."),
|
||||||
("users.change_user",),
|
("users.change_user",),
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
@ -1002,7 +1001,7 @@ class User(
|
||||||
can = user_request.has_perm("users.change_user_state")
|
can = user_request.has_perm("users.change_user_state")
|
||||||
return (
|
return (
|
||||||
can,
|
can,
|
||||||
_("Permission required to change the state.") if not can else None,
|
_("You don't have the right to change the state.") if not can else None,
|
||||||
("users.change_user_state",),
|
("users.change_user_state",),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1022,7 +1021,7 @@ class User(
|
||||||
):
|
):
|
||||||
return (
|
return (
|
||||||
False,
|
False,
|
||||||
_("Permission required to change the shell."),
|
_("You don't have the right to change the shell."),
|
||||||
("users.change_user_shell",),
|
("users.change_user_shell",),
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
@ -1069,7 +1068,7 @@ class User(
|
||||||
can = user_request.has_perm("users.change_user_force")
|
can = user_request.has_perm("users.change_user_force")
|
||||||
return (
|
return (
|
||||||
can,
|
can,
|
||||||
_("Permission required to force the move.") if not can else None,
|
_("You don't have the right to force the move.") if not can else None,
|
||||||
("users.change_user_force",),
|
("users.change_user_force",),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1084,7 +1083,7 @@ class User(
|
||||||
can = user_request.has_perm("users.change_user_grou")
|
can = user_request.has_perm("users.change_user_grou")
|
||||||
return (
|
return (
|
||||||
can,
|
can,
|
||||||
_("Permission required to edit the user's groups of rights.")
|
_("You don't have the right to edit the user's groups of rights.")
|
||||||
if not can
|
if not can
|
||||||
else None,
|
else None,
|
||||||
("users.change_user_groups"),
|
("users.change_user_groups"),
|
||||||
|
@ -1100,7 +1099,7 @@ class User(
|
||||||
can = user_request.is_superuser
|
can = user_request.is_superuser
|
||||||
return (
|
return (
|
||||||
can,
|
can,
|
||||||
_("'superuser' right required to edit the superuser flag.")
|
_("\"superuser\" right required to edit the superuser flag.")
|
||||||
if not can
|
if not can
|
||||||
else None,
|
else None,
|
||||||
[],
|
[],
|
||||||
|
@ -1241,7 +1240,7 @@ class Adherent(User):
|
||||||
gpg_fingerprint = self.gpg_fingerprint.replace(" ", "").upper()
|
gpg_fingerprint = self.gpg_fingerprint.replace(" ", "").upper()
|
||||||
if not re.match("^[0-9A-F]{40}$", gpg_fingerprint):
|
if not re.match("^[0-9A-F]{40}$", gpg_fingerprint):
|
||||||
raise ValidationError(
|
raise ValidationError(
|
||||||
_("A GPG fingerprint must contain 40 hexadecimal characters")
|
_("A GPG fingerprint must contain 40 hexadecimal characters.")
|
||||||
)
|
)
|
||||||
self.gpg_fingerprint = gpg_fingerprint
|
self.gpg_fingerprint = gpg_fingerprint
|
||||||
|
|
||||||
|
@ -1265,7 +1264,7 @@ class Adherent(User):
|
||||||
if not user_request.is_authenticated and not OptionalUser.get_cached_value(
|
if not user_request.is_authenticated and not OptionalUser.get_cached_value(
|
||||||
"self_adhesion"
|
"self_adhesion"
|
||||||
):
|
):
|
||||||
return False, _("Self adhesion is disabled."), None
|
return False, _("Self registration is disabled."), None
|
||||||
else:
|
else:
|
||||||
if OptionalUser.get_cached_value(
|
if OptionalUser.get_cached_value(
|
||||||
"all_can_create_adherent"
|
"all_can_create_adherent"
|
||||||
|
@ -1418,7 +1417,7 @@ class ServiceUser(RevMixin, AclMixin, AbstractBaseUser):
|
||||||
validators=[linux_user_validator],
|
validators=[linux_user_validator],
|
||||||
)
|
)
|
||||||
access_group = models.CharField(choices=ACCESS, default=readonly, max_length=32)
|
access_group = models.CharField(choices=ACCESS, default=readonly, max_length=32)
|
||||||
comment = models.CharField(help_text=_("Comment"), max_length=255, blank=True)
|
comment = models.CharField(help_text=_("Comment."), max_length=255, blank=True)
|
||||||
|
|
||||||
USERNAME_FIELD = "pseudo"
|
USERNAME_FIELD = "pseudo"
|
||||||
objects = UserManager()
|
objects = UserManager()
|
||||||
|
@ -1518,13 +1517,13 @@ class ListRight(RevMixin, AclMixin, Group):
|
||||||
validators=[
|
validators=[
|
||||||
RegexValidator(
|
RegexValidator(
|
||||||
"^[a-z]+$",
|
"^[a-z]+$",
|
||||||
message=(_("UNIX groups can only contain lower case letters.")),
|
message=(_("UNIX group names can only contain lower case letters.")),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
gid = models.PositiveIntegerField(unique=True, null=True)
|
gid = models.PositiveIntegerField(unique=True, null=True)
|
||||||
critical = models.BooleanField(default=False)
|
critical = models.BooleanField(default=False)
|
||||||
details = models.CharField(help_text=_("Description"), max_length=255, blank=True)
|
details = models.CharField(help_text=_("Description."), max_length=255, blank=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
permissions = (("view_listright", _("Can view a group of rights object")),)
|
permissions = (("view_listright", _("Can view a group of rights object")),)
|
||||||
|
@ -1643,7 +1642,7 @@ class Ban(RevMixin, AclMixin, models.Model):
|
||||||
if not user_request.has_perm("users.view_ban") and self.user != user_request:
|
if not user_request.has_perm("users.view_ban") and self.user != user_request:
|
||||||
return (
|
return (
|
||||||
False,
|
False,
|
||||||
_("You don't have the right to view bans other than yours."),
|
_("You don't have the right to view other bans than yours."),
|
||||||
("users.view_ban",),
|
("users.view_ban",),
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
@ -1713,7 +1712,7 @@ class Whitelist(RevMixin, AclMixin, models.Model):
|
||||||
):
|
):
|
||||||
return (
|
return (
|
||||||
False,
|
False,
|
||||||
_("You don't have the right to view whitelists other than yours."),
|
_("You don't have the right to view other whitelists than yours."),
|
||||||
("users.view_whitelist",),
|
("users.view_whitelist",),
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
@ -1910,10 +1909,10 @@ class EMailAddress(RevMixin, AclMixin, models.Model):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
user = models.ForeignKey(
|
user = models.ForeignKey(
|
||||||
User, on_delete=models.CASCADE, help_text=_("User of the local email account")
|
User, on_delete=models.CASCADE, help_text=_("User of the local email account.")
|
||||||
)
|
)
|
||||||
local_part = models.CharField(
|
local_part = models.CharField(
|
||||||
unique=True, max_length=128, help_text=_("Local part of the email address")
|
unique=True, max_length=128, help_text=_("Local part of the email address.")
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -1990,7 +1989,7 @@ class EMailAddress(RevMixin, AclMixin, models.Model):
|
||||||
return (
|
return (
|
||||||
False,
|
False,
|
||||||
_(
|
_(
|
||||||
"You don't have the right to edit another user's local"
|
"You don't have the right to view another user's local"
|
||||||
" email account."
|
" email account."
|
||||||
),
|
),
|
||||||
("users.view_emailaddress",),
|
("users.view_emailaddress",),
|
||||||
|
@ -2025,7 +2024,7 @@ class EMailAddress(RevMixin, AclMixin, models.Model):
|
||||||
False,
|
False,
|
||||||
_(
|
_(
|
||||||
"You don't have the right to delete another user's"
|
"You don't have the right to delete another user's"
|
||||||
" local email account"
|
" local email account."
|
||||||
),
|
),
|
||||||
("users.delete_emailaddress",),
|
("users.delete_emailaddress",),
|
||||||
)
|
)
|
||||||
|
|
|
@ -37,7 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<i class="fa fa-address-book"></i>
|
<i class="fa fa-address-book"></i>
|
||||||
{% trans "Superuser" %}
|
{% trans "Superuser" %}
|
||||||
</h4>
|
</h4>
|
||||||
{% trans "Django's specific pre-defined right that supersed any other rights." %}
|
{% trans "Django's specific pre-defined right that supersedes any other rights." %}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-collapse collapse" id="collapse_superuser">
|
<div class="panel-collapse collapse" id="collapse_superuser">
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
|
|
@ -30,7 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{% trans "Name" %}</th>
|
<th>{% trans "Name" %}</th>
|
||||||
<th>{% trans "Role" %}</th>
|
<th>{% trans "Access group" %}</th>
|
||||||
<th>{% trans "Comment" %}</th>
|
<th>{% trans "Comment" %}</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -32,9 +32,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h2>{% trans "List of groups of rights" %}</h2>
|
<h2>{% trans "List of groups of rights" %}</h2>
|
||||||
{% can_create ListRight %}
|
{% can_create ListRight %}
|
||||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-listright' %}"><i class="fa fa-plus"></i>{% trans " Add a group of rights" %}</a>
|
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-listright' %}"><i class="fa fa-plus"></i> {% trans "Add a group of rights" %}</a>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'users:del-listright' %}"><i class="fa fa-trash"></i>{% trans " Delete one or several groups of rights" %}</a>
|
<a class="btn btn-danger btn-sm" role="button" href="{% url 'users:del-listright' %}"><i class="fa fa-trash"></i> {% trans "Delete one or several groups of rights" %}</a>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
{% include 'users/aff_listright.html' %}
|
{% include 'users/aff_listright.html' %}
|
||||||
|
|
|
@ -31,11 +31,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h2>{% trans "List of schools" %}</h2>
|
<h2>{% trans "List of schools" %}</h2>
|
||||||
<h5>{% trans "List of schools for created users" %}</h5>
|
<h5>{% trans "List of schools for registered users" %}</h5>
|
||||||
{% can_create School %}
|
{% can_create School %}
|
||||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-school' %}"><i class="fa fa-plus"></i>{% trans " Add a school" %}</a>
|
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-school' %}"><i class="fa fa-plus"></i> {% trans "Add a school" %}</a>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'users:del-school' %}"><i class="fa fa-trash"></i>{% trans " Delete one or several schools" %}</a>
|
<a class="btn btn-danger btn-sm" role="button" href="{% url 'users:del-school' %}"><i class="fa fa-trash"></i> {% trans "Delete one or several schools" %}</a>
|
||||||
<hr>
|
<hr>
|
||||||
{% include 'users/aff_schools.html' with school_list=school_list %}
|
{% include 'users/aff_schools.html' with school_list=school_list %}
|
||||||
<br />
|
<br />
|
||||||
|
|
|
@ -33,7 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<h2>{% trans "List of LDAP service users" %}</h2>
|
<h2>{% trans "List of LDAP service users" %}</h2>
|
||||||
<h5>{% trans "The LDAP service users are special users having access only to the LDAP for authentication operations. It is recommended to create a service user with a login and a password for any concerned service." %}</h5>
|
<h5>{% trans "The LDAP service users are special users having access only to the LDAP for authentication operations. It is recommended to create a service user with a login and a password for any concerned service." %}</h5>
|
||||||
{% can_create ServiceUser %}
|
{% can_create ServiceUser %}
|
||||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:new-serviceuser' %}"><i class="fa fa-plus"></i>{% trans " Add a service user" %}</a>
|
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:new-serviceuser' %}"><i class="fa fa-plus"></i> {% trans "Add a service user" %}</a>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
{% include 'users/aff_serviceusers.html' with serviceusers_list=serviceusers_list %}
|
{% include 'users/aff_serviceusers.html' with serviceusers_list=serviceusers_list %}
|
||||||
<br />
|
<br />
|
||||||
|
|
|
@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h2>{% trans "List of shells" %}</h2>
|
<h2>{% trans "List of shells" %}</h2>
|
||||||
{% can_create ListShell %}
|
{% can_create ListShell %}
|
||||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-shell' %}"><i class="fa fa-plus"></i>{% trans " Add a shell" %}</a>
|
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-shell' %}"><i class="fa fa-plus"></i> {% trans "Add a shell" %}</a>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
{% include 'users/aff_shell.html' with shell_list=shell_list %}
|
{% include 'users/aff_shell.html' with shell_list=shell_list %}
|
||||||
<br />
|
<br />
|
||||||
|
|
|
@ -36,7 +36,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<input type="submit" name="valider" value={% trans "Confirm" %} class="btn btn-primary" id="submit-id-submit">
|
<input type="submit" name="valider" value={% trans "Confirm" %} class="btn btn-primary" id="submit-id-submit">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<h3>{% blocktrans %}The following users will be archived ({{ to_archive_list|length }}):{% endblocktrans %}</h3>
|
<h3>{% blocktrans %}The following users will be archived:{% endblocktrans %}</h3>
|
||||||
{% include 'users/aff_users.html' with users_list=to_archive_list %}
|
{% include 'users/aff_users.html' with users_list=to_archive_list %}
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
|
|
|
@ -43,7 +43,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<div class="col-sm-6 {% if solde_activated %}col-md-4{% else %}col_md-6{% endif %}">
|
<div class="col-sm-6 {% if solde_activated %}col-md-4{% else %}col_md-6{% endif %}">
|
||||||
{% if users.is_ban%}
|
{% if users.is_ban%}
|
||||||
<div class="panel panel-danger">
|
<div class="panel panel-danger">
|
||||||
<div class="panel-heading dashboard">{% trans "Your account has been banned" %}</div>
|
<div class="panel-heading dashboard">{% trans "Your account has been banned." %}</div>
|
||||||
<div class="panel-body dashboard">
|
<div class="panel-body dashboard">
|
||||||
<i class="text-danger">{% blocktrans with end_ban_date=users.end_ban|date:"SHORT_DATE_FORMAT" %}End of the ban: {{ end_ban_date }}{% endblocktrans %}</i>
|
<i class="text-danger">{% blocktrans with end_ban_date=users.end_ban|date:"SHORT_DATE_FORMAT" %}End of the ban: {{ end_ban_date }}{% endblocktrans %}</i>
|
||||||
</div>
|
</div>
|
||||||
|
@ -57,7 +57,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<i class="fa fa-sign-in"></i> {% trans "Pay for a connection" %}
|
<i class="fa fa-sign-in"></i> {% trans "Pay for a connection" %}
|
||||||
</a>
|
</a>
|
||||||
{% acl_else %}
|
{% acl_else %}
|
||||||
{% trans "Ask for someone with the appropriate rights to pay for a connection." %}
|
{% trans "Ask someone with the appropriate rights to pay for a connection." %}
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -94,11 +94,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<div class="panel panel-info">
|
<div class="panel panel-info">
|
||||||
<div class="panel-heading dashboard" data-parent="#accordion" data-toggle="collapse"
|
<div class="panel-heading dashboard" data-parent="#accordion" data-toggle="collapse"
|
||||||
data-target="#machines">
|
data-target="#machines">
|
||||||
<i class="fa fa-desktop"></i>{% trans " Machines" %} <span class="badge"> {{ nb_machines }}</span>
|
<i class="fa fa-desktop"></i> {% trans "Machines" %} <span class="badge"> {{ nb_machines }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body dashboard">
|
<div class="panel-body dashboard">
|
||||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:new-machine' users.id %}">
|
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:new-machine' users.id %}">
|
||||||
<i class="fa fa-desktop"></i>{% trans " Add a machine" %}
|
<i class="fa fa-desktop"></i> {% trans "Add a machine" %}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -110,7 +110,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body dashboard">
|
<div class="panel-body dashboard">
|
||||||
<a class="btn btn-warning btn-sm" role="button" href="{% url 'machines:new-machine' users.id %}">
|
<a class="btn btn-warning btn-sm" role="button" href="{% url 'machines:new-machine' users.id %}">
|
||||||
<i class="fa fa-desktop"></i>{% trans " Add a machine" %}
|
<i class="fa fa-desktop"></i> {% trans "Add a machine" %}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -125,7 +125,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse"
|
<div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse"
|
||||||
data-target="#information">
|
data-target="#information">
|
||||||
<h3 class="panel-title pull-left">
|
<h3 class="panel-title pull-left">
|
||||||
<i class="fa fa-user"></i>{% trans " Detailed information" %}
|
<i class="fa fa-user"></i> {% trans "Detailed information" %}
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-collapse collapse collapse-default" id="information">
|
<div class="panel-collapse collapse collapse-default" id="information">
|
||||||
|
@ -225,7 +225,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% if users.end_adhesion != None %}
|
{% if users.end_adhesion != None %}
|
||||||
<dd><i class="text-success">{{ users.end_adhesion }}</i></dd>
|
<dd><i class="text-success">{{ users.end_adhesion }}</i></dd>
|
||||||
{% else %}
|
{% else %}
|
||||||
<dd><i class="text-danger">{% trans "not a member" %}</i></dd>
|
<dd><i class="text-danger">{% trans "Not a member" %}</i></dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -256,9 +256,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% elif users.state == 2 %}
|
{% elif users.state == 2 %}
|
||||||
<dd><i class="text-danger">{% trans "Archived" %}</i></dd>
|
<dd><i class="text-danger">{% trans "Archived" %}</i></dd>
|
||||||
{% elif users.state == 3 %}
|
{% elif users.state == 3 %}
|
||||||
<dd><i class="text-danger">{% trans "Not yet member" %}</i></dd>
|
<dd><i class="text-danger">{% trans "Not yet active" %}</i></dd>
|
||||||
{% elif users.state == 4 %}
|
{% elif users.state == 4 %}
|
||||||
<dd><i class="text-danger">{% trans "Full Archived" %}</i></dd>
|
<dd><i class="text-danger">{% trans "Fully archived" %}</i></dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -320,7 +320,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse" data-target="#club">
|
<div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse" data-target="#club">
|
||||||
<h3 class="panel-title pull-left">
|
<h3 class="panel-title pull-left">
|
||||||
<i class="fa fa-users"></i>{% trans " Manage the club" %}
|
<i class="fa fa-users"></i> {% trans "Manage the club" %}
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-collapse collapse" id="club">
|
<div class="panel-collapse collapse" id="club">
|
||||||
|
@ -484,14 +484,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse" data-target="#email">
|
<div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse" data-target="#email">
|
||||||
<h3 class="panel-title pull-left">
|
<h3 class="panel-title pull-left">
|
||||||
<i class="fa fa-envelope"></i>{% trans " Email settings" %}
|
<i class="fa fa-envelope"></i> {% trans "Email settings" %}
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div id="email" class="panel-collapse collapse">
|
<div id="email" class="panel-collapse collapse">
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{% can_edit users %}
|
{% can_edit users %}
|
||||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:edit-email-settings' users.id %}">
|
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:edit-email-settings' users.id %}">
|
||||||
<i class="fa fa-pencil"></i>{% trans " Edit email settings" %}
|
<i class="fa fa-pencil"></i> {% trans "Edit email settings" %}
|
||||||
</a>
|
</a>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -510,12 +510,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<td>{{ users.local_email_redirect | tick }}</td>
|
<td>{{ users.local_email_redirect | tick }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<p>{% trans "The contact email address is the email address where we send emails to contact you. If you would like to use your external email address for that, you can either disable your local email address or enable the local email redirection." %}</p>
|
<p>{% trans "The contact email address is the email address to which we send emails to contact you. If you would like to use your external email address for that, you can either disable your local email address or enable the local email redirection." %}</p>
|
||||||
</div>
|
</div>
|
||||||
{% if users.local_email_enabled %}
|
{% if users.local_email_enabled %}
|
||||||
{% can_create EMailAddress users.id %}
|
{% can_create EMailAddress users.id %}
|
||||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-emailaddress' users.id %}">
|
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-emailaddress' users.id %}">
|
||||||
<i class="fa fa-plus-square"></i>{% trans " Add an email address" %}
|
<i class="fa fa-plus-square"></i> {% trans "Add an email address" %}
|
||||||
</a>
|
</a>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
{% if emailaddress_list %}
|
{% if emailaddress_list %}
|
||||||
|
|
|
@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% bootstrap_form_errors userform %}
|
{% bootstrap_form_errors userform %}
|
||||||
|
|
||||||
<h2>{% blocktrans %}Device and room register form{% endblocktrans %}</h2>
|
<h2>{% trans "Device and room register form" %}</h2>
|
||||||
|
|
||||||
<form class="form" method="post">
|
<form class="form" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
@ -61,7 +61,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<center>{% bootstrap_button _("OK") button_type="submit" icon='ok' button_class='btn-success' %}</center>
|
{% trans "OK" as tr_ok %}
|
||||||
|
<center>{% bootstrap_button tr_ok button_type="submit" icon='ok' button_class='btn-success' %}</center>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,7 @@ def new_user(request):
|
||||||
user.reset_passwd_mail(request)
|
user.reset_passwd_mail(request)
|
||||||
messages.success(
|
messages.success(
|
||||||
request,
|
request,
|
||||||
_("The user %s was created, an email to set" " the password was sent.")
|
_("The user %s was created, an email to set the password was sent.")
|
||||||
% user.pseudo,
|
% user.pseudo,
|
||||||
)
|
)
|
||||||
return redirect(reverse("users:profil", kwargs={"userid": str(user.id)}))
|
return redirect(reverse("users:profil", kwargs={"userid": str(user.id)}))
|
||||||
|
@ -153,7 +153,7 @@ def new_club(request):
|
||||||
club.reset_passwd_mail(request)
|
club.reset_passwd_mail(request)
|
||||||
messages.success(
|
messages.success(
|
||||||
request,
|
request,
|
||||||
_("The club %s was created, an email to set" " the password was sent.")
|
_("The club %s was created, an email to set the password was sent.")
|
||||||
% club.pseudo,
|
% club.pseudo,
|
||||||
)
|
)
|
||||||
return redirect(reverse("users:profil", kwargs={"userid": str(club.id)}))
|
return redirect(reverse("users:profil", kwargs={"userid": str(club.id)}))
|
||||||
|
@ -181,7 +181,7 @@ def edit_club_admin_members(request, club_instance, **_kwargs):
|
||||||
{
|
{
|
||||||
"userform": club,
|
"userform": club,
|
||||||
"showCGU": False,
|
"showCGU": False,
|
||||||
"action_name": _("Edit the admins and members"),
|
"action_name": _("Edit"),
|
||||||
},
|
},
|
||||||
"users/user.html",
|
"users/user.html",
|
||||||
request,
|
request,
|
||||||
|
@ -208,7 +208,7 @@ def edit_info(request, user, userid):
|
||||||
messages.success(request, _("The user was edited."))
|
messages.success(request, _("The user was edited."))
|
||||||
return redirect(reverse("users:profil", kwargs={"userid": str(userid)}))
|
return redirect(reverse("users:profil", kwargs={"userid": str(userid)}))
|
||||||
return form(
|
return form(
|
||||||
{"userform": user_form, "action_name": _("Edit the user")},
|
{"userform": user_form, "action_name": _("Edit")},
|
||||||
"users/user.html",
|
"users/user.html",
|
||||||
request,
|
request,
|
||||||
)
|
)
|
||||||
|
@ -225,7 +225,7 @@ def state(request, user, userid):
|
||||||
messages.success(request, _("The state was edited."))
|
messages.success(request, _("The state was edited."))
|
||||||
return redirect(reverse("users:profil", kwargs={"userid": str(userid)}))
|
return redirect(reverse("users:profil", kwargs={"userid": str(userid)}))
|
||||||
return form(
|
return form(
|
||||||
{"userform": state_form, "action_name": _("Edit the state")},
|
{"userform": state_form, "action_name": _("Edit")},
|
||||||
"users/user.html",
|
"users/user.html",
|
||||||
request,
|
request,
|
||||||
)
|
)
|
||||||
|
@ -242,7 +242,7 @@ def groups(request, user, userid):
|
||||||
messages.success(request, _("The groups were edited."))
|
messages.success(request, _("The groups were edited."))
|
||||||
return redirect(reverse("users:profil", kwargs={"userid": str(userid)}))
|
return redirect(reverse("users:profil", kwargs={"userid": str(userid)}))
|
||||||
return form(
|
return form(
|
||||||
{"userform": group_form, "action_name": _("Edit the groups")},
|
{"userform": group_form, "action_name": _("Edit")},
|
||||||
"users/user.html",
|
"users/user.html",
|
||||||
request,
|
request,
|
||||||
)
|
)
|
||||||
|
@ -297,7 +297,7 @@ def new_serviceuser(request):
|
||||||
messages.success(request, _("The service user was created."))
|
messages.success(request, _("The service user was created."))
|
||||||
return redirect(reverse("users:index-serviceusers"))
|
return redirect(reverse("users:index-serviceusers"))
|
||||||
return form(
|
return form(
|
||||||
{"userform": user, "action_name": _("Create a service user")},
|
{"userform": user, "action_name": _("Add")},
|
||||||
"users/user.html",
|
"users/user.html",
|
||||||
request,
|
request,
|
||||||
)
|
)
|
||||||
|
@ -314,7 +314,7 @@ def edit_serviceuser(request, serviceuser, **_kwargs):
|
||||||
messages.success(request, _("The service user was edited."))
|
messages.success(request, _("The service user was edited."))
|
||||||
return redirect(reverse("users:index-serviceusers"))
|
return redirect(reverse("users:index-serviceusers"))
|
||||||
return form(
|
return form(
|
||||||
{"userform": serviceuser, "action_name": _("Edit a service user")},
|
{"userform": serviceuser, "action_name": _("Edit")},
|
||||||
"users/user.html",
|
"users/user.html",
|
||||||
request,
|
request,
|
||||||
)
|
)
|
||||||
|
@ -329,7 +329,7 @@ def del_serviceuser(request, serviceuser, **_kwargs):
|
||||||
messages.success(request, _("The service user was deleted."))
|
messages.success(request, _("The service user was deleted."))
|
||||||
return redirect(reverse("users:index-serviceusers"))
|
return redirect(reverse("users:index-serviceusers"))
|
||||||
return form(
|
return form(
|
||||||
{"objet": serviceuser, "objet_name": "service user"},
|
{"objet": serviceuser, "objet_name": _("service user")},
|
||||||
"users/delete.html",
|
"users/delete.html",
|
||||||
request,
|
request,
|
||||||
)
|
)
|
||||||
|
@ -351,7 +351,7 @@ def add_ban(request, user, userid):
|
||||||
if user.is_ban():
|
if user.is_ban():
|
||||||
messages.error(request, _("Warning: this user already has an active ban."))
|
messages.error(request, _("Warning: this user already has an active ban."))
|
||||||
return form(
|
return form(
|
||||||
{"userform": ban, "action_name": _("Add a ban")}, "users/user.html", request
|
{"userform": ban, "action_name": _("Add")}, "users/user.html", request
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -368,7 +368,7 @@ def edit_ban(request, ban_instance, **_kwargs):
|
||||||
messages.success(request, _("The ban was edited."))
|
messages.success(request, _("The ban was edited."))
|
||||||
return redirect(reverse("users:index"))
|
return redirect(reverse("users:index"))
|
||||||
return form(
|
return form(
|
||||||
{"userform": ban, "action_name": _("Edit a ban")}, "users/user.html", request
|
{"userform": ban, "action_name": _("Edit")}, "users/user.html", request
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -380,7 +380,7 @@ def del_ban(request, ban, **_kwargs):
|
||||||
ban.delete()
|
ban.delete()
|
||||||
messages.success(request, _("The ban was deleted."))
|
messages.success(request, _("The ban was deleted."))
|
||||||
return redirect(reverse("users:profil", kwargs={"userid": str(ban.user.id)}))
|
return redirect(reverse("users:profil", kwargs={"userid": str(ban.user.id)}))
|
||||||
return form({"objet": ban, "objet_name": "ban"}, "users/delete.html", request)
|
return form({"objet": ban, "objet_name": _("ban")}, "users/delete.html", request)
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
@ -402,7 +402,7 @@ def add_whitelist(request, user, userid):
|
||||||
request, _("Warning: this user already has an active whitelist.")
|
request, _("Warning: this user already has an active whitelist.")
|
||||||
)
|
)
|
||||||
return form(
|
return form(
|
||||||
{"userform": whitelist, "action_name": _("Add a whitelist")},
|
{"userform": whitelist, "action_name": _("Add")},
|
||||||
"users/user.html",
|
"users/user.html",
|
||||||
request,
|
request,
|
||||||
)
|
)
|
||||||
|
@ -422,7 +422,7 @@ def edit_whitelist(request, whitelist_instance, **_kwargs):
|
||||||
messages.success(request, _("The whitelist was edited."))
|
messages.success(request, _("The whitelist was edited."))
|
||||||
return redirect(reverse("users:index"))
|
return redirect(reverse("users:index"))
|
||||||
return form(
|
return form(
|
||||||
{"userform": whitelist, "action_name": _("Edit a whitelist")},
|
{"userform": whitelist, "action_name": _("Edit")},
|
||||||
"users/user.html",
|
"users/user.html",
|
||||||
request,
|
request,
|
||||||
)
|
)
|
||||||
|
@ -439,7 +439,7 @@ def del_whitelist(request, whitelist, **_kwargs):
|
||||||
reverse("users:profil", kwargs={"userid": str(whitelist.user.id)})
|
reverse("users:profil", kwargs={"userid": str(whitelist.user.id)})
|
||||||
)
|
)
|
||||||
return form(
|
return form(
|
||||||
{"objet": whitelist, "objet_name": "whitelist"}, "users/delete.html", request
|
{"objet": whitelist, "objet_name": _("whitelist")}, "users/delete.html", request
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -460,7 +460,7 @@ def add_emailaddress(request, user, userid):
|
||||||
{
|
{
|
||||||
"userform": emailaddress,
|
"userform": emailaddress,
|
||||||
"showCGU": False,
|
"showCGU": False,
|
||||||
"action_name": _("Add a local email account"),
|
"action_name": _("Add"),
|
||||||
},
|
},
|
||||||
"users/user.html",
|
"users/user.html",
|
||||||
request,
|
request,
|
||||||
|
@ -487,7 +487,7 @@ def edit_emailaddress(request, emailaddress_instance, **_kwargs):
|
||||||
{
|
{
|
||||||
"userform": emailaddress,
|
"userform": emailaddress,
|
||||||
"showCGU": False,
|
"showCGU": False,
|
||||||
"action_name": _("Edit a local email account"),
|
"action_name": _("Edit"),
|
||||||
},
|
},
|
||||||
"users/user.html",
|
"users/user.html",
|
||||||
request,
|
request,
|
||||||
|
@ -505,7 +505,7 @@ def del_emailaddress(request, emailaddress, **_kwargs):
|
||||||
reverse("users:profil", kwargs={"userid": str(emailaddress.user.id)})
|
reverse("users:profil", kwargs={"userid": str(emailaddress.user.id)})
|
||||||
)
|
)
|
||||||
return form(
|
return form(
|
||||||
{"objet": emailaddress, "objet_name": "emailaddress"},
|
{"objet": emailaddress, "objet_name": _("email address")},
|
||||||
"users/delete.html",
|
"users/delete.html",
|
||||||
request,
|
request,
|
||||||
)
|
)
|
||||||
|
@ -530,7 +530,7 @@ def edit_email_settings(request, user_instance, **_kwargs):
|
||||||
"userform": email_settings,
|
"userform": email_settings,
|
||||||
"showCGU": False,
|
"showCGU": False,
|
||||||
"load_js_file": "/static/js/email_address.js",
|
"load_js_file": "/static/js/email_address.js",
|
||||||
"action_name": _("Edit the email settings"),
|
"action_name": _("Edit"),
|
||||||
},
|
},
|
||||||
"users/user.html",
|
"users/user.html",
|
||||||
request,
|
request,
|
||||||
|
@ -548,7 +548,7 @@ def add_school(request):
|
||||||
messages.success(request, _("The school was added."))
|
messages.success(request, _("The school was added."))
|
||||||
return redirect(reverse("users:index-school"))
|
return redirect(reverse("users:index-school"))
|
||||||
return form(
|
return form(
|
||||||
{"userform": school, "action_name": _("Add a school")},
|
{"userform": school, "action_name": _("Add")},
|
||||||
"users/user.html",
|
"users/user.html",
|
||||||
request,
|
request,
|
||||||
)
|
)
|
||||||
|
@ -566,7 +566,7 @@ def edit_school(request, school_instance, **_kwargs):
|
||||||
messages.success(request, _("The school was edited."))
|
messages.success(request, _("The school was edited."))
|
||||||
return redirect(reverse("users:index-school"))
|
return redirect(reverse("users:index-school"))
|
||||||
return form(
|
return form(
|
||||||
{"userform": school, "action_name": _("Edit a school")},
|
{"userform": school, "action_name": _("Edit")},
|
||||||
"users/user.html",
|
"users/user.html",
|
||||||
request,
|
request,
|
||||||
)
|
)
|
||||||
|
@ -597,7 +597,7 @@ def del_school(request, instances):
|
||||||
)
|
)
|
||||||
return redirect(reverse("users:index-school"))
|
return redirect(reverse("users:index-school"))
|
||||||
return form(
|
return form(
|
||||||
{"userform": school, "action_name": _("Delete")}, "users/user.html", request
|
{"userform": school, "action_name": _("Confirm")}, "users/user.html", request
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -611,7 +611,7 @@ def add_shell(request):
|
||||||
messages.success(request, _("The shell was added."))
|
messages.success(request, _("The shell was added."))
|
||||||
return redirect(reverse("users:index-shell"))
|
return redirect(reverse("users:index-shell"))
|
||||||
return form(
|
return form(
|
||||||
{"userform": shell, "action_name": _("Add a shell")}, "users/user.html", request
|
{"userform": shell, "action_name": _("Add")}, "users/user.html", request
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -626,7 +626,7 @@ def edit_shell(request, shell_instance, **_kwargs):
|
||||||
messages.success(request, _("The shell was edited."))
|
messages.success(request, _("The shell was edited."))
|
||||||
return redirect(reverse("users:index-shell"))
|
return redirect(reverse("users:index-shell"))
|
||||||
return form(
|
return form(
|
||||||
{"userform": shell, "action_name": _("Edit a shell")},
|
{"userform": shell, "action_name": _("Edit")},
|
||||||
"users/user.html",
|
"users/user.html",
|
||||||
request,
|
request,
|
||||||
)
|
)
|
||||||
|
@ -640,7 +640,7 @@ def del_shell(request, shell, **_kwargs):
|
||||||
shell.delete()
|
shell.delete()
|
||||||
messages.success(request, _("The shell was deleted."))
|
messages.success(request, _("The shell was deleted."))
|
||||||
return redirect(reverse("users:index-shell"))
|
return redirect(reverse("users:index-shell"))
|
||||||
return form({"objet": shell, "objet_name": "shell"}, "users/delete.html", request)
|
return form({"objet": shell, "objet_name": _("shell")}, "users/delete.html", request)
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
@ -654,7 +654,7 @@ def add_listright(request):
|
||||||
messages.success(request, _("The group of rights was added."))
|
messages.success(request, _("The group of rights was added."))
|
||||||
return redirect(reverse("users:index-listright"))
|
return redirect(reverse("users:index-listright"))
|
||||||
return form(
|
return form(
|
||||||
{"userform": listright, "action_name": _("Add a group of rights")},
|
{"userform": listright, "action_name": _("Add")},
|
||||||
"users/user.html",
|
"users/user.html",
|
||||||
request,
|
request,
|
||||||
)
|
)
|
||||||
|
@ -672,7 +672,7 @@ def edit_listright(request, listright_instance, **_kwargs):
|
||||||
messages.success(request, _("The group of rights was edited."))
|
messages.success(request, _("The group of rights was edited."))
|
||||||
return redirect(reverse("users:index-listright"))
|
return redirect(reverse("users:index-listright"))
|
||||||
return form(
|
return form(
|
||||||
{"userform": listright, "action_name": _("Edit a group of rights")},
|
{"userform": listright, "action_name": _("Edit")},
|
||||||
"users/user.html",
|
"users/user.html",
|
||||||
request,
|
request,
|
||||||
)
|
)
|
||||||
|
@ -689,7 +689,7 @@ def del_listright(request, instances):
|
||||||
for listright_del in listright_dels:
|
for listright_del in listright_dels:
|
||||||
try:
|
try:
|
||||||
listright_del.delete()
|
listright_del.delete()
|
||||||
messages.success(request, _("The group of rights was" " deleted."))
|
messages.success(request, _("The group of rights was deleted."))
|
||||||
except ProtectedError:
|
except ProtectedError:
|
||||||
messages.error(
|
messages.error(
|
||||||
request,
|
request,
|
||||||
|
@ -701,7 +701,7 @@ def del_listright(request, instances):
|
||||||
)
|
)
|
||||||
return redirect(reverse("users:index-listright"))
|
return redirect(reverse("users:index-listright"))
|
||||||
return form(
|
return form(
|
||||||
{"userform": listright, "action_name": _("Delete")}, "users/user.html", request
|
{"userform": listright, "action_name": _("Confirm")}, "users/user.html", request
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -993,7 +993,7 @@ def process_passwd(request, req):
|
||||||
if u_form.is_valid():
|
if u_form.is_valid():
|
||||||
with transaction.atomic(), reversion.create_revision():
|
with transaction.atomic(), reversion.create_revision():
|
||||||
u_form.save()
|
u_form.save()
|
||||||
reversion.set_comment(_("Password reset"))
|
reversion.set_comment("Password reset")
|
||||||
req.delete()
|
req.delete()
|
||||||
messages.success(request, _("The password was changed."))
|
messages.success(request, _("The password was changed."))
|
||||||
return redirect(reverse("index"))
|
return redirect(reverse("index"))
|
||||||
|
|
Loading…
Reference in a new issue