message to speakers when accepting/refusing a talk

This commit is contained in:
Élie Bouttier 2017-08-02 12:44:44 +02:00
parent 3a5fc2bb12
commit 9a6472bcf7
4 changed files with 53 additions and 42 deletions

View File

@ -11,16 +11,13 @@
<b>{% trans "Title:" %}</b> {{ talk.title }}<br /> <b>{% trans "Title:" %}</b> {{ talk.title }}<br />
<b>{% trans "Kind:" %}</b> {{ talk.category }}<br /> <b>{% trans "Kind:" %}</b> {{ talk.category }}<br />
<br /> <h3>{% trans "Information for the proposer" %}</h3>
{% comment %}<h3>{% trans "Information for the proposer" %}</h3>{% endcomment %}
<form method="post"> <form method="post">
{% csrf_token %} {% csrf_token %}
{% comment %}
<div class="form-group"> <div class="form-group">
<label for="message">{% trans "If you want to send a message to the proposer, please enter it below. Remember to indicate which talk your message is reffering." %}</label> <label for="message">{% trans "If you want to send a message to the proposer, please enter it below. Remember to indicate which talk your message is reffering." %}</label>
<textarea name="message" class="form-control" rows="5"></textarea> <textarea name="message" class="form-control" rows="5"></textarea>
</div> </div>
{% endcomment %}
<button type="submit" class="btn btn-{% if accept %}success{% else %}danger{% endif %}">{% if accept %}{% trans "Accept the proposal" %}{% else %}{% trans "Decline the proposal" %}{% endif %}</button> <button type="submit" class="btn btn-{% if accept %}success{% else %}danger{% endif %}">{% if accept %}{% trans "Accept the proposal" %}{% else %}{% trans "Decline the proposal" %}{% endif %}</button>
<a class="btn btn-default" href="{% url 'talk-details' talk.token %}">{% trans "Cancel" %}</a> <a class="btn btn-default" href="{% url 'talk-details' talk.token %}">{% trans "Cancel" %}</a>
</form> </form>

View File

@ -235,19 +235,17 @@ def talk_vote(request, conference, talk_id, score):
def talk_decide(request, conference, talk_id, accept): def talk_decide(request, conference, talk_id, accept):
talk = get_object_or_404(Talk, token=talk_id, site=conference.site) talk = get_object_or_404(Talk, token=talk_id, site=conference.site)
if request.method == 'POST': if request.method == 'POST':
# # Does we need to send a notification to the proposer? # Does we need to send a notification to the proposer?
# m = request.POST.get('message', '').strip() m = request.POST.get('message', '').strip()
# if m: if m:
# participation = Participation.objects.get(site=site, user=talk.proposer) for participant in talk.speakers.all():
# conversation = ConversationWithParticipant.objects.get(participation=participation) Message.objects.create(thread=talk.conversation, author=request.user, content=m)
# Message.objects.create(conversation=conversation, author=request.user, content=m) # Save the decision in the talk's conversation
# # Save the decision in the talk's conversation
# conversation = ConversationAboutTalk.objects.get(talk=talk)
if accept: if accept:
note = "The talk has been accepted." note = _("The talk has been accepted.")
else: else:
note = "The talk has been declined." note = _("The talk has been declined.")
#Message.objects.create(conversation=conversation, author=request.user, content=note) Message.objects.create(thread=talk.conversation, author=request.user, content=note)
talk.accepted = accept talk.accepted = accept
talk.save() talk.save()
messages.success(request, _('Decision taken in account')) messages.success(request, _('Decision taken in account'))

Binary file not shown.

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-08-02 00:42+0000\n" "POT-Creation-Date: 2017-08-02 10:44+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -216,7 +216,7 @@ msgstr "Envoyer"
#: accounts/templates/accounts/profile.html:36 #: accounts/templates/accounts/profile.html:36
#: cfp/templates/cfp/staff/create_user.html:14 #: cfp/templates/cfp/staff/create_user.html:14
#: cfp/templates/cfp/staff/talk_decide.html:27 ponyconf/templates/_form.html:16 #: cfp/templates/cfp/staff/talk_decide.html:22 ponyconf/templates/_form.html:16
#: proposals/templates/proposals/talk_decide.html:23 #: proposals/templates/proposals/talk_decide.html:23
msgid "Cancel" msgid "Cancel"
msgstr "Annuler" msgstr "Annuler"
@ -473,16 +473,17 @@ msgstr "Jai besoin de son"
msgid "Duration (min)" msgid "Duration (min)"
msgstr "Durée (min)" msgstr "Durée (min)"
#: cfp/signals.py:50 #: cfp/signals.py:78
#, python-format #, python-format
msgid "[%(prefix)s] Message from the staff" msgid "[%(prefix)s] Message from the staff"
msgstr "[%(prefix)s] Message du staff" msgstr "[%(prefix)s] Message du staff"
#: cfp/signals.py:51 #: cfp/signals.py:79
#, python-format
msgid "[%(prefix)s] Conversation with %(dest)s" msgid "[%(prefix)s] Conversation with %(dest)s"
msgstr "[%(prefix)s] Conversation avec %(dest)s" msgstr "[%(prefix)s] Conversation avec %(dest)s"
#: cfp/signals.py:62 #: cfp/signals.py:93
#, python-format #, python-format
msgid "[%(prefix)s] Talk: %(talk)s" msgid "[%(prefix)s] Talk: %(talk)s"
msgstr "[%(prefix)s] Talk: %(talk)s" msgstr "[%(prefix)s] Talk: %(talk)s"
@ -686,12 +687,27 @@ msgstr "Titre :"
msgid "Kind:" msgid "Kind:"
msgstr "Type dintervention :" msgstr "Type dintervention :"
#: cfp/templates/cfp/staff/talk_decide.html:26 #: cfp/templates/cfp/staff/talk_decide.html:14
#: proposals/templates/proposals/talk_decide.html:15
msgid "Information for the proposer"
msgstr "Information à destination de lauteur de la proposition"
#: cfp/templates/cfp/staff/talk_decide.html:18
#: proposals/templates/proposals/talk_decide.html:19
msgid ""
"If you want to send a message to the proposer, please enter it below. "
"Remember to indicate which talk your message is reffering."
msgstr ""
"Si vous souhaitez envoyer un message à lauteur de la proposition, saisissez-"
"le ci-dessous. Noubliez pas de spécifier à quelle proposition "
"dintervention votre message fait référence."
#: cfp/templates/cfp/staff/talk_decide.html:21
#: proposals/templates/proposals/talk_decide.html:22 #: proposals/templates/proposals/talk_decide.html:22
msgid "Accept the proposal" msgid "Accept the proposal"
msgstr "Accepter la proposition" msgstr "Accepter la proposition"
#: cfp/templates/cfp/staff/talk_decide.html:26 #: cfp/templates/cfp/staff/talk_decide.html:21
#: proposals/templates/proposals/talk_decide.html:22 #: proposals/templates/proposals/talk_decide.html:22
msgid "Decline the proposal" msgid "Decline the proposal"
msgstr "Décliner la proposition" msgstr "Décliner la proposition"
@ -822,27 +838,35 @@ msgstr ""
"{}\n" "{}\n"
"\n" "\n"
#: cfp/views.py:215 cfp/views.py:276 conversations/views.py:40 #: cfp/views.py:217 cfp/views.py:277 conversations/views.py:40
msgid "Message sent!" msgid "Message sent!"
msgstr "Message envoyé !" msgstr "Message envoyé !"
#: cfp/views.py:228 proposals/views.py:321 #: cfp/views.py:230 proposals/views.py:321
msgid "Vote successfully created" msgid "Vote successfully created"
msgstr "A voté !" msgstr "A voté !"
#: cfp/views.py:228 proposals/views.py:321 #: cfp/views.py:230 proposals/views.py:321
msgid "Vote successfully updated" msgid "Vote successfully updated"
msgstr "Vote mis à jour" msgstr "Vote mis à jour"
#: cfp/views.py:245
msgid "The talk has been accepted."
msgstr "Lexposé a été accepté."
#: cfp/views.py:247
msgid "The talk has been declined."
msgstr "Lexposé a été décliné."
#: cfp/views.py:251 proposals/views.py:347 #: cfp/views.py:251 proposals/views.py:347
msgid "Decision taken in account" msgid "Decision taken in account"
msgstr "Décision enregistrée" msgstr "Décision enregistrée"
#: cfp/views.py:296 #: cfp/views.py:297
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:297 #: cfp/views.py:298
msgid "" msgid ""
"Hi {},\n" "Hi {},\n"
"\n" "\n"
@ -866,11 +890,11 @@ msgstr ""
"{}\n" "{}\n"
"\n" "\n"
#: cfp/views.py:318 #: cfp/views.py:319
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:332 #: cfp/views.py:333
msgid "User created successfully." msgid "User created successfully."
msgstr "Utilisateur créé avec succès." msgstr "Utilisateur créé avec succès."
@ -901,6 +925,11 @@ msgid "You can use this page to communicate with the staff."
msgstr "" msgstr ""
"Vous pouvez utiliser cette page pour communiquer avec léquipe organisatrice." "Vous pouvez utiliser cette page pour communiquer avec léquipe organisatrice."
#: mailing/models.py:90
#, python-format
msgid "Message from %(author)s"
msgstr ""
#: mailing/templates/mailing/_message_list.html:13 #: mailing/templates/mailing/_message_list.html:13
msgid "No messages." msgid "No messages."
msgstr "Aucun message." msgstr "Aucun message."
@ -1191,19 +1220,6 @@ msgstr "Contacter :"
msgid "link" msgid "link"
msgstr "lien" msgstr "lien"
#: proposals/templates/proposals/talk_decide.html:15
msgid "Information for the proposer"
msgstr "Information à destination de lauteur de la proposition"
#: proposals/templates/proposals/talk_decide.html:19
msgid ""
"If you want to send a message to the proposer, please enter it below. "
"Remember to indicate which talk your message is reffering."
msgstr ""
"Si vous souhaitez envoyer un message à lauteur de la proposition, saisissez-"
"le ci-dessous. Noubliez pas de spécifier à quelle proposition "
"dintervention votre message fait référence."
#: proposals/templates/proposals/talk_detail.html:24 #: proposals/templates/proposals/talk_detail.html:24
msgid "Format" msgid "Format"
msgstr "Format" msgstr "Format"