diff --git a/locale/fr/LC_MESSAGES/django.mo b/locale/fr/LC_MESSAGES/django.mo index e359dd1..149860e 100644 Binary files a/locale/fr/LC_MESSAGES/django.mo and b/locale/fr/LC_MESSAGES/django.mo differ diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index a359c21..6927994 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-09-03 22:35+0000\n" +"POT-Creation-Date: 2016-09-05 15:05+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -355,6 +355,47 @@ msgstr "exposé" msgid "No speakers." msgstr "Aucun orateur." +#: proposals/templates/proposals/talk_decide.html:9 +msgid "Are you sure to accept this proposals?" +msgstr "Êtes-vous sûr d’accepter cette propositon d’intervention ?" + +#: proposals/templates/proposals/talk_decide.html:9 +msgid "Are you sure to decline this proposals?" +msgstr "Êtes-vous sûr de décliner cette propositon d’intervention ?" + +#: proposals/templates/proposals/talk_decide.html:11 +msgid "Information about the proposals" +msgstr "Information sur la propositon d’intervention" + +#: proposals/templates/proposals/talk_decide.html:12 +msgid "Title:" +msgstr "Titre :" + +#: proposals/templates/proposals/talk_decide.html:13 +msgid "Kind:" +msgstr "Type d’intervention :" + +#: proposals/templates/proposals/talk_decide.html:15 +msgid "Information for the proposer" +msgstr "Information à destination de l’auteur 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 à l’auteur de la proposition, " +"saisissez-le ci-dessous. N’oubliez pas de spécifier à quelle proposition " +"d’intervention votre message fait référence." + +#: proposals/templates/proposals/talk_decide.html:22 +msgid "Accept the proposal" +msgstr "Accepter la proposition" + +#: proposals/templates/proposals/talk_decide.html:22 +msgid "Decline the proposal" +msgstr "Décliner la proposition" + #: proposals/templates/proposals/talk_detail.html:12 #: proposals/templates/proposals/user_details.html:11 msgid "Edit" @@ -446,27 +487,27 @@ msgstr "Ajouter un thème" msgid "reviewer" msgstr "Responsable" -#: proposals/views.py:62 +#: proposals/views.py:65 #, python-format msgid "Talks related to %s:" msgstr "Exposés portant sur la thématique %s :" -#: proposals/views.py:81 +#: proposals/views.py:84 msgid "Talk modified successfully!" msgstr "Exposé modifié avec succès !" -#: proposals/views.py:87 +#: proposals/views.py:90 msgid "Talk proposed successfully!" msgstr "Exposé proposé avec succès !" -#: proposals/views.py:155 +#: proposals/views.py:158 msgid "Vote successfully created" msgstr "A voté !" -#: proposals/views.py:155 +#: proposals/views.py:158 msgid "Vote successfully updated" msgstr "Vote mis à jour" -#: proposals/views.py:167 +#: proposals/views.py:176 msgid "Decision taken in account" msgstr "Décision enregistrée" diff --git a/proposals/templates/proposals/talk_decide.html b/proposals/templates/proposals/talk_decide.html index 852f33f..bb63320 100644 --- a/proposals/templates/proposals/talk_decide.html +++ b/proposals/templates/proposals/talk_decide.html @@ -6,20 +6,20 @@ {% block content %} -

Are you sure to {% if accept %}accept{% else %}decline{% endif %} this proposals?

+

{% if accept %}{% trans "Are you sure to accept this proposals?" %}{% else %}{% trans "Are you sure to decline this proposals?" %}{% endif %}

-

Information about the proposals

-Title: {{ talk.title }}
-Kind: {{ talk.event }}
+

{% trans "Information about the proposals" %}

+{% trans "Title:" %} {{ talk.title }}
+{% trans "Kind:" %} {{ talk.event }}
-

Information for the proposer

+

{% trans "Information for the proposer" %}

{% csrf_token %}
- +
- + {% trans "Cancel" %}
diff --git a/proposals/views.py b/proposals/views.py index 2a5f321..10d46a2 100644 --- a/proposals/views.py +++ b/proposals/views.py @@ -12,9 +12,12 @@ from django.utils.translation import ugettext as _ from django.views.decorators.http import require_http_methods from django.http import HttpResponse +from accounts.models import Participation from accounts.mixins import OrgaRequiredMixin, StaffRequiredMixin from accounts.decorators import orga_required +from conversations.models import ConversationWithParticipant, ConversationAboutTalk, Message + from .forms import TalkForm, TopicCreateForm, TopicUpdateForm, ConferenceForm from .models import Talk, Topic, Vote, Conference from .signals import talk_added, talk_edited @@ -158,10 +161,24 @@ def vote(request, talk, score): @login_required def talk_decide(request, talk, accepted): - talk = get_object_or_404(Talk, site=get_current_site(request), slug=talk) + site = get_current_site(request) + talk = get_object_or_404(Talk, site=site, slug=talk) if not talk.is_moderable_by(request.user): raise PermissionDenied() if request.method == 'POST': + # Does we need to send a notification to the proposer? + m = request.POST.get('message', '').strip() + if m: + participation = Participation.objects.get(site=site, user=talk.proposer) + conversation = ConversationWithParticipant.objects.get(participation=participation) + Message.objects.create(conversation=conversation, author=request.user, content=m) + # Save the decision in the talk's conversation + conversation = ConversationAboutTalk.objects.get(talk=talk) + if accepted: + note = "The talk has been accepted." + else: + note = "The talk has been declined." + Message.objects.create(conversation=conversation, author=request.user, content=note) talk.accepted = accepted talk.save() messages.success(request, _('Decision taken in account'))