Merge branch 'beta' into 'master'

Multiples fix, réparation des pots

Closes #75

See merge request bde/nk20!186
This commit is contained in:
ynerant 2021-10-05 12:02:03 +02:00
commit ca2b9f061c
17 changed files with 161 additions and 130 deletions

View File

@ -1,6 +0,0 @@
---
note:
server_name: note-beta.crans.org
git_branch: beta
cron_enabled: false
email: notekfet2020@lists.crans.org

View File

@ -2,5 +2,6 @@
note: note:
server_name: note-dev.crans.org server_name: note-dev.crans.org
git_branch: beta git_branch: beta
serve_static: false
cron_enabled: false cron_enabled: false
email: notekfet2020@lists.crans.org email: notekfet2020@lists.crans.org

View File

@ -2,5 +2,6 @@
note: note:
server_name: note.crans.org server_name: note.crans.org
git_branch: master git_branch: master
serve_static: true
cron_enabled: true cron_enabled: true
email: notekfet2020@lists.crans.org email: notekfet2020@lists.crans.org

View File

@ -1,6 +1,5 @@
[dev] [dev]
bde-note-dev.adh.crans.org bde-note-dev.adh.crans.org
bde-nk20-beta.adh.crans.org
[prod] [prod]
bde-note.adh.crans.org bde-note.adh.crans.org

View File

@ -41,6 +41,7 @@ server {
# max upload size # max upload size
client_max_body_size 75M; # adjust to taste client_max_body_size 75M; # adjust to taste
{% if note.serve_static %}
# Django media # Django media
location /media { location /media {
alias /var/www/note_kfet/media; # your Django project's media files - amend as required alias /var/www/note_kfet/media; # your Django project's media files - amend as required
@ -50,6 +51,7 @@ server {
alias /var/www/note_kfet/static; # your Django project's static files - amend as required alias /var/www/note_kfet/static; # your Django project's static files - amend as required
} }
{% endif %}
location /doc { location /doc {
alias /var/www/documentation; # The documentation of the project alias /var/www/documentation; # The documentation of the project
} }

View File

@ -28,6 +28,12 @@ class ActivityForm(forms.ModelForm):
shuffle(clubs) shuffle(clubs)
self.fields["organizer"].widget.attrs["placeholder"] = ", ".join(club.name for club in clubs[:4]) + ", ..." self.fields["organizer"].widget.attrs["placeholder"] = ", ".join(club.name for club in clubs[:4]) + ", ..."
def clean_organizer(self):
organizer = self.cleaned_data['organizer']
if not organizer.note.is_active:
self.add_error('organiser', _('The note of this club is inactive.'))
return organizer
def clean_date_end(self): def clean_date_end(self):
date_end = self.cleaned_data["date_end"] date_end = self.cleaned_data["date_end"]
date_start = self.cleaned_data["date_start"] date_start = self.cleaned_data["date_start"]

View File

@ -63,7 +63,12 @@ SPDX-License-Identifier: GPL-3.0-or-later
refreshBalance(); refreshBalance();
} }
alias_obj.keyup(reloadTable); alias_obj.keyup(function(event) {
let code = event.originalEvent.keyCode
if (65 <= code <= 122 || code === 13) {
debounce(reloadTable)()
}
});
$(document).ready(init); $(document).ready(init);

View File

@ -66,8 +66,8 @@ class ActivityListView(ProtectQuerysetMixin, LoginRequiredMixin, SingleTableView
ordering = ('-date_start',) ordering = ('-date_start',)
extra_context = {"title": _("Activities")} extra_context = {"title": _("Activities")}
def get_queryset(self): def get_queryset(self, **kwargs):
return super().get_queryset().distinct() return super().get_queryset(**kwargs).distinct()
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs) context = super().get_context_data(**kwargs)
@ -78,9 +78,7 @@ class ActivityListView(ProtectQuerysetMixin, LoginRequiredMixin, SingleTableView
prefix='upcoming-', prefix='upcoming-',
) )
started_activities = Activity.objects\ started_activities = self.get_queryset().filter(open=True, valid=True).distinct().all()
.filter(PermissionBackend.filter_queryset(self.request, Activity, "view"))\
.filter(open=True, valid=True).all()
context["started_activities"] = started_activities context["started_activities"] = started_activities
return context return context
@ -145,7 +143,7 @@ class ActivityInviteView(ProtectQuerysetMixin, ProtectedCreateView):
def get_form(self, form_class=None): def get_form(self, form_class=None):
form = super().get_form(form_class) form = super().get_form(form_class)
form.activity = Activity.objects.filter(PermissionBackend.filter_queryset(self.request, Activity, "view"))\ form.activity = Activity.objects.filter(PermissionBackend.filter_queryset(self.request, Activity, "view"))\
.get(pk=self.kwargs["pk"]) .filter(pk=self.kwargs["pk"]).first()
form.fields["inviter"].initial = self.request.user.note form.fields["inviter"].initial = self.request.user.note
return form return form
@ -192,7 +190,7 @@ class ActivityEntryView(LoginRequiredMixin, TemplateView):
.annotate(balance=F("inviter__balance"), note_name=F("inviter__user__username"))\ .annotate(balance=F("inviter__balance"), note_name=F("inviter__user__username"))\
.filter(activity=activity)\ .filter(activity=activity)\
.filter(PermissionBackend.filter_queryset(self.request, Guest, "view"))\ .filter(PermissionBackend.filter_queryset(self.request, Guest, "view"))\
.order_by('last_name', 'first_name').distinct() .order_by('last_name', 'first_name')
if "search" in self.request.GET and self.request.GET["search"]: if "search" in self.request.GET and self.request.GET["search"]:
pattern = self.request.GET["search"] pattern = self.request.GET["search"]
@ -206,7 +204,7 @@ class ActivityEntryView(LoginRequiredMixin, TemplateView):
) )
else: else:
guest_qs = guest_qs.none() guest_qs = guest_qs.none()
return guest_qs return guest_qs.distinct()
def get_invited_note(self, activity): def get_invited_note(self, activity):
""" """

View File

@ -19,8 +19,8 @@ def create_bde_and_kfet(apps, schema_editor):
membership_fee_paid=500, membership_fee_paid=500,
membership_fee_unpaid=500, membership_fee_unpaid=500,
membership_duration=396, membership_duration=396,
membership_start="2020-08-01", membership_start="2021-08-01",
membership_end="2021-09-30", membership_end="2022-09-30",
) )
Club.objects.get_or_create( Club.objects.get_or_create(
id=2, id=2,
@ -31,8 +31,8 @@ def create_bde_and_kfet(apps, schema_editor):
membership_fee_paid=3500, membership_fee_paid=3500,
membership_fee_unpaid=3500, membership_fee_unpaid=3500,
membership_duration=396, membership_duration=396,
membership_start="2020-08-01", membership_start="2021-08-01",
membership_end="2021-09-30", membership_end="2022-09-30",
) )
NoteClub.objects.get_or_create( NoteClub.objects.get_or_create(

View File

@ -413,6 +413,12 @@ class Membership(models.Model):
""" """
Calculate fee and end date before saving the membership and creating the transaction if needed. Calculate fee and end date before saving the membership and creating the transaction if needed.
""" """
# Ensure that club membership dates are valid
old_membership_start = self.club.membership_start
self.club.update_membership_dates()
if self.club.membership_start != old_membership_start:
self.club.save()
created = not self.pk created = not self.pk
if not created: if not created:
for role in self.roles.all(): for role in self.roles.all():

View File

@ -31,7 +31,8 @@ class ClubTable(tables.Table):
row_attrs = { row_attrs = {
'class': 'table-row', 'class': 'table-row',
'id': lambda record: "row-" + str(record.pk), 'id': lambda record: "row-" + str(record.pk),
'data-href': lambda record: record.pk 'data-href': lambda record: record.pk,
'style': 'cursor:pointer',
} }
@ -74,7 +75,8 @@ class UserTable(tables.Table):
model = User model = User
row_attrs = { row_attrs = {
'class': 'table-row', 'class': 'table-row',
'data-href': lambda record: record.pk 'data-href': lambda record: record.pk,
'style': 'cursor:pointer',
} }

View File

@ -222,6 +222,13 @@ $(document).ready(function () {
}) })
}) })
// Make transfer when pressing Enter on the amount section
$('#amount, #reason, #last_name, #first_name, #bank').keypress((event) => {
if (event.originalEvent.charCode === 13) {
$('#btn_transfer').click()
}
})
$('#btn_transfer').click(function () { $('#btn_transfer').click(function () {
if (LOCK) { return } if (LOCK) { return }
@ -348,14 +355,14 @@ $('#btn_transfer').click(function () {
destination_alias: dest.name destination_alias: dest.name
}).done(function () { }).done(function () {
addMsg(interpolate(gettext('Transfer of %s from %s to %s failed: %s'), addMsg(interpolate(gettext('Transfer of %s from %s to %s failed: %s'),
[pretty_money(source.quantity * dest.quantity * amount), source.name, + dest.name, gettext('insufficient funds')]), 'danger', 10000) [pretty_money(source.quantity * dest.quantity * amount), source.name, dest.name, gettext('insufficient funds')]), 'danger', 10000)
reset() reset()
}).fail(function (err) { }).fail(function (err) {
const errObj = JSON.parse(err.responseText) const errObj = JSON.parse(err.responseText)
let error = errObj.detail ? errObj.detail : errObj.non_field_errors let error = errObj.detail ? errObj.detail : errObj.non_field_errors
if (!error) { error = err.responseText } if (!error) { error = err.responseText }
addMsg(interpolate(gettext('Transfer of %s from %s to %s failed: %s'), addMsg(interpolate(gettext('Transfer of %s from %s to %s failed: %s'),
[pretty_money(source.quantity * dest.quantity * amount), source.name, + dest.name, error]), 'danger') [pretty_money(source.quantity * dest.quantity * amount), source.name, dest.name, error]), 'danger')
LOCK = false LOCK = false
}) })
}) })

View File

@ -111,12 +111,12 @@
"note", "note",
"alias" "alias"
], ],
"query": "[\"AND\", [\"OR\", {\"note__noteuser__user__memberships__club__name\": \"Kfet\", \"note__noteuser__user__memberships__date_start__lte\": [\"today\"], \"note__noteuser__user__memberships__date_end__gte\": [\"today\"]}, {\"note__noteclub__isnull\": false}], {\"note__is_active\": true}]", "query": "[\"AND\", [\"OR\", {\"note__noteuser__user__memberships__club__name\": \"BDE\", \"note__noteuser__user__memberships__date_start__lte\": [\"today\"], \"note__noteuser__user__memberships__date_end__gte\": [\"today\"]}, {\"note__noteclub__isnull\": false}], {\"note__is_active\": true}]",
"type": "view", "type": "view",
"mask": 1, "mask": 1,
"field": "", "field": "",
"permanent": false, "permanent": false,
"description": "Voir les aliases des notes des clubs et des adhérents du club Kfet" "description": "Voir les aliases des notes des clubs et des adhérents du club BDE"
} }
}, },
{ {
@ -3048,6 +3048,7 @@
31, 31,
32, 32,
33, 33,
43,
51, 51,
53, 53,
54, 54,

View File

@ -46,8 +46,8 @@ class SignUpForm(UserCreationForm):
class DeclareSogeAccountOpenedForm(forms.Form): class DeclareSogeAccountOpenedForm(forms.Form):
soge_account = forms.BooleanField( soge_account = forms.BooleanField(
label=_("I declare that I opened or I will open soon a bank account in the Société générale with the BDE \ label=_("I declare that I opened or I will open soon a bank account in the Société générale with the BDE "
partnership."), "partnership."),
help_text=_("Warning: this engages you to open your bank account. If you finally decides to don't open your " help_text=_("Warning: this engages you to open your bank account. If you finally decides to don't open your "
"account, you will have to pay the BDE membership."), "account, you will have to pay the BDE membership."),
required=False, required=False,

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-09-13 23:26+0200\n" "POT-Creation-Date: 2021-09-28 17:02+0200\n"
"PO-Revision-Date: 2020-11-16 20:02+0000\n" "PO-Revision-Date: 2020-11-16 20:02+0000\n"
"Last-Translator: Yohann D'ANELLO <ynerant@crans.org>\n" "Last-Translator: Yohann D'ANELLO <ynerant@crans.org>\n"
"Language-Team: French <http://translate.ynerant.fr/projects/nk20/nk20/fr/>\n" "Language-Team: French <http://translate.ynerant.fr/projects/nk20/nk20/fr/>\n"
@ -23,28 +23,32 @@ msgstr ""
msgid "activity" msgid "activity"
msgstr "activité" msgstr "activité"
#: apps/activity/forms.py:35 apps/activity/models.py:132 #: apps/activity/forms.py:34
msgid "The note of this club is inactive."
msgstr "La note du club est inactive."
#: apps/activity/forms.py:41 apps/activity/models.py:132
msgid "The end date must be after the start date." msgid "The end date must be after the start date."
msgstr "La date de fin doit être après celle de début." msgstr "La date de fin doit être après celle de début."
#: apps/activity/forms.py:76 apps/activity/models.py:270 #: apps/activity/forms.py:82 apps/activity/models.py:270
msgid "You can't invite someone once the activity is started." msgid "You can't invite someone once the activity is started."
msgstr "" msgstr ""
"Vous ne pouvez pas inviter quelqu'un une fois que l'activité a démarré." "Vous ne pouvez pas inviter quelqu'un une fois que l'activité a démarré."
#: apps/activity/forms.py:79 apps/activity/models.py:273 #: apps/activity/forms.py:85 apps/activity/models.py:273
msgid "This activity is not validated yet." msgid "This activity is not validated yet."
msgstr "Cette activité n'est pas encore validée." msgstr "Cette activité n'est pas encore validée."
#: apps/activity/forms.py:89 apps/activity/models.py:281 #: apps/activity/forms.py:95 apps/activity/models.py:281
msgid "This person has been already invited 5 times this year." msgid "This person has been already invited 5 times this year."
msgstr "Cette personne a déjà été invitée 5 fois cette année." msgstr "Cette personne a déjà été invitée 5 fois cette année."
#: apps/activity/forms.py:93 apps/activity/models.py:285 #: apps/activity/forms.py:99 apps/activity/models.py:285
msgid "This person is already invited." msgid "This person is already invited."
msgstr "Cette personne est déjà invitée." msgstr "Cette personne est déjà invitée."
#: apps/activity/forms.py:97 apps/activity/models.py:289 #: apps/activity/forms.py:103 apps/activity/models.py:289
msgid "You can't invite more than 3 people to this activity." msgid "You can't invite more than 3 people to this activity."
msgstr "Vous ne pouvez pas inviter plus de 3 personnes à cette activité." msgstr "Vous ne pouvez pas inviter plus de 3 personnes à cette activité."
@ -195,7 +199,7 @@ msgstr "Entrée de la note {note} pour l'activité « {activity} »"
msgid "Already entered on " msgid "Already entered on "
msgstr "Déjà rentré le " msgstr "Déjà rentré le "
#: apps/activity/models.py:202 apps/activity/tables.py:54 #: apps/activity/models.py:202 apps/activity/tables.py:56
msgid "{:%Y-%m-%d %H:%M:%S}" msgid "{:%Y-%m-%d %H:%M:%S}"
msgstr "{:%d/%m/%Y %H:%M:%S}" msgstr "{:%d/%m/%Y %H:%M:%S}"
@ -234,48 +238,48 @@ msgstr "invités"
msgid "Invitation" msgid "Invitation"
msgstr "Invitation" msgstr "Invitation"
#: apps/activity/tables.py:25 #: apps/activity/tables.py:27
msgid "The activity is currently open." msgid "The activity is currently open."
msgstr "Cette activité est actuellement ouverte." msgstr "Cette activité est actuellement ouverte."
#: apps/activity/tables.py:26 #: apps/activity/tables.py:28
msgid "The validation of the activity is pending." msgid "The validation of the activity is pending."
msgstr "La validation de cette activité est en attente." msgstr "La validation de cette activité est en attente."
#: apps/activity/tables.py:41 apps/treasury/tables.py:107 #: apps/activity/tables.py:43 apps/treasury/tables.py:107
msgid "Remove" msgid "Remove"
msgstr "Supprimer" msgstr "Supprimer"
#: apps/activity/tables.py:54 #: apps/activity/tables.py:56
msgid "Entered on " msgid "Entered on "
msgstr "Entré le " msgstr "Entré le "
#: apps/activity/tables.py:56 #: apps/activity/tables.py:58
msgid "remove" msgid "remove"
msgstr "supprimer" msgstr "supprimer"
#: apps/activity/tables.py:80 apps/note/forms.py:68 apps/treasury/models.py:199 #: apps/activity/tables.py:82 apps/note/forms.py:68 apps/treasury/models.py:199
msgid "Type" msgid "Type"
msgstr "Type" msgstr "Type"
#: apps/activity/tables.py:82 apps/member/forms.py:186 #: apps/activity/tables.py:84 apps/member/forms.py:186
#: apps/registration/forms.py:90 apps/treasury/forms.py:131 #: apps/registration/forms.py:91 apps/treasury/forms.py:131
#: apps/wei/forms/registration.py:104 #: apps/wei/forms/registration.py:104
msgid "Last name" msgid "Last name"
msgstr "Nom de famille" msgstr "Nom de famille"
#: apps/activity/tables.py:84 apps/member/forms.py:191 #: apps/activity/tables.py:86 apps/member/forms.py:191
#: apps/note/templates/note/transaction_form.html:134 #: apps/note/templates/note/transaction_form.html:138
#: apps/registration/forms.py:95 apps/treasury/forms.py:133 #: apps/registration/forms.py:96 apps/treasury/forms.py:133
#: apps/wei/forms/registration.py:109 #: apps/wei/forms/registration.py:109
msgid "First name" msgid "First name"
msgstr "Prénom" msgstr "Prénom"
#: apps/activity/tables.py:86 apps/note/models/notes.py:86 #: apps/activity/tables.py:88 apps/note/models/notes.py:86
msgid "Note" msgid "Note"
msgstr "Note" msgstr "Note"
#: apps/activity/tables.py:88 apps/member/tables.py:49 #: apps/activity/tables.py:90 apps/member/tables.py:49
msgid "Balance" msgid "Balance"
msgstr "Solde du compte" msgstr "Solde du compte"
@ -289,26 +293,26 @@ msgstr "Invité supprimé"
#: apps/activity/templates/activity/activity_entry.html:14 #: apps/activity/templates/activity/activity_entry.html:14
#: apps/note/models/transactions.py:257 #: apps/note/models/transactions.py:257
#: apps/note/templates/note/transaction_form.html:16 #: apps/note/templates/note/transaction_form.html:17
#: apps/note/templates/note/transaction_form.html:148 #: apps/note/templates/note/transaction_form.html:152
#: note_kfet/templates/base.html:73 #: note_kfet/templates/base.html:73
msgid "Transfer" msgid "Transfer"
msgstr "Virement" msgstr "Virement"
#: apps/activity/templates/activity/activity_entry.html:18 #: apps/activity/templates/activity/activity_entry.html:18
#: apps/note/models/transactions.py:317 #: apps/note/models/transactions.py:317
#: apps/note/templates/note/transaction_form.html:21 #: apps/note/templates/note/transaction_form.html:22
msgid "Credit" msgid "Credit"
msgstr "Crédit" msgstr "Crédit"
#: apps/activity/templates/activity/activity_entry.html:21 #: apps/activity/templates/activity/activity_entry.html:21
#: apps/note/models/transactions.py:317 #: apps/note/models/transactions.py:317
#: apps/note/templates/note/transaction_form.html:25 #: apps/note/templates/note/transaction_form.html:26
msgid "Debit" msgid "Debit"
msgstr "Débit" msgstr "Débit"
#: apps/activity/templates/activity/activity_entry.html:27 #: apps/activity/templates/activity/activity_entry.html:27
#: apps/note/templates/note/transaction_form.html:30 #: apps/note/templates/note/transaction_form.html:34
msgid "Entries" msgid "Entries"
msgstr "Entrées" msgstr "Entrées"
@ -548,20 +552,20 @@ msgstr "Cette image ne peut pas être chargée."
msgid "An alias with a similar name already exists." msgid "An alias with a similar name already exists."
msgstr "Un alias avec un nom similaire existe déjà." msgstr "Un alias avec un nom similaire existe déjà."
#: apps/member/forms.py:165 apps/registration/forms.py:70 #: apps/member/forms.py:165 apps/registration/forms.py:71
msgid "Inscription paid by Société Générale" msgid "Inscription paid by Société Générale"
msgstr "Inscription payée par la Société générale" msgstr "Inscription payée par la Société générale"
#: apps/member/forms.py:167 apps/registration/forms.py:72 #: apps/member/forms.py:167 apps/registration/forms.py:73
msgid "Check this case if the Société Générale paid the inscription." msgid "Check this case if the Société Générale paid the inscription."
msgstr "Cochez cette case si la Société Générale a payé l'inscription." msgstr "Cochez cette case si la Société Générale a payé l'inscription."
#: apps/member/forms.py:172 apps/registration/forms.py:77 #: apps/member/forms.py:172 apps/registration/forms.py:78
#: apps/wei/forms/registration.py:91 #: apps/wei/forms/registration.py:91
msgid "Credit type" msgid "Credit type"
msgstr "Type de rechargement" msgstr "Type de rechargement"
#: apps/member/forms.py:173 apps/registration/forms.py:78 #: apps/member/forms.py:173 apps/registration/forms.py:79
#: apps/wei/forms/registration.py:92 #: apps/wei/forms/registration.py:92
msgid "No credit" msgid "No credit"
msgstr "Pas de rechargement" msgstr "Pas de rechargement"
@ -570,13 +574,13 @@ msgstr "Pas de rechargement"
msgid "You can credit the note of the user." msgid "You can credit the note of the user."
msgstr "Vous pouvez créditer la note de l'utilisateur avant l'adhésion." msgstr "Vous pouvez créditer la note de l'utilisateur avant l'adhésion."
#: apps/member/forms.py:179 apps/registration/forms.py:83 #: apps/member/forms.py:179 apps/registration/forms.py:84
#: apps/wei/forms/registration.py:97 #: apps/wei/forms/registration.py:97
msgid "Credit amount" msgid "Credit amount"
msgstr "Montant à créditer" msgstr "Montant à créditer"
#: apps/member/forms.py:196 apps/note/templates/note/transaction_form.html:140 #: apps/member/forms.py:196 apps/note/templates/note/transaction_form.html:144
#: apps/registration/forms.py:100 apps/treasury/forms.py:135 #: apps/registration/forms.py:101 apps/treasury/forms.py:135
#: apps/wei/forms/registration.py:114 #: apps/wei/forms/registration.py:114
msgid "Bank" msgid "Bank"
msgstr "Banque" msgstr "Banque"
@ -1192,7 +1196,7 @@ msgstr "Modifier le club"
msgid "Add new member to the club" msgid "Add new member to the club"
msgstr "Ajouter un nouveau membre au club" msgstr "Ajouter un nouveau membre au club"
#: apps/member/views.py:642 apps/wei/views.py:956 #: apps/member/views.py:642 apps/wei/views.py:973
msgid "" msgid ""
"This user don't have enough money to join this club, and can't have a " "This user don't have enough money to join this club, and can't have a "
"negative balance." "negative balance."
@ -1247,7 +1251,7 @@ msgstr "Source"
msgid "Destination" msgid "Destination"
msgstr "Destination" msgstr "Destination"
#: apps/note/forms.py:74 apps/note/templates/note/transaction_form.html:119 #: apps/note/forms.py:74 apps/note/templates/note/transaction_form.html:123
msgid "Reason" msgid "Reason"
msgstr "Raison" msgstr "Raison"
@ -1498,8 +1502,8 @@ msgstr ""
"mode de paiement et un utilisateur ou un club" "mode de paiement et un utilisateur ou un club"
#: apps/note/models/transactions.py:355 apps/note/models/transactions.py:358 #: apps/note/models/transactions.py:355 apps/note/models/transactions.py:358
#: apps/note/models/transactions.py:361 apps/wei/views.py:961 #: apps/note/models/transactions.py:361 apps/wei/views.py:978
#: apps/wei/views.py:965 #: apps/wei/views.py:982
msgid "This field is required." msgid "This field is required."
msgstr "Ce champ est requis." msgstr "Ce champ est requis."
@ -1553,7 +1557,7 @@ msgid "Edit"
msgstr "Éditer" msgstr "Éditer"
#: apps/note/templates/note/conso_form.html:22 #: apps/note/templates/note/conso_form.html:22
#: apps/note/templates/note/transaction_form.html:44 #: apps/note/templates/note/transaction_form.html:48
msgid "Please select a note" msgid "Please select a note"
msgstr "Sélectionnez une note" msgstr "Sélectionnez une note"
@ -1562,8 +1566,8 @@ msgid "Consum"
msgstr "Consommer" msgstr "Consommer"
#: apps/note/templates/note/conso_form.html:43 #: apps/note/templates/note/conso_form.html:43
#: apps/note/templates/note/transaction_form.html:65 #: apps/note/templates/note/transaction_form.html:69
#: apps/note/templates/note/transaction_form.html:92 #: apps/note/templates/note/transaction_form.html:96
msgid "Name or alias..." msgid "Name or alias..."
msgstr "Pseudo ou alias ..." msgstr "Pseudo ou alias ..."
@ -1588,7 +1592,7 @@ msgid "Double consumptions"
msgstr "Consommations doubles" msgstr "Consommations doubles"
#: apps/note/templates/note/conso_form.html:154 #: apps/note/templates/note/conso_form.html:154
#: apps/note/templates/note/transaction_form.html:159 #: apps/note/templates/note/transaction_form.html:163
msgid "Recent transactions history" msgid "Recent transactions history"
msgstr "Historique des transactions récentes" msgstr "Historique des transactions récentes"
@ -1603,45 +1607,45 @@ msgstr "Historique des transactions récentes"
msgid "Mail generated by the Note Kfet on the" msgid "Mail generated by the Note Kfet on the"
msgstr "Mail généré par la Note Kfet le" msgstr "Mail généré par la Note Kfet le"
#: apps/note/templates/note/transaction_form.html:54 #: apps/note/templates/note/transaction_form.html:58
#: apps/note/templates/note/transaction_form.html:174 #: apps/note/templates/note/transaction_form.html:178
msgid "Select emitters" msgid "Select emitters"
msgstr "Sélection des émetteurs" msgstr "Sélection des émetteurs"
#: apps/note/templates/note/transaction_form.html:69 #: apps/note/templates/note/transaction_form.html:73
msgid "I am the emitter" msgid "I am the emitter"
msgstr "Je suis l'émetteur" msgstr "Je suis l'émetteur"
#: apps/note/templates/note/transaction_form.html:81 #: apps/note/templates/note/transaction_form.html:85
#: apps/note/templates/note/transaction_form.html:176 #: apps/note/templates/note/transaction_form.html:180
msgid "Select receivers" msgid "Select receivers"
msgstr "Sélection des destinataires" msgstr "Sélection des destinataires"
#: apps/note/templates/note/transaction_form.html:104 #: apps/note/templates/note/transaction_form.html:108
msgid "Action" msgid "Action"
msgstr "Action" msgstr "Action"
#: apps/note/templates/note/transaction_form.html:112 #: apps/note/templates/note/transaction_form.html:116
#: apps/treasury/forms.py:137 apps/treasury/tables.py:67 #: apps/treasury/forms.py:137 apps/treasury/tables.py:67
#: apps/treasury/tables.py:132 #: apps/treasury/tables.py:132
#: apps/treasury/templates/treasury/remittance_form.html:23 #: apps/treasury/templates/treasury/remittance_form.html:23
msgid "Amount" msgid "Amount"
msgstr "Montant" msgstr "Montant"
#: apps/note/templates/note/transaction_form.html:128 #: apps/note/templates/note/transaction_form.html:132
#: apps/treasury/models.py:54 #: apps/treasury/models.py:54
msgid "Name" msgid "Name"
msgstr "Nom" msgstr "Nom"
#: apps/note/templates/note/transaction_form.html:173 #: apps/note/templates/note/transaction_form.html:177
msgid "Select emitter" msgid "Select emitter"
msgstr "Sélection de l'émetteur" msgstr "Sélection de l'émetteur"
#: apps/note/templates/note/transaction_form.html:175 #: apps/note/templates/note/transaction_form.html:179
msgid "Select receiver" msgid "Select receiver"
msgstr "Sélection du destinataire" msgstr "Sélection du destinataire"
#: apps/note/templates/note/transaction_form.html:177 #: apps/note/templates/note/transaction_form.html:181
msgid "Transfer type" msgid "Transfer type"
msgstr "Type de transfert" msgstr "Type de transfert"
@ -1913,13 +1917,13 @@ msgstr "Cet email est déjà pris."
#: apps/registration/forms.py:49 #: apps/registration/forms.py:49
msgid "" msgid ""
"I declare that I opened or I will open soon a bank account in the Société générale with the BDE " "I declare that I opened or I will open soon a bank account in the Société "
"partnership." "générale with the BDE partnership."
msgstr "" msgstr ""
"Je déclare avoir ouvert ou ouvrir prochainement un compte à la société générale avec le partenariat " "Je déclare avoir ouvert ou ouvrir prochainement un compte à la société "
"du BDE." "générale avec le partenariat du BDE."
#: apps/registration/forms.py:50 #: apps/registration/forms.py:51
msgid "" msgid ""
"Warning: this engages you to open your bank account. If you finally decides " "Warning: this engages you to open your bank account. If you finally decides "
"to don't open your account, you will have to pay the BDE membership." "to don't open your account, you will have to pay the BDE membership."
@ -1927,11 +1931,11 @@ msgstr ""
"Attention : cocher cette case vous engage à ouvrir votre compte. Si vous " "Attention : cocher cette case vous engage à ouvrir votre compte. Si vous "
"décidez de ne pas le faire, vous devrez payer l'adhésion au BDE." "décidez de ne pas le faire, vous devrez payer l'adhésion au BDE."
#: apps/registration/forms.py:58 #: apps/registration/forms.py:59
msgid "Register to the WEI" msgid "Register to the WEI"
msgstr "S'inscrire au WEI" msgstr "S'inscrire au WEI"
#: apps/registration/forms.py:60 #: apps/registration/forms.py:61
msgid "" msgid ""
"Check this case if you want to register to the WEI. If you hesitate, you " "Check this case if you want to register to the WEI. If you hesitate, you "
"will be able to register later, after validating your account in the Kfet." "will be able to register later, after validating your account in the Kfet."
@ -1940,11 +1944,11 @@ msgstr ""
"pourrez toujours vous inscrire plus tard, après avoir validé votre compte à " "pourrez toujours vous inscrire plus tard, après avoir validé votre compte à "
"la Kfet." "la Kfet."
#: apps/registration/forms.py:105 #: apps/registration/forms.py:106
msgid "Join BDE Club" msgid "Join BDE Club"
msgstr "Adhérer au club BDE" msgstr "Adhérer au club BDE"
#: apps/registration/forms.py:112 #: apps/registration/forms.py:113
msgid "Join Kfet Club" msgid "Join Kfet Club"
msgstr "Adhérer au club Kfet" msgstr "Adhérer au club Kfet"
@ -2244,7 +2248,7 @@ msgstr "proxys de transactions spéciales"
msgid "credit transaction" msgid "credit transaction"
msgstr "transaction de crédit" msgstr "transaction de crédit"
#: apps/treasury/models.py:419 #: apps/treasury/models.py:430
msgid "" msgid ""
"This user doesn't have enough money to pay the memberships with its note. " "This user doesn't have enough money to pay the memberships with its note. "
"Please ask her/him to credit the note before invalidating this credit." "Please ask her/him to credit the note before invalidating this credit."
@ -2252,16 +2256,16 @@ msgstr ""
"Cet utilisateur n'a pas assez d'argent pour payer les adhésions avec sa " "Cet utilisateur n'a pas assez d'argent pour payer les adhésions avec sa "
"note. Merci de lui demander de recharger sa note avant d'invalider ce crédit." "note. Merci de lui demander de recharger sa note avant d'invalider ce crédit."
#: apps/treasury/models.py:439 #: apps/treasury/models.py:451
#: apps/treasury/templates/treasury/sogecredit_detail.html:10 #: apps/treasury/templates/treasury/sogecredit_detail.html:10
msgid "Credit from the Société générale" msgid "Credit from the Société générale"
msgstr "Crédit de la Société générale" msgstr "Crédit de la Société générale"
#: apps/treasury/models.py:440 #: apps/treasury/models.py:452
msgid "Credits from the Société générale" msgid "Credits from the Société générale"
msgstr "Crédits de la Société générale" msgstr "Crédits de la Société générale"
#: apps/treasury/models.py:443 #: apps/treasury/models.py:455
#, python-brace-format #, python-brace-format
msgid "Soge credit for {user}" msgid "Soge credit for {user}"
msgstr "Crédit de la société générale pour l'utilisateur {user}" msgstr "Crédit de la société générale pour l'utilisateur {user}"
@ -2559,7 +2563,7 @@ msgstr "Sélectionnez les rôles qui vous intéressent."
msgid "This team doesn't belong to the given bus." msgid "This team doesn't belong to the given bus."
msgstr "Cette équipe n'appartient pas à ce bus." msgstr "Cette équipe n'appartient pas à ce bus."
#: apps/wei/forms/surveys/wei2021.py:31 #: apps/wei/forms/surveys/wei2021.py:35
msgid "Choose a word:" msgid "Choose a word:"
msgstr "Choisissez un mot :" msgstr "Choisissez un mot :"
@ -2804,11 +2808,11 @@ msgstr "Prix du WEI (étudiants)"
msgid "WEI list" msgid "WEI list"
msgstr "Liste des WEI" msgstr "Liste des WEI"
#: apps/wei/templates/wei/base.html:81 apps/wei/views.py:523 #: apps/wei/templates/wei/base.html:81 apps/wei/views.py:528
msgid "Register 1A" msgid "Register 1A"
msgstr "Inscrire un 1A" msgstr "Inscrire un 1A"
#: apps/wei/templates/wei/base.html:85 apps/wei/views.py:603 #: apps/wei/templates/wei/base.html:85 apps/wei/views.py:614
msgid "Register 2A+" msgid "Register 2A+"
msgstr "Inscrire un 2A+" msgstr "Inscrire un 2A+"
@ -2837,8 +2841,8 @@ msgstr "Télécharger au format PDF"
#: apps/wei/templates/wei/survey.html:11 #: apps/wei/templates/wei/survey.html:11
#: apps/wei/templates/wei/survey_closed.html:11 #: apps/wei/templates/wei/survey_closed.html:11
#: apps/wei/templates/wei/survey_end.html:11 apps/wei/views.py:1011 #: apps/wei/templates/wei/survey_end.html:11 apps/wei/views.py:1028
#: apps/wei/views.py:1066 apps/wei/views.py:1076 #: apps/wei/views.py:1083 apps/wei/views.py:1093
msgid "Survey WEI" msgid "Survey WEI"
msgstr "Questionnaire WEI" msgstr "Questionnaire WEI"
@ -2883,7 +2887,7 @@ msgstr "Inscriptions non validées"
msgid "Attribute buses" msgid "Attribute buses"
msgstr "Répartition dans les bus" msgstr "Répartition dans les bus"
#: apps/wei/templates/wei/weiclub_list.html:14 apps/wei/views.py:78 #: apps/wei/templates/wei/weiclub_list.html:14 apps/wei/views.py:79
msgid "Create WEI" msgid "Create WEI"
msgstr "Créer un WEI" msgstr "Créer un WEI"
@ -3020,67 +3024,67 @@ msgstr "Il n'y a pas de pré-inscription en attente avec cette entrée."
msgid "View validated memberships..." msgid "View validated memberships..."
msgstr "Voir les adhésions validées ..." msgstr "Voir les adhésions validées ..."
#: apps/wei/views.py:57 #: apps/wei/views.py:58
msgid "Search WEI" msgid "Search WEI"
msgstr "Chercher un WEI" msgstr "Chercher un WEI"
#: apps/wei/views.py:108 #: apps/wei/views.py:109
msgid "WEI Detail" msgid "WEI Detail"
msgstr "Détails du WEI" msgstr "Détails du WEI"
#: apps/wei/views.py:203 #: apps/wei/views.py:208
msgid "View members of the WEI" msgid "View members of the WEI"
msgstr "Voir les membres du WEI" msgstr "Voir les membres du WEI"
#: apps/wei/views.py:231 #: apps/wei/views.py:236
msgid "Find WEI Membership" msgid "Find WEI Membership"
msgstr "Trouver une adhésion au WEI" msgstr "Trouver une adhésion au WEI"
#: apps/wei/views.py:241 #: apps/wei/views.py:246
msgid "View registrations to the WEI" msgid "View registrations to the WEI"
msgstr "Voir les inscriptions au WEI" msgstr "Voir les inscriptions au WEI"
#: apps/wei/views.py:265 #: apps/wei/views.py:270
msgid "Find WEI Registration" msgid "Find WEI Registration"
msgstr "Trouver une inscription au WEI" msgstr "Trouver une inscription au WEI"
#: apps/wei/views.py:276 #: apps/wei/views.py:281
msgid "Update the WEI" msgid "Update the WEI"
msgstr "Modifier le WEI" msgstr "Modifier le WEI"
#: apps/wei/views.py:297 #: apps/wei/views.py:302
msgid "Create new bus" msgid "Create new bus"
msgstr "Ajouter un nouveau bus" msgstr "Ajouter un nouveau bus"
#: apps/wei/views.py:335 #: apps/wei/views.py:340
msgid "Update bus" msgid "Update bus"
msgstr "Modifier le bus" msgstr "Modifier le bus"
#: apps/wei/views.py:367 #: apps/wei/views.py:372
msgid "Manage bus" msgid "Manage bus"
msgstr "Gérer le bus" msgstr "Gérer le bus"
#: apps/wei/views.py:394 #: apps/wei/views.py:399
msgid "Create new team" msgid "Create new team"
msgstr "Créer une nouvelle équipe" msgstr "Créer une nouvelle équipe"
#: apps/wei/views.py:434 #: apps/wei/views.py:439
msgid "Update team" msgid "Update team"
msgstr "Modifier l'équipe" msgstr "Modifier l'équipe"
#: apps/wei/views.py:465 #: apps/wei/views.py:470
msgid "Manage WEI team" msgid "Manage WEI team"
msgstr "Gérer l'équipe WEI" msgstr "Gérer l'équipe WEI"
#: apps/wei/views.py:487 #: apps/wei/views.py:492
msgid "Register first year student to the WEI" msgid "Register first year student to the WEI"
msgstr "Inscrire un 1A au WEI" msgstr "Inscrire un 1A au WEI"
#: apps/wei/views.py:545 apps/wei/views.py:638 #: apps/wei/views.py:550 apps/wei/views.py:649
msgid "This user is already registered to this WEI." msgid "This user is already registered to this WEI."
msgstr "Cette personne est déjà inscrite au WEI." msgstr "Cette personne est déjà inscrite au WEI."
#: apps/wei/views.py:550 #: apps/wei/views.py:555
msgid "" msgid ""
"This user can't be in her/his first year since he/she has already " "This user can't be in her/his first year since he/she has already "
"participated to a WEI." "participated to a WEI."
@ -3088,35 +3092,35 @@ msgstr ""
"Cet utilisateur ne peut pas être en première année puisqu'il a déjà " "Cet utilisateur ne peut pas être en première année puisqu'il a déjà "
"participé à un WEI." "participé à un WEI."
#: apps/wei/views.py:567 #: apps/wei/views.py:578
msgid "Register old student to the WEI" msgid "Register old student to the WEI"
msgstr "Inscrire un 2A+ au WEI" msgstr "Inscrire un 2A+ au WEI"
#: apps/wei/views.py:622 apps/wei/views.py:704 #: apps/wei/views.py:633 apps/wei/views.py:721
msgid "You already opened an account in the Société générale." msgid "You already opened an account in the Société générale."
msgstr "Vous avez déjà ouvert un compte auprès de la société générale." msgstr "Vous avez déjà ouvert un compte auprès de la société générale."
#: apps/wei/views.py:668 #: apps/wei/views.py:685
msgid "Update WEI Registration" msgid "Update WEI Registration"
msgstr "Modifier l'inscription WEI" msgstr "Modifier l'inscription WEI"
#: apps/wei/views.py:778 #: apps/wei/views.py:795
msgid "Delete WEI registration" msgid "Delete WEI registration"
msgstr "Supprimer l'inscription WEI" msgstr "Supprimer l'inscription WEI"
#: apps/wei/views.py:789 #: apps/wei/views.py:806
msgid "You don't have the right to delete this WEI registration." msgid "You don't have the right to delete this WEI registration."
msgstr "Vous n'avez pas la permission de supprimer cette inscription au WEI." msgstr "Vous n'avez pas la permission de supprimer cette inscription au WEI."
#: apps/wei/views.py:807 #: apps/wei/views.py:824
msgid "Validate WEI registration" msgid "Validate WEI registration"
msgstr "Valider l'inscription WEI" msgstr "Valider l'inscription WEI"
#: apps/wei/views.py:1169 #: apps/wei/views.py:1186
msgid "Attribute buses to first year members" msgid "Attribute buses to first year members"
msgstr "Répartir les 1A dans les bus" msgstr "Répartir les 1A dans les bus"
#: apps/wei/views.py:1191 #: apps/wei/views.py:1211
msgid "Attribute bus" msgid "Attribute bus"
msgstr "Attribuer un bus" msgstr "Attribuer un bus"
@ -3266,6 +3270,10 @@ msgstr ""
msgid "Contact us" msgid "Contact us"
msgstr "Nous contacter" msgstr "Nous contacter"
#: note_kfet/templates/base.html:197
msgid "Technical Support"
msgstr "Support technique"
#: note_kfet/templates/base_search.html:15 #: note_kfet/templates/base_search.html:15
msgid "Search by attribute such as name…" msgid "Search by attribute such as name…"
msgstr "Chercher par un attribut tel que le nom …" msgstr "Chercher par un attribut tel que le nom …"

View File

@ -7,8 +7,8 @@
* @returns {string} * @returns {string}
*/ */
function pretty_money (value) { function pretty_money (value) {
if (value % 100 === 0) { return (value < 0 ? '- ' : '') + Math.round(Math.abs(value) / 100) + ' €' } else { if (value % 100 === 0) { return (value < 0 ? '- ' : '') + Math.floor(Math.abs(value) / 100) + ' €' } else {
return (value < 0 ? '- ' : '') + Math.round(Math.abs(value) / 100) + '.' + return (value < 0 ? '- ' : '') + Math.floor(Math.abs(value) / 100) + '.' +
(Math.abs(value) % 100 < 10 ? '0' : '') + (Math.abs(value) % 100) + ' €' (Math.abs(value) % 100 < 10 ? '0' : '') + (Math.abs(value) % 100) + ' €'
} }
} }
@ -381,11 +381,11 @@ function de_validate (id, validated, resourcetype) {
* @param callback Function to call * @param callback Function to call
* @param wait Debounced milliseconds * @param wait Debounced milliseconds
*/ */
function debounce (callback, wait) { let debounce_timeout
let timeout function debounce (callback, wait=500) {
return (...args) => { return (...args) => {
const context = this const context = this
clearTimeout(timeout) clearTimeout(debounce_timeout)
timeout = setTimeout(() => callback.apply(context, args), wait) debounce_timeout = setTimeout(() => callback.apply(context, args), wait)
} }
} }

View File

@ -35,8 +35,9 @@ urlpatterns = [
path('coffee/', include('django_htcpcp_tea.urls')), path('coffee/', include('django_htcpcp_tea.urls')),
] ]
# During development, serve media files # During development, serve static and media files
if settings.DEBUG: if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
if "oauth2_provider" in settings.INSTALLED_APPS: if "oauth2_provider" in settings.INSTALLED_APPS: