one mail per speaker from talks list

This commit is contained in:
Élie Bouttier 2017-12-16 16:43:45 +01:00
parent 277f54c0b8
commit 9c7cbf5ae9
4 changed files with 99 additions and 77 deletions

View File

@ -178,12 +178,20 @@ class TalkFilterForm(forms.Form):
class TalkActionForm(forms.Form): class TalkActionForm(forms.Form):
EMAIL_TALKS = 1
EMAIL_SPEAKERS = 2
EMAIL_CHOICES = (
(None, "---------"),
(EMAIL_TALKS, _('one per speaker and talk combination')),
(EMAIL_SPEAKERS, _('only one per speaker')),
)
talks = forms.MultipleChoiceField(choices=[]) talks = forms.MultipleChoiceField(choices=[])
decision = forms.NullBooleanField(label=_('Accept talk?')) decision = forms.NullBooleanField(label=_('Accept talk?'))
track = forms.ChoiceField(required=False, choices=[], label=_('Assign to a track')) track = forms.ChoiceField(required=False, choices=[], label=_('Assign to a track'))
tag = forms.ChoiceField(required=False, choices=[], label=_('Add a tag')) tag = forms.ChoiceField(required=False, choices=[], label=_('Add a tag'))
room = forms.ChoiceField(required=False, choices=[], label=_('Put in a room')) room = forms.ChoiceField(required=False, choices=[], label=_('Put in a room'))
email = forms.BooleanField(required=False, label=_('Send a email')) email = forms.ChoiceField(required=False, choices=EMAIL_CHOICES, label=_('Send an email'))
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
site = kwargs.pop('site') site = kwargs.pop('site')
@ -200,7 +208,7 @@ class TalkActionForm(forms.Form):
class SpeakerActionForm(forms.Form): class SpeakerActionForm(forms.Form):
speakers = forms.MultipleChoiceField(choices=[]) speakers = forms.MultipleChoiceField(choices=[])
email = forms.BooleanField(required=False, label=_('Send a email')) email = forms.BooleanField(required=False, label=_('Send an email'))
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
speakers = kwargs.pop('speakers') speakers = kwargs.pop('speakers')

View File

@ -645,9 +645,16 @@ def talk_list(request):
if data['room']: if data['room']:
talk.room = Room.objects.get(site=request.conference.site, slug=data['room']) talk.room = Room.objects.get(site=request.conference.site, slug=data['room'])
talk.save() talk.save()
if data['email']: email = int(data['email'])
request.session['talk-email-list'] = data['talks'] if email:
return redirect(reverse('talk-email')) if email == TalkActionForm.EMAIL_TALKS:
request.session['talk-email-list'] = data['talks']
return redirect(reverse('talk-email'))
elif email == TalkActionForm.EMAIL_SPEAKERS:
selected_talks = Talk.objects.filter(pk__in=data['talks'])
speakers = Participant.objects.filter(pk__in=selected_talks.values('speakers__pk')).distinct()
request.session['speaker-email-list'] = list(speakers.values_list('pk', flat=True))
return redirect(reverse('speaker-email'))
return redirect(request.get_full_path()) return redirect(request.get_full_path())
# Sorting # Sorting
if request.GET.get('order') == 'desc': if request.GET.get('order') == 'desc':

Binary file not shown.

View File

@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-16 12:20+0000\n" "POT-Creation-Date: 2017-12-16 15:41+0000\n"
"PO-Revision-Date: 2017-12-16 13:22+0100\n" "PO-Revision-Date: 2017-12-16 16:42+0100\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: fr\n" "Language: fr\n"
@ -16,7 +16,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 2.0.4\n" "X-Generator: Poedit 2.0.5\n"
#: accounts/forms.py:20 #: accounts/forms.py:20
msgid "Email address" msgid "Email address"
@ -124,7 +124,7 @@ msgstr "Corps :"
msgid "Pending decision" msgid "Pending decision"
msgstr "Décision en attente" msgstr "Décision en attente"
#: cfp/forms.py:19 cfp/forms.py:126 cfp/forms.py:234 #: cfp/forms.py:19 cfp/forms.py:126 cfp/forms.py:242
msgid "Accepted" msgid "Accepted"
msgstr "Accepté" msgstr "Accepté"
@ -136,7 +136,7 @@ msgstr "Décliné"
msgid "Waiting" msgid "Waiting"
msgstr "En attente" msgstr "En attente"
#: cfp/forms.py:30 cfp/forms.py:132 cfp/forms.py:240 cfp/models.py:379 #: cfp/forms.py:30 cfp/forms.py:132 cfp/forms.py:248 cfp/models.py:379
msgid "Confirmed" msgid "Confirmed"
msgstr "Confirmé" msgstr "Confirmé"
@ -158,7 +158,7 @@ msgstr "Aucune"
msgid "Default duration: %(duration)d min" msgid "Default duration: %(duration)d min"
msgstr "Durée par défaut : %(duration)d min" msgstr "Durée par défaut : %(duration)d min"
#: cfp/forms.py:108 cfp/forms.py:120 cfp/forms.py:228 #: cfp/forms.py:108 cfp/forms.py:120 cfp/forms.py:236
#: cfp/templates/cfp/staff/talk_details.html:15 #: cfp/templates/cfp/staff/talk_details.html:15
msgid "Category" msgid "Category"
msgstr "Catégorie" msgstr "Catégorie"
@ -184,7 +184,7 @@ msgstr "Notes"
msgid "Visible by speakers" msgid "Visible by speakers"
msgstr "Visible par les orateurs" msgstr "Visible par les orateurs"
#: cfp/forms.py:138 cfp/forms.py:246 cfp/models.py:335 #: cfp/forms.py:138 cfp/forms.py:254 cfp/models.py:335
#: cfp/templates/cfp/staff/talk_details.html:21 #: cfp/templates/cfp/staff/talk_details.html:21
#: cfp/templates/cfp/staff/talk_list.html:58 #: cfp/templates/cfp/staff/talk_list.html:58
#: cfp/templates/cfp/staff/track_form.html:14 #: cfp/templates/cfp/staff/track_form.html:14
@ -241,52 +241,60 @@ msgstr "Vidéo"
msgid "Filter talks with / without video" msgid "Filter talks with / without video"
msgstr "Filtrer les exposés avec / sans vidéo" msgstr "Filtrer les exposés avec / sans vidéo"
#: cfp/forms.py:176 cfp/forms.py:258 #: cfp/forms.py:176 cfp/forms.py:266
msgid "Not assigned" msgid "Not assigned"
msgstr "Pas encore assignée" msgstr "Pas encore assignée"
#: cfp/forms.py:182 #: cfp/forms.py:185
msgid "one per speaker and talk combination"
msgstr "un pour chaque couple intervenant / exposé"
#: cfp/forms.py:186
msgid "only one per speaker"
msgstr "uniquement un par intervenant"
#: cfp/forms.py:190
msgid "Accept talk?" msgid "Accept talk?"
msgstr "Accepter la proposition ?" msgstr "Accepter la proposition ?"
#: cfp/forms.py:183 #: cfp/forms.py:191
msgid "Assign to a track" msgid "Assign to a track"
msgstr "Assigner à une session" msgstr "Assigner à une session"
#: cfp/forms.py:184 cfp/templates/cfp/admin/tag_list.html:11 #: cfp/forms.py:192 cfp/templates/cfp/admin/tag_list.html:11
msgid "Add a tag" msgid "Add a tag"
msgstr "Ajouter une étiquette" msgstr "Ajouter une étiquette"
#: cfp/forms.py:185 #: cfp/forms.py:193
msgid "Put in a room" msgid "Put in a room"
msgstr "Assigner à une salle" msgstr "Assigner à une salle"
#: cfp/forms.py:186 cfp/forms.py:203 #: cfp/forms.py:194 cfp/forms.py:211
msgid "Send a email" msgid "Send an email"
msgstr "Envoyer un e-mail" msgstr "Envoyer un e-mail"
#: cfp/forms.py:212 #: cfp/forms.py:220
msgid "Notify by mail?" msgid "Notify by mail?"
msgstr "Notifier par e-mail ?" msgstr "Notifier par e-mail ?"
#: cfp/forms.py:262 cfp/models.py:486 #: cfp/forms.py:270 cfp/models.py:486
#: cfp/templates/cfp/staff/volunteer_list.html:30 #: cfp/templates/cfp/staff/volunteer_list.html:30
msgid "Email" msgid "Email"
msgstr "E-mail" msgstr "E-mail"
#: cfp/forms.py:268 cfp/forms.py:274 #: cfp/forms.py:276 cfp/forms.py:282
msgid "Subject" msgid "Subject"
msgstr "Sujet" msgstr "Sujet"
#: cfp/forms.py:269 cfp/forms.py:275 #: cfp/forms.py:277 cfp/forms.py:283
msgid "Body" msgid "Body"
msgstr "Corps" msgstr "Corps"
#: cfp/forms.py:281 cfp/forms.py:309 #: cfp/forms.py:289 cfp/forms.py:317
msgid "I read my self twice, confirm sending" msgid "I read my self twice, confirm sending"
msgstr "Je me suis relu 2 fois, confirmer lenvoi" msgstr "Je me suis relu 2 fois, confirmer lenvoi"
#: cfp/forms.py:301 #: cfp/forms.py:309
#, python-format #, python-format
msgid "" msgid ""
"Your template does not compile (at least) with talk '%(talk)s' and speaker " "Your template does not compile (at least) with talk '%(talk)s' and speaker "
@ -295,23 +303,23 @@ msgstr ""
"Vos gabarits ne compile pas avec (au moins) lexposé « %(talk)s » et " "Vos gabarits ne compile pas avec (au moins) lexposé « %(talk)s » et "
"lintervenant « %(speaker)s »." "lintervenant « %(speaker)s »."
#: cfp/forms.py:328 #: cfp/forms.py:336
#, python-format #, python-format
msgid "Your template does not compile (at least) with speaker '%(speaker)s'." msgid "Your template does not compile (at least) with speaker '%(speaker)s'."
msgstr "" msgstr ""
"Vos gabarits ne compile pas avec (au moins) lintervenant « %(speaker)s »." "Vos gabarits ne compile pas avec (au moins) lintervenant « %(speaker)s »."
#: cfp/forms.py:349 #: cfp/forms.py:357
msgid "New staff members will be informed of their new position by e-mail." msgid "New staff members will be informed of their new position by e-mail."
msgstr "" msgstr ""
"Les nouveaux membres du staff seront informés de leur nouveau rôle par " "Les nouveaux membres du staff seront informés de leur nouveau rôle par "
"courrier électronique." "courrier électronique."
#: cfp/forms.py:375 #: cfp/forms.py:383
msgid "An user with that firstname and that lastname already exists." msgid "An user with that firstname and that lastname already exists."
msgstr "Un utilisateur avec ce prénom et ce nom existe déjà." msgstr "Un utilisateur avec ce prénom et ce nom existe déjà."
#: cfp/forms.py:380 #: cfp/forms.py:388
msgid "A user with that email already exists." msgid "A user with that email already exists."
msgstr "Un utilisateur avec cet email existe déjà." msgstr "Un utilisateur avec cet email existe déjà."
@ -648,35 +656,6 @@ msgstr ""
"Si vous avez déjà soumis une proposition et que vous souhaitez léditer, " "Si vous avez déjà soumis une proposition et que vous souhaitez léditer, "
"cliquez <a href=\"%(mail_token_url)s\">ici</a>." "cliquez <a href=\"%(mail_token_url)s\">ici</a>."
#: cfp/templates/cfp/mails/speaker_send_token.txt:1
msgid ""
"Hi {},\n"
"\n"
"Someone, probably you, ask to access your profile.\n"
"You can edit your talks or add new ones following this url:\n"
"\n"
" {}\n"
"\n"
"If you have any question, your can answer to this email.\n"
"\n"
"Sincerely,\n"
"\n"
"{}\n"
msgstr ""
"Bonjour {},\n"
"\n"
"Quelquun, sans doute vous, a demandé à accéder à votre profil.\n"
"Vous pouvez modifier vos propositions ou en soumettre de nouvelles à lurl "
"suivante :\n"
"\n"
" {}\n"
"\n"
"Si vous avez une question, vous pouvez répondre à ce mail.\n"
"\n"
"Sincèrement,\n"
"\n"
"{}\n"
#: cfp/templates/cfp/mails/volunteer_send_token.txt:1 #: cfp/templates/cfp/mails/volunteer_send_token.txt:1
#, python-format #, python-format
msgid "" msgid ""
@ -804,7 +783,7 @@ msgid "you must confirm you participation"
msgstr "vous devez confirmer votre participation" msgstr "vous devez confirmer votre participation"
#: cfp/templates/cfp/proposal_dashboard.html:61 cfp/views.py:626 #: cfp/templates/cfp/proposal_dashboard.html:61 cfp/views.py:626
#: cfp/views.py:751 #: cfp/views.py:758
msgid "accepted" msgid "accepted"
msgstr "accepté" msgstr "accepté"
@ -1638,69 +1617,69 @@ msgstr "Lexposé a été %(action)s."
msgid "[%(conference)s] The talk '%(talk)s' have been %(action)s." msgid "[%(conference)s] The talk '%(talk)s' have been %(action)s."
msgstr "[%(conference)s] Lexposé « %(talk)s » a été %(action)s." msgstr "[%(conference)s] Lexposé « %(talk)s » a été %(action)s."
#: cfp/views.py:628 cfp/views.py:753 #: cfp/views.py:628 cfp/views.py:760
msgid "declined" msgid "declined"
msgstr "décliné" msgstr "décliné"
#: cfp/views.py:629 cfp/views.py:777 #: cfp/views.py:629 cfp/views.py:784
#, python-format #, python-format
msgid "The talk has been %(action)s." msgid "The talk has been %(action)s."
msgstr "Lexposé a été %(action)s." msgstr "Lexposé a été %(action)s."
#: cfp/views.py:633 cfp/views.py:772 #: cfp/views.py:633 cfp/views.py:779
#, python-format #, python-format
msgid "[%(conference)s] The talk '%(talk)s' have been %(action)s" msgid "[%(conference)s] The talk '%(talk)s' have been %(action)s"
msgstr "[%(conference)s] Lexposé « %(talk)s » a été %(action)s" msgstr "[%(conference)s] Lexposé « %(talk)s » a été %(action)s"
#: cfp/views.py:710 #: cfp/views.py:717
#, python-format #, python-format
msgid "[%(conference)s] New comment about '%(talk)s'" msgid "[%(conference)s] New comment about '%(talk)s'"
msgstr "[%(conference)s] Nouveau commentaire sur « %(talk)s »" msgstr "[%(conference)s] Nouveau commentaire sur « %(talk)s »"
#: cfp/views.py:724 cfp/views.py:898 #: cfp/views.py:731 cfp/views.py:905
msgid "Message sent!" msgid "Message sent!"
msgstr "Message envoyé !" msgstr "Message envoyé !"
#: cfp/views.py:740 #: cfp/views.py:747
msgid "Vote successfully created" msgid "Vote successfully created"
msgstr "A voté !" msgstr "A voté !"
#: cfp/views.py:740 #: cfp/views.py:747
msgid "Vote successfully updated" msgid "Vote successfully updated"
msgstr "Vote mis à jour" msgstr "Vote mis à jour"
#: cfp/views.py:761 #: cfp/views.py:768
#, python-format #, python-format
msgid "[%(conference)s] Your talk '%(talk)s' have been %(action)s" msgid "[%(conference)s] Your talk '%(talk)s' have been %(action)s"
msgstr "[%(conference)s] Votre exposé « %(talk)s » a été %(action)s" msgstr "[%(conference)s] Votre exposé « %(talk)s » a été %(action)s"
#: cfp/views.py:779 #: cfp/views.py:786
msgid "Decision taken in account" msgid "Decision taken in account"
msgstr "Décision enregistrée" msgstr "Décision enregistrée"
#: cfp/views.py:792 #: cfp/views.py:799
msgid "Please select some talks." msgid "Please select some talks."
msgstr "Veuillez sélectionner un ou plusieurs exposés." msgstr "Veuillez sélectionner un ou plusieurs exposés."
#: cfp/views.py:801 cfp/views.py:969 #: cfp/views.py:808 cfp/views.py:976
#, python-format #, python-format
msgid "%(count)d mails have been sent." msgid "%(count)d mails have been sent."
msgstr "%(count)d e-mails ont été envoyés." msgstr "%(count)d e-mails ont été envoyés."
#: cfp/views.py:805 cfp/views.py:973 #: cfp/views.py:812 cfp/views.py:980
#, python-format #, python-format
msgid "Your ready to send %(count)d emails." msgid "Your ready to send %(count)d emails."
msgstr "Vous êtes prêt pour envoyer %(count)d e-mails." msgstr "Vous êtes prêt pour envoyer %(count)d e-mails."
#: cfp/views.py:960 #: cfp/views.py:967
msgid "Please select some speakers." msgid "Please select some speakers."
msgstr "Veuillez sélectionner un ou plusieurs intervenants." msgstr "Veuillez sélectionner un ou plusieurs intervenants."
#: cfp/views.py:1005 #: cfp/views.py:1012
msgid "[{}] You have been added to the staff team" msgid "[{}] You have been added to the staff team"
msgstr "[{}] Vous avez été ajouté aux membres du staff" msgstr "[{}] Vous avez été ajouté aux membres du staff"
#: cfp/views.py:1006 #: cfp/views.py:1013
msgid "" msgid ""
"Hi {},\n" "Hi {},\n"
"\n" "\n"
@ -1724,15 +1703,15 @@ msgstr ""
"{}\n" "{}\n"
"\n" "\n"
#: cfp/views.py:1027 cfp/views.py:1039 #: cfp/views.py:1034 cfp/views.py:1046
msgid "Modifications successfully saved." msgid "Modifications successfully saved."
msgstr "Modification enregistrée avec succès." msgstr "Modification enregistrée avec succès."
#: cfp/views.py:1203 #: cfp/views.py:1210
msgid "User created successfully." msgid "User created successfully."
msgstr "Utilisateur créé avec succès." msgstr "Utilisateur créé avec succès."
#: cfp/views.py:1224 #: cfp/views.py:1231
#, python-format #, python-format
msgid "Format '%s' not available" msgid "Format '%s' not available"
msgstr "Format '%s' non disponible" msgstr "Format '%s' non disponible"
@ -1806,6 +1785,34 @@ msgstr "Mot de passe oublié ?"
msgid "Password Change" msgid "Password Change"
msgstr "Changement de mot de passe" msgstr "Changement de mot de passe"
#~ msgid ""
#~ "Hi {},\n"
#~ "\n"
#~ "Someone, probably you, ask to access your profile.\n"
#~ "You can edit your talks or add new ones following this url:\n"
#~ "\n"
#~ " {}\n"
#~ "\n"
#~ "If you have any question, your can answer to this email.\n"
#~ "\n"
#~ "Sincerely,\n"
#~ "\n"
#~ "{}\n"
#~ msgstr ""
#~ "Bonjour {},\n"
#~ "\n"
#~ "Quelquun, sans doute vous, a demandé à accéder à votre profil.\n"
#~ "Vous pouvez modifier vos propositions ou en soumettre de nouvelles à "
#~ "lurl suivante :\n"
#~ "\n"
#~ " {}\n"
#~ "\n"
#~ "Si vous avez une question, vous pouvez répondre à ce mail.\n"
#~ "\n"
#~ "Sincèrement,\n"
#~ "\n"
#~ "{}\n"
#~ msgid "There is an error in your content template." #~ msgid "There is an error in your content template."
#~ msgstr "Il y a une erreur dans le gabarit du corps." #~ msgstr "Il y a une erreur dans le gabarit du corps."