Commit af40e3ea authored by Laouen Fernet's avatar Laouen Fernet

Translation of users/ (front)

parent a06082c6
......@@ -25,7 +25,7 @@
Here are defined some functions to check acl on the application.
"""
from django.utils.translation import ugettext as _
def can_view(user):
"""Check if an user can view the application.
......@@ -38,4 +38,6 @@ def can_view(user):
viewing is granted and msg is a message (can be None).
"""
can = user.has_module_perms('users')
return can, None if can else "Vous ne pouvez pas voir cette application."
return can, None if can else _("You don't have the right to view this"
" application.")
......@@ -39,6 +39,7 @@ from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.core.validators import MinLengthValidator
from django.utils import timezone
from django.contrib.auth.models import Group, Permission
from django.utils.translation import ugettext_lazy as _
from preferences.models import OptionalUser
from re2o.utils import remove_user_room, get_input_formats_help_text
......@@ -66,18 +67,18 @@ class PassForm(FormRevMixin, FieldPermissionFormMixin, forms.ModelForm):
nouveaux mots de passe renseignés sont identiques et respectent
une norme"""
selfpasswd = forms.CharField(
label=u'Saisir le mot de passe existant',
label=_("Current password"),
max_length=255,
widget=forms.PasswordInput
)
passwd1 = forms.CharField(
label=u'Nouveau mot de passe',
label=_("New password"),
max_length=255,
validators=[MinLengthValidator(8)],
widget=forms.PasswordInput
)
passwd2 = forms.CharField(
label=u'Saisir à nouveau le mot de passe',
label=_("New password confirmation"),
max_length=255,
validators=[MinLengthValidator(8)],
widget=forms.PasswordInput
......@@ -94,7 +95,7 @@ class PassForm(FormRevMixin, FieldPermissionFormMixin, forms.ModelForm):
password2 = self.cleaned_data.get("passwd2")
if password1 and password2 and password1 != password2:
raise forms.ValidationError(
"Les 2 nouveaux mots de passe sont différents"
_("The new passwords don't match.")
)
return password2
......@@ -103,7 +104,7 @@ class PassForm(FormRevMixin, FieldPermissionFormMixin, forms.ModelForm):
if not self.instance.check_password(
self.cleaned_data.get("selfpasswd")
):
raise forms.ValidationError("Le mot de passe actuel est incorrect")
raise forms.ValidationError(_("The current password is incorrect."))
return
def save(self, commit=True):
......@@ -121,18 +122,18 @@ class UserCreationForm(FormRevMixin, forms.ModelForm):
l'admin, lors de la creation d'un user par admin. Inclu tous les
champs obligatoires"""
password1 = forms.CharField(
label='Password',
label=_("Password"),
widget=forms.PasswordInput,
validators=[MinLengthValidator(8)],
max_length=255
)
password2 = forms.CharField(
label='Password confirmation',
label=_("Password confirmation"),
widget=forms.PasswordInput,
validators=[MinLengthValidator(8)],
max_length=255
)
is_admin = forms.BooleanField(label='is admin')
is_admin = forms.BooleanField(label=_("Is admin"))
def __init__(self, *args, **kwargs):
prefix = kwargs.pop('prefix', self.Meta.model.__name__)
......@@ -142,7 +143,8 @@ class UserCreationForm(FormRevMixin, forms.ModelForm):
if not OptionalUser.objects.first().local_email_domain in self.cleaned_data.get('email'):
return self.cleaned_data.get('email').lower()
else:
raise forms.ValidationError("You can't use an internal address as your external address.")
raise forms.ValidationError(_("You can't use an internal address"
" as your external address."))
class Meta:
model = Adherent
......@@ -154,7 +156,7 @@ class UserCreationForm(FormRevMixin, forms.ModelForm):
password1 = self.cleaned_data.get("password1")
password2 = self.cleaned_data.get("password2")
if password1 and password2 and password1 != password2:
raise forms.ValidationError("Passwords don't match")
raise forms.ValidationError(_("The passwords don't match."))
return password2
def save(self, commit=True):
......@@ -173,13 +175,13 @@ class ServiceUserCreationForm(FormRevMixin, forms.ModelForm):
Formulaire pour la creation de nouveaux serviceusers.
Requiert seulement un mot de passe; et un pseudo"""
password1 = forms.CharField(
label='Password',
label=_("Password"),
widget=forms.PasswordInput,
min_length=8,
max_length=255
)
password2 = forms.CharField(
label='Password confirmation',
label=_("Password confirmation"),
widget=forms.PasswordInput,
min_length=8,
max_length=255
......@@ -203,7 +205,7 @@ class ServiceUserCreationForm(FormRevMixin, forms.ModelForm):
password1 = self.cleaned_data.get("password1")
password2 = self.cleaned_data.get("password2")
if password1 and password2 and password1 != password2:
raise forms.ValidationError("Passwords don't match")
raise forms.ValidationError(_("The passwords don't match."))
return password2
def save(self, commit=True):
......@@ -222,7 +224,7 @@ class UserChangeForm(FormRevMixin, forms.ModelForm):
Formulaire pour la modification d'un user coté admin
"""
password = ReadOnlyPasswordHashField()
is_admin = forms.BooleanField(label='is admin', required=False)
is_admin = forms.BooleanField(label=_("Is admin"), required=False)
class Meta:
model = Adherent
......@@ -231,7 +233,7 @@ class UserChangeForm(FormRevMixin, forms.ModelForm):
def __init__(self, *args, **kwargs):
prefix = kwargs.pop('prefix', self.Meta.model.__name__)
super(UserChangeForm, self).__init__(*args, prefix=prefix, **kwargs)
print("User is admin : %s" % kwargs['instance'].is_admin)
print(_("User is admin: %s") % kwargs['instance'].is_admin)
self.initial['is_admin'] = kwargs['instance'].is_admin
def clean_password(self):
......@@ -279,7 +281,7 @@ class ServiceUserChangeForm(FormRevMixin, forms.ModelForm):
class ResetPasswordForm(forms.Form):
"""Formulaire de demande de reinitialisation de mot de passe,
mdp oublié"""
pseudo = forms.CharField(label=u'Pseudo', max_length=255)
pseudo = forms.CharField(label=_("Username"), max_length=255)
email = forms.EmailField(max_length=255)
......@@ -294,8 +296,9 @@ class MassArchiveForm(forms.Form):
date = cleaned_data.get("date")
if date:
if date > timezone.now():
raise forms.ValidationError("Impossible d'archiver des\
utilisateurs dont la fin d'accès se situe dans le futur !")
raise forms.ValidationError(_("Impossible to archive users"
" whose end access date is in"
" the future."))
class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
......@@ -305,20 +308,22 @@ class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
def __init__(self, *args, **kwargs):
prefix = kwargs.pop('prefix', self.Meta.model.__name__)
super(AdherentForm, self).__init__(*args, prefix=prefix, **kwargs)
self.fields['name'].label = 'Prénom'
self.fields['surname'].label = 'Nom'
self.fields['email'].label = 'Adresse mail'
self.fields['school'].label = 'Établissement'
self.fields['comment'].label = 'Commentaire'
self.fields['room'].label = 'Chambre'
self.fields['room'].empty_label = "Pas de chambre"
self.fields['school'].empty_label = "Séléctionner un établissement"
self.fields['name'].label = _("First name")
self.fields['surname'].label = _("Surname")
self.fields['email'].label = _("Email address")
self.fields['school'].label = _("School")
self.fields['comment'].label = _("Comment")
self.fields['room'].label = _("Room")
self.fields['room'].empty_label = _("No room")
self.fields['school'].empty_label = _("Select a school")
def clean_email(self):
if not OptionalUser.objects.first().local_email_domain in self.cleaned_data.get('email'):
return self.cleaned_data.get('email').lower()
else:
raise forms.ValidationError("Vous ne pouvez pas utiliser une addresse {}".format(OptionalUser.objects.first().local_email_domain))
raise forms.ValidationError(
_("You can't use a {} address.").format(
OptionalUser.objects.first().local_email_domain))
class Meta:
model = Adherent
......@@ -342,7 +347,7 @@ class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
telephone = self.cleaned_data['telephone']
if not telephone and OptionalUser.get_cached_value('is_tel_mandatory'):
raise forms.ValidationError(
"Un numéro de téléphone valide est requis"
_("A valid telephone number is required.")
)
return telephone
......@@ -353,7 +358,7 @@ class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
return gpg_fingerprint.replace(' ', '').upper()
force = forms.BooleanField(
label="Forcer le déménagement ?",
label=_("Force the move?"),
initial=False,
required=False
)
......@@ -373,13 +378,13 @@ class ClubForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
def __init__(self, *args, **kwargs):
prefix = kwargs.pop('prefix', self.Meta.model.__name__)
super(ClubForm, self).__init__(*args, prefix=prefix, **kwargs)
self.fields['surname'].label = 'Nom'
self.fields['school'].label = 'Établissement'
self.fields['comment'].label = 'Commentaire'
self.fields['room'].label = 'Local'
self.fields['room'].empty_label = "Pas de chambre"
self.fields['school'].empty_label = "Séléctionner un établissement"
self.fields['mailing'].label = 'Utiliser une mailing'
self.fields['surname'].label = _("Name")
self.fields['school'].label = _("School")
self.fields['comment'].label = _("Comment")
self.fields['room'].label = _("Room")
self.fields['room'].empty_label = _("No room")
self.fields['school'].empty_label = _("Select a school")
self.fields['mailing'].label = _("Use a mailing list")
class Meta:
model = Club
......@@ -400,7 +405,7 @@ class ClubForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
telephone = self.cleaned_data['telephone']
if not telephone and OptionalUser.get_cached_value('is_tel_mandatory'):
raise forms.ValidationError(
"Un numéro de téléphone valide est requis"
_("A valid telephone number is required.")
)
return telephone
......@@ -436,7 +441,7 @@ class PasswordForm(FormRevMixin, ModelForm):
class ServiceUserForm(FormRevMixin, ModelForm):
""" Modification d'un service user"""
password = forms.CharField(
label=u'Nouveau mot de passe',
label=_("New password"),
max_length=255,
validators=[MinLengthValidator(8)],
widget=forms.PasswordInput,
......@@ -493,7 +498,7 @@ class GroupForm(FieldPermissionFormMixin, FormRevMixin, ModelForm):
prefix = kwargs.pop('prefix', self.Meta.model.__name__)
super(GroupForm, self).__init__(*args, prefix=prefix, **kwargs)
if 'is_superuser' in self.fields:
self.fields['is_superuser'].label = "Superuser"
self.fields['is_superuser'].label = _("Superuser")
class SchoolForm(FormRevMixin, ModelForm):
......@@ -505,7 +510,7 @@ class SchoolForm(FormRevMixin, ModelForm):
def __init__(self, *args, **kwargs):
prefix = kwargs.pop('prefix', self.Meta.model.__name__)
super(SchoolForm, self).__init__(*args, prefix=prefix, **kwargs)
self.fields['name'].label = 'Établissement'
self.fields['name'].label = _("School")
class ShellForm(FormRevMixin, ModelForm):
......@@ -517,7 +522,7 @@ class ShellForm(FormRevMixin, ModelForm):
def __init__(self, *args, **kwargs):
prefix = kwargs.pop('prefix', self.Meta.model.__name__)
super(ShellForm, self).__init__(*args, prefix=prefix, **kwargs)
self.fields['shell'].label = 'Nom du shell'
self.fields['shell'].label = _("Shell name")
class ListRightForm(FormRevMixin, ModelForm):
......@@ -536,7 +541,7 @@ class ListRightForm(FormRevMixin, ModelForm):
def __init__(self, *args, **kwargs):
prefix = kwargs.pop('prefix', self.Meta.model.__name__)
super(ListRightForm, self).__init__(*args, prefix=prefix, **kwargs)
self.fields['unix_name'].label = 'Nom UNIX du groupe'
self.fields['unix_name'].label = _("Name of the group of rights")
class NewListRightForm(ListRightForm):
......@@ -547,15 +552,15 @@ class NewListRightForm(ListRightForm):
def __init__(self, *args, **kwargs):
super(NewListRightForm, self).__init__(*args, **kwargs)
self.fields['gid'].label = ("Gid, attention, cet attribut ne doit "
"pas être modifié après création")
self.fields['gid'].label = _("GID. Warning: this field must not be"
" edited after creation.")
class DelListRightForm(Form):
"""Suppression d'un ou plusieurs groupes"""
listrights = forms.ModelMultipleChoiceField(
queryset=ListRight.objects.none(),
label="Droits actuels",
label=_("Current groups of rights"),
widget=forms.CheckboxSelectMultiple
)
......@@ -572,7 +577,7 @@ class DelSchoolForm(Form):
"""Suppression d'une ou plusieurs écoles"""
schools = forms.ModelMultipleChoiceField(
queryset=School.objects.none(),
label="Etablissements actuels",
label=_("Current schools"),
widget=forms.CheckboxSelectMultiple
)
......@@ -590,7 +595,7 @@ class BanForm(FormRevMixin, ModelForm):
def __init__(self, *args, **kwargs):
prefix = kwargs.pop('prefix', self.Meta.model.__name__)
super(BanForm, self).__init__(*args, prefix=prefix, **kwargs)
self.fields['date_end'].label = 'Date de fin'
self.fields['date_end'].label = _("End date")
self.fields['date_end'].localize = False
class Meta:
......@@ -604,7 +609,7 @@ class WhitelistForm(FormRevMixin, ModelForm):
def __init__(self, *args, **kwargs):
prefix = kwargs.pop('prefix', self.Meta.model.__name__)
super(WhitelistForm, self).__init__(*args, prefix=prefix, **kwargs)
self.fields['date_end'].label = 'Date de fin'
self.fields['date_end'].label = _("End date")
self.fields['date_end'].localize = False
class Meta:
......@@ -618,8 +623,8 @@ class EMailAddressForm(FormRevMixin, ModelForm):
def __init__(self, *args, **kwargs):
prefix = kwargs.pop('prefix', self.Meta.model.__name__)
super(EMailAddressForm, self).__init__(*args, prefix=prefix, **kwargs)
self.fields['local_part'].label = "Local part of the email"
self.fields['local_part'].help_text = "Can't contain @"
self.fields['local_part'].label = _("Local part of the email address")
self.fields['local_part'].help_text = _("Can't contain @")
def clean_local_part(self):
return self.cleaned_data.get('local_part').lower()
......@@ -634,18 +639,21 @@ class EmailSettingsForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
def __init__(self, *args, **kwargs):
prefix = kwargs.pop('prefix', self.Meta.model.__name__)
super(EmailSettingsForm, self).__init__(*args, prefix=prefix, **kwargs)
self.fields['email'].label = "Main email address"
self.fields['email'].label = _("Main email address")
if 'local_email_redirect' in self.fields:
self.fields['local_email_redirect'].label = "Redirect local emails"
self.fields['local_email_redirect'].label = _("Redirect local emails")
if 'local_email_enabled' in self.fields:
self.fields['local_email_enabled'].label = "Use local emails"
self.fields['local_email_enabled'].label = _("Use local emails")
def clean_email(self):
if not OptionalUser.objects.first().local_email_domain in self.cleaned_data.get('email'):
return self.cleaned_data.get('email').lower()
else:
raise forms.ValidationError("Vous ne pouvez pas utiliser une addresse {}".format(OptionalUser.objects.first().local_email_domain))
raise forms.ValidationError(
_("You can't use a {} address.").format(
OptionalUser.objects.first().local_email_domain))
class Meta:
model = User
fields = ['email','local_email_enabled', 'local_email_redirect']
This diff is collapsed.
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2018-08-18 11:21
from __future__ import unicode_literals
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import users.models
class Migration(migrations.Migration):
dependencies = [
('users', '0075_merge_20180815_2202'),
]
operations = [
migrations.AlterModelOptions(
name='adherent',
options={'permissions': (('change_user_password', 'Can change the password of a user'), ('change_user_state', 'Can edit the state of a user'), ('change_user_force', 'Can force the move'), ('change_user_shell', 'Can edit the shell of a user'), ('change_user_groups', 'Can edit the groups of rights of a user (critical permission)'), ('change_all_users', 'Can edit all users, including those with rights.'), ('view_user', 'Can view a user object')), 'verbose_name': 'member', 'verbose_name_plural': 'members'},
),
migrations.AlterModelOptions(
name='ban',
options={'permissions': (('view_ban', 'Can view a ban object'),), 'verbose_name': 'ban', 'verbose_name_plural': 'bans'},
),
migrations.AlterModelOptions(
name='club',
options={'permissions': (('change_user_password', 'Can change the password of a user'), ('change_user_state', 'Can edit the state of a user'), ('change_user_force', 'Can force the move'), ('change_user_shell', 'Can edit the shell of a user'), ('change_user_groups', 'Can edit the groups of rights of a user (critical permission)'), ('change_all_users', 'Can edit all users, including those with rights.'), ('view_user', 'Can view a user object')), 'verbose_name': 'club', 'verbose_name_plural': 'clubs'},
),
migrations.AlterModelOptions(
name='emailaddress',
options={'permissions': (('view_emailaddress', 'Can view a local email account object'),), 'verbose_name': 'local email account', 'verbose_name_plural': 'local email accounts'},
),
migrations.AlterModelOptions(
name='listright',
options={'permissions': (('view_listright', 'Can view a group of rights object'),), 'verbose_name': 'group of rights', 'verbose_name_plural': 'groups of rights'},
),
migrations.AlterModelOptions(
name='listshell',
options={'permissions': (('view_listshell', 'Can view a shell object'),), 'verbose_name': 'shell', 'verbose_name_plural': 'shells'},
),
migrations.AlterModelOptions(
name='school',
options={'permissions': (('view_school', 'Can view a school object'),), 'verbose_name': 'school', 'verbose_name_plural': 'schools'},
),
migrations.AlterModelOptions(
name='serviceuser',
options={'permissions': (('view_serviceuser', 'Can view a service user object'),), 'verbose_name': 'service user', 'verbose_name_plural': 'service users'},
),
migrations.AlterModelOptions(
name='user',
options={'permissions': (('change_user_password', 'Can change the password of a user'), ('change_user_state', 'Can edit the state of a user'), ('change_user_force', 'Can force the move'), ('change_user_shell', 'Can edit the shell of a user'), ('change_user_groups', 'Can edit the groups of rights of a user (critical permission)'), ('change_all_users', 'Can edit all users, including those with rights.'), ('view_user', 'Can view a user object')), 'verbose_name': 'user (member or club)', 'verbose_name_plural': 'users (members or clubs)'},
),
migrations.AlterModelOptions(
name='whitelist',
options={'permissions': (('view_whitelist', 'Can view a whitelist object'),), 'verbose_name': 'whitelist (free of charge access)', 'verbose_name_plural': 'whitelists (free of charge access)'},
),
migrations.AlterField(
model_name='adherent',
name='gpg_fingerprint',
field=models.CharField(blank=True, max_length=40, null=True, validators=[django.core.validators.RegexValidator('^[0-9A-F]{40}$', message='A GPG fingerprint must contain 40 hexadecimal characters.')]),
),
migrations.AlterField(
model_name='ban',
name='state',
field=models.IntegerField(choices=[(0, 'HARD (no access)'), (1, 'SOFT (local access only)'), (2, 'RESTRICTED (speed limitation)')], default=0),
),
migrations.AlterField(
model_name='emailaddress',
name='user',
field=models.ForeignKey(help_text='User of the local email account', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='listright',
name='unix_name',
field=models.CharField(max_length=255, unique=True, validators=[django.core.validators.RegexValidator('^[a-z]+$', message='UNIX groups can only contain lower case letters.')]),
),
migrations.AlterField(
model_name='request',
name='type',
field=models.CharField(choices=[('PW', 'Password'), ('EM', 'Email address')], max_length=2),
),
migrations.AlterField(
model_name='serviceuser',
name='comment',
field=models.CharField(blank=True, help_text='Comment', max_length=255),
),
migrations.AlterField(
model_name='serviceuser',
name='pseudo',
field=models.CharField(help_text='Must only contain letters, numerals or dashes.', max_length=32, unique=True, validators=[users.models.linux_user_validator]),
),
migrations.AlterField(
model_name='user',
name='comment',
field=models.CharField(blank=True, help_text='Comment, school year', max_length=255),
),
migrations.AlterField(
model_name='user',
name='local_email_redirect',
field=models.BooleanField(default=False, help_text='Enable redirection of the local email messages to the main email address.'),
),
migrations.AlterField(
model_name='user',
name='pseudo',
field=models.CharField(help_text='Must only contain letters, numerals or dashes.', max_length=32, unique=True, validators=[users.models.linux_user_validator]),
),
]
This diff is collapsed.
......@@ -21,8 +21,11 @@ You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
{% endcomment %}
{% load acl %}
{% load logs_extra %}
{% load i18n %}
{% if ban_list.paginator %}
{% include "pagination.html" with list=ban_list %}
{% endif %}
......@@ -30,36 +33,40 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<table class="table table-striped">
<thead>
<tr>
<th>{% include "buttons/sort.html" with prefix='ban' col="user" text="Utilisateur" %}</th>
<th>Raison</th>
<th>{% include "buttons/sort.html" with prefix='ban' col="start" text="Date de début" %}</th>
<th>{% include "buttons/sort.html" with prefix='ban' col="end" text="Date de fin" %}</th>
{% trans "User" as tr_user %}
<th>{% include "buttons/sort.html" with prefix='ban' col="user" text=tr_user %}</th>
<th>{% trans "Reason" %}</th>
{% trans "Start date" as tr_start %}
<th>{% include "buttons/sort.html" with prefix='ban' col="start" text=tr_start %}</th>
{% trans "End date" as tr_end %}
<th>{% include "buttons/sort.html" with prefix='ban' col="end" text=tr_end %}</th>
<th></th>
</tr>
</thead>
{% for ban in ban_list %}
{% if ban.is_active %}
<tr class="danger">
{% if ban.is_active %}
<tr class="danger">
{% else %}
<tr>
{% endif %}
{% endif %}
<td><a href="{% url "users:profil" ban.user.id%}" class="btn btn-primary btn-sm" role="button"><i class="fa fa-user"></i> {{ ban.user }}</a></td>
<td>{{ ban.raison }}</td>
<td>{{ ban.date_start }}</td>
<td>{{ ban.date_end }}</td>
<td class="text-right">
{% can_delete ban %}
{% include 'buttons/suppr.html' with href='users:del-ban' id=ban.id %}
{% acl_end %}
{% can_edit ban %}
{% include 'buttons/edit.html' with href='users:edit-ban' id=ban.id %}
{% acl_end %}
{% history_button ban %}
{% can_delete ban %}
{% include 'buttons/suppr.html' with href='users:del-ban' id=ban.id %}
{% acl_end %}
</td>
</tr>
{% endfor %}
{% endfor %}
</table>
{% if ban_list.paginator %}
{% include "pagination.html" with list=ban_list %}
{% endif %}
......@@ -22,6 +22,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
{% endcomment %}
{% load i18n %}
{% if clubs_list.paginator %}
{% include "pagination.html" with list=clubs_list %}
{% endif %}
......@@ -31,29 +33,35 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<table class="table table-striped">
<thead>
<tr>
<th>{% include "buttons/sort.html" with prefix='club' col="surname" text="Nom" %}</th>
<th>{% include "buttons/sort.html" with prefix='club' col="pseudo" text="Pseudo" %}</th>
<th>{% include "buttons/sort.html" with prefix='club' col="room" text="Chambre" %}</th>
<th>Fin de cotisation le</th>
<th>Connexion</th>
<th>Profil</th>
{% trans "Name" as tr_name %}
<th>{% include "buttons/sort.html" with prefix='club' col="surname" text=tr_name %}</th>
{% trans "Username" as tr_username %}
<th>{% include "buttons/sort.html" with prefix='club' col="pseudo" text=tr_username %}</th>
{% trans "Room" as tr_room %}
<th>{% include "buttons/sort.html" with prefix='club' col="room" text=tr_room %}</th>
<th>{% trans "End of subscription on" %}</th>
<th>{% trans "Internet access" %}</th>
<th>{% trans "Profile" %}</th>
</tr>
</thead>
{% for club in clubs_list %}
{% can_view club %}
<tr>
<td>{{ club.surname }}</td>
<td>{{ club.pseudo }}</td>
<td>{{ club.room }}</td>
<td>{% if club.is_adherent %}{{ club.end_adhesion }}{% else %}Non adhérent{% endif %}</td>
<td>{% if club.has_access == True %}
<i class="text-success">Active</i>
{% else %}
<i class="text-danger">Désactivée</i>
{% endif %}
</td>
<td><a href="{% url "users:profil" club.id%}" class="btn btn-primary btn-sm" role="button"><i class="fa fa-user"></i></a>
</td>
<tr>
<td>{{ club.surname }}</td>
<td>{{ club.pseudo }}</td>
<td>{{ club.room }}</td>
<td>{% if club.is_adherent %}{{ club.end_adhesion }}{% else %}{% trans "Not a member" %}{% endif %}</td>
<td>{% if club.has_access == True %}
<i class="text-success">{% trans "Active" %}</i>
{% else %}
<i class="text-danger">{% trans "Disabled" %}</i>
{% endif %}
</td>
<td>
<a href="{% url "users:profil" club.id%}" class="btn btn-primary btn-sm" role="button">
<i class="fa fa-user"></i>
</a>
</td>
</tr>
{% acl_end %}
{% endfor %}
......@@ -62,3 +70,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if clubs_list.paginator %}
{% include "pagination.html" with list=clubs_list %}
{% endif %}
......@@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load acl %}
{% load i18n %}
{% load logs_extra %}
{% if emailaddress_list.paginator %}
......@@ -32,20 +33,20 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<table class="table table-striped">