mirror of
https://github.com/ae-utbm/sith.git
synced 2026-11-20 16:09:54 +00:00
Make ClubRole.name translatable
This commit is contained in:
1 parent
aab5cc178e
commit
884940af30
8 files changed
+167
-23
No files matched your search
+15
-2
@@ -302,12 +302,22 @@ class ClubRoleForm(forms.ModelForm):
|
||||
|
||||
class Meta:
|
||||
model = ClubRole
|
||||
fields = ["name", "description", "is_presidency", "is_board", "is_active"]
|
||||
fields = [
|
||||
"name",
|
||||
"name_en",
|
||||
"description",
|
||||
"is_presidency",
|
||||
"is_board",
|
||||
"is_active",
|
||||
]
|
||||
widgets = {
|
||||
"is_presidency": forms.HiddenInput(),
|
||||
"is_board": forms.HiddenInput(),
|
||||
"is_active": forms.CheckboxInput(attrs={"class": "switch"}),
|
||||
}
|
||||
help_texts = {
|
||||
"name_en": _("Provide an english name for non-french speaking users.")
|
||||
}
|
||||
|
||||
def clean(self):
|
||||
cleaned_data = super().clean()
|
||||
@@ -354,7 +364,10 @@ class ClubRoleCreateForm(forms.ModelForm):
|
||||
|
||||
class Meta:
|
||||
model = ClubRole
|
||||
fields = ["name", "description"]
|
||||
fields = ["name", "name_en", "description"]
|
||||
help_texts = {
|
||||
"name_en": _("Provide an english name for non-french speaking users.")
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self, *args, club: Club, is_presidency: bool, is_board: bool, **kwargs
|
||||
|
||||
Reference in new issue
Block a user