allow speakers to upload their slides

This commit is contained in:
Élie Bouttier 2017-11-15 00:03:13 +01:00
parent 7d7fb64df2
commit 742aec6270
6 changed files with 64 additions and 42 deletions

View File

@ -80,10 +80,12 @@ class TalkForm(forms.ModelForm):
del self.fields['category'] del self.fields['category']
else: else:
self.fields['category'].queryset = categories self.fields['category'].queryset = categories
if self.instance and self.instance.accepted is not True:
del self.fields['materials']
class Meta: class Meta:
model = Talk model = Talk
fields = ('category', 'title', 'description', 'notes') fields = ('category', 'title', 'description', 'notes', 'materials',)
class TalkStaffForm(forms.ModelForm): class TalkStaffForm(forms.ModelForm):
@ -93,7 +95,6 @@ class TalkStaffForm(forms.ModelForm):
self.fields['category'].queryset = TalkCategory.objects.filter(site=conference.site) self.fields['category'].queryset = TalkCategory.objects.filter(site=conference.site)
self.fields['track'].queryset = Track.objects.filter(site=conference.site) self.fields['track'].queryset = Track.objects.filter(site=conference.site)
self.fields['room'].queryset = Room.objects.filter(site=conference.site) self.fields['room'].queryset = Room.objects.filter(site=conference.site)
self.fields['materials'].required = False
if self.instance and self.instance.category and self.instance.category.duration: if self.instance and self.instance.category and self.instance.category.duration:
self.fields['duration'].help_text = _('Default duration: %(duration)d min') % {'duration': self.instance.duration} self.fields['duration'].help_text = _('Default duration: %(duration)d min') % {'duration': self.instance.duration}

View File

@ -82,6 +82,20 @@
{% endif %} {% endif %}
</p> </p>
{% if talk.materials or talk.video %}
<h3>{% trans "Materials and video" %}</h3>
<dl class="dl-horizontal">
{% if talk.materials %}
<dt>{% trans "Materials" %}</dt>
<dd><a href="{{ talk.materials.url }}">{{ talk.materials_name }}</a></dd>
{% endif %}
{% if talk.video %}
<dt>{% trans "Video" %}</dt>
<dd><a href="{{ talk.video }}">{% trans "download" %}</a></dd>
{% endif %}
</dl>
{% endif %}
<h3>{% trans "Message to organizers" %}</h3> <h3>{% trans "Message to organizers" %}</h3>
<p> <p>

View File

@ -21,7 +21,7 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<form method="POST" class="form-horizontal col-md-8 col-md-offset-2"> <form method="post" enctype="multipart/form-data" class="form-horizontal col-md-8 col-md-offset-2">
{% csrf_token %} {% csrf_token %}
{{ form|crispy }} {{ form|crispy }}
<div class="col-md-12 text-center"> <div class="col-md-12 text-center">

View File

@ -287,7 +287,7 @@ def proposal_talk_edit(request, speaker, talk_id=None):
categories = TalkCategory.objects.filter(site=request.conference.site) categories = TalkCategory.objects.filter(site=request.conference.site)
else: else:
categories = request.conference.opened_categories categories = request.conference.opened_categories
form = TalkForm(request.POST or None, categories=categories, instance=talk) form = TalkForm(request.POST or None, request.FILES or None, categories=categories, instance=talk)
if request.method == 'POST' and form.is_valid(): if request.method == 'POST' and form.is_valid():
talk = form.save(commit=False) talk = form.save(commit=False)
talk.site = request.conference.site talk.site = request.conference.site

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-11-11 17:45+0000\n" "POT-Creation-Date: 2017-11-14 23:02+0000\n"
"PO-Revision-Date: 2017-11-11 18:46+0100\n" "PO-Revision-Date: 2017-11-15 00:03+0100\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: fr\n" "Language: fr\n"
@ -22,7 +22,7 @@ msgstr ""
msgid "Pending decision" msgid "Pending decision"
msgstr "Décision en attente" msgstr "Décision en attente"
#: cfp/forms.py:18 cfp/forms.py:124 cfp/forms.py:221 #: cfp/forms.py:18 cfp/forms.py:125 cfp/forms.py:222
msgid "Accepted" msgid "Accepted"
msgstr "Accepté" msgstr "Accepté"
@ -34,7 +34,7 @@ msgstr "Décliné"
msgid "Waiting" msgid "Waiting"
msgstr "En attente" msgstr "En attente"
#: cfp/forms.py:29 cfp/forms.py:130 cfp/forms.py:227 cfp/models.py:373 #: cfp/forms.py:29 cfp/forms.py:131 cfp/forms.py:228 cfp/models.py:373
msgid "Confirmed" msgid "Confirmed"
msgstr "Confirmé" msgstr "Confirmé"
@ -51,132 +51,134 @@ msgctxt "activity"
msgid "None" msgid "None"
msgstr "Aucune" msgstr "Aucune"
#: cfp/forms.py:98 #: cfp/forms.py:99
#, python-format #, python-format
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:106 cfp/forms.py:118 cfp/forms.py:215 #: cfp/forms.py:107 cfp/forms.py:119 cfp/forms.py:216
#: 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"
#: cfp/forms.py:107 cfp/templates/cfp/staff/talk_list.html:43 #: cfp/forms.py:108 cfp/templates/cfp/staff/talk_list.html:43
msgid "Title" msgid "Title"
msgstr "Titre" msgstr "Titre"
#: cfp/forms.py:108 cfp/models.py:158 cfp/models.py:499 #: cfp/forms.py:109 cfp/models.py:158 cfp/models.py:499
#: cfp/templates/cfp/proposal_talk_details.html:75 #: cfp/templates/cfp/proposal_talk_details.html:75
#: cfp/templates/cfp/staff/talk_details.html:64 #: cfp/templates/cfp/staff/talk_details.html:64
msgid "Description" msgid "Description"
msgstr "Description" msgstr "Description"
#: cfp/forms.py:109 cfp/models.py:112 cfp/models.py:464 #: cfp/forms.py:110 cfp/models.py:112 cfp/models.py:464
#: cfp/templates/cfp/staff/participant_details.html:19 #: cfp/templates/cfp/staff/participant_details.html:19
#: cfp/templates/cfp/staff/talk_details.html:78 #: cfp/templates/cfp/staff/talk_details.html:78
#: cfp/templates/cfp/staff/volunteer_details.html:22 #: cfp/templates/cfp/staff/volunteer_details.html:22
msgid "Notes" msgid "Notes"
msgstr "Notes" msgstr "Notes"
#: cfp/forms.py:112 #: cfp/forms.py:113
msgid "Visible by speakers" msgid "Visible by speakers"
msgstr "Visible par les orateurs" msgstr "Visible par les orateurs"
#: cfp/forms.py:136 cfp/forms.py:233 cfp/models.py:330 #: cfp/forms.py:137 cfp/forms.py:234 cfp/models.py:330
#: cfp/templates/cfp/staff/talk_details.html:21 #: cfp/templates/cfp/staff/talk_details.html:21
#: cfp/templates/cfp/staff/talk_list.html:46 #: cfp/templates/cfp/staff/talk_list.html:46
#: cfp/templates/cfp/staff/track_form.html:14 #: cfp/templates/cfp/staff/track_form.html:14
msgid "Track" msgid "Track"
msgstr "Session" msgstr "Session"
#: cfp/forms.py:142 #: cfp/forms.py:143
msgid "Tag" msgid "Tag"
msgstr "Étiquette" msgstr "Étiquette"
#: cfp/forms.py:148 cfp/templates/cfp/staff/talk_details.html:83 #: cfp/forms.py:149 cfp/templates/cfp/staff/talk_details.html:83
msgid "Vote" msgid "Vote"
msgstr "Vote" msgstr "Vote"
#: cfp/forms.py:149 #: cfp/forms.py:150
msgid "Filter talks you already / not yet voted for" msgid "Filter talks you already / not yet voted for"
msgstr "" msgstr ""
"Filtrer les propositions pour lesquelles vous avez déjà voté / pas encore " "Filtrer les propositions pour lesquelles vous avez déjà voté / pas encore "
"voté" "voté"
#: cfp/forms.py:152 cfp/templates/cfp/staff/room_form.html:14 #: cfp/forms.py:153 cfp/templates/cfp/staff/room_form.html:14
#: cfp/templates/cfp/staff/talk_details.html:38 #: cfp/templates/cfp/staff/talk_details.html:38
msgid "Room" msgid "Room"
msgstr "Salle" msgstr "Salle"
#: cfp/forms.py:153 #: cfp/forms.py:154
msgid "Filter talks already / not yet affected to a room" msgid "Filter talks already / not yet affected to a room"
msgstr "Filtrer les exposés déjà / pas encore affectées à une salle" msgstr "Filtrer les exposés déjà / pas encore affectées à une salle"
#: cfp/forms.py:156 #: cfp/forms.py:157
msgid "Scheduled" msgid "Scheduled"
msgstr "Programmé" msgstr "Programmé"
#: cfp/forms.py:157 #: cfp/forms.py:158
msgid "Filter talks already / not yet scheduled" msgid "Filter talks already / not yet scheduled"
msgstr "Filtrer les exposés déjà / pas encore planifiées" msgstr "Filtrer les exposés déjà / pas encore planifiées"
#: cfp/forms.py:160 cfp/models.py:347 #: cfp/forms.py:161 cfp/models.py:347
#: cfp/templates/cfp/proposal_talk_details.html:89
#: cfp/templates/cfp/staff/talk_details.html:54 #: cfp/templates/cfp/staff/talk_details.html:54
msgid "Materials" msgid "Materials"
msgstr "Supports" msgstr "Supports"
#: cfp/forms.py:161 #: cfp/forms.py:162
msgid "Filter talks with / without materials" msgid "Filter talks with / without materials"
msgstr "Filtrer les exposés avec / sans supports" msgstr "Filtrer les exposés avec / sans supports"
#: cfp/forms.py:164 cfp/templates/cfp/staff/talk_details.html:58 #: cfp/forms.py:165 cfp/templates/cfp/proposal_talk_details.html:93
#: cfp/templates/cfp/staff/talk_details.html:58
msgid "Video" msgid "Video"
msgstr "Vidéo" msgstr "Vidéo"
#: cfp/forms.py:165 #: cfp/forms.py:166
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:174 cfp/forms.py:245 #: cfp/forms.py:175 cfp/forms.py:246
msgid "Not assigned" msgid "Not assigned"
msgstr "Pas encore assignée" msgstr "Pas encore assignée"
#: cfp/forms.py:180 #: cfp/forms.py:181
msgid "Accept talk?" msgid "Accept talk?"
msgstr "Accepter la proposition ?" msgstr "Accepter la proposition ?"
#: cfp/forms.py:181 #: cfp/forms.py:182
msgid "Assign to a track" msgid "Assign to a track"
msgstr "Assigner à une session" msgstr "Assigner à une session"
#: cfp/forms.py:182 cfp/templates/cfp/admin/tag_list.html:11 #: cfp/forms.py:183 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:183 #: cfp/forms.py:184
msgid "Put in a room" msgid "Put in a room"
msgstr "Assigner à une salle" msgstr "Assigner à une salle"
#: cfp/forms.py:199 #: cfp/forms.py:200
msgid "Notify by mail?" msgid "Notify by mail?"
msgstr "Notifier par e-mail ?" msgstr "Notifier par e-mail ?"
#: cfp/forms.py:249 cfp/models.py:459 #: cfp/forms.py:250 cfp/models.py:459
#: 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:269
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:288 #: cfp/forms.py:289
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:293 #: cfp/forms.py:294
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à."
@ -328,7 +330,7 @@ msgstr "Titre de la proposition"
msgid "Description of your talk" msgid "Description of your talk"
msgstr "Description de votre proposition" msgstr "Description de votre proposition"
#: cfp/models.py:332 cfp/templates/cfp/proposal_talk_details.html:85 #: cfp/models.py:332 cfp/templates/cfp/proposal_talk_details.html:99
msgid "Message to organizers" msgid "Message to organizers"
msgstr "Message aux organisateurs" msgstr "Message aux organisateurs"
@ -722,11 +724,20 @@ msgid "remove"
msgstr "supprimer" msgstr "supprimer"
#: cfp/templates/cfp/proposal_talk_details.html:81 #: cfp/templates/cfp/proposal_talk_details.html:81
#: cfp/templates/cfp/proposal_talk_details.html:91 #: cfp/templates/cfp/proposal_talk_details.html:105
#: cfp/templates/cfp/staff/talk_details.html:66 #: cfp/templates/cfp/staff/talk_details.html:66
msgid "No description provided." msgid "No description provided."
msgstr "Aucune description fournie." msgstr "Aucune description fournie."
#: cfp/templates/cfp/proposal_talk_details.html:86
msgid "Materials and video"
msgstr "Supports et vidéo"
#: cfp/templates/cfp/proposal_talk_details.html:94
#: cfp/templates/cfp/staff/talk_details.html:59
msgid "download"
msgstr "télécharger"
#: cfp/templates/cfp/proposal_talk_form.html:14 #: cfp/templates/cfp/proposal_talk_form.html:14
msgid "Submit a proposal" msgid "Submit a proposal"
msgstr "Soumettre une proposition" msgstr "Soumettre une proposition"
@ -971,10 +982,6 @@ msgstr "Créneau"
msgid "not defined" msgid "not defined"
msgstr "non défini" msgstr "non défini"
#: cfp/templates/cfp/staff/talk_details.html:59
msgid "download"
msgstr "télécharger"
#: cfp/templates/cfp/staff/talk_details.html:75 #: cfp/templates/cfp/staff/talk_details.html:75
msgid "No speakers." msgid "No speakers."
msgstr "Aucun orateur." msgstr "Aucun orateur."