diff --git a/src/pretalx/orga/templates/orga/submission/content.html b/src/pretalx/orga/templates/orga/submission/content.html index a52f526f80..d4e01241a8 100644 --- a/src/pretalx/orga/templates/orga/submission/content.html +++ b/src/pretalx/orga/templates/orga/submission/content.html @@ -1,173 +1,152 @@ {% extends "orga/submission/base.html" %} {% load bootstrap4 %} -{% load compress %} -{% load filesize %} -{% load formset_tags %} {% load i18n %} +{% load rich_text %} {% load static %} -{% load rules %} {% block submission_content %} - {% has_perm 'orga.send_mails' request.user request.event as can_send_mails %} - {% has_perm 'orga.view_all_reviews' request.user request.event as can_view_all_reviews %} - {# do not compress #} - {% compress js %} - - - - - - - - - {% endcompress %} -
- {% if not submission %} - {% translate "Create proposal" %} - {% endif %} - - {% if submission.access_code %} -
- {% blocktranslate trimmed %} - This proposal was created using an access code: - {% endblocktranslate %} {{ submission.access_code.code }} -
- {% endif %} - {% bootstrap_form_errors form %} - {% csrf_token %} - {% bootstrap_field form.title layout='event' %} - {% if action == "create" %} - {% bootstrap_field form.speaker layout='event' %} - {% bootstrap_field form.speaker_name layout='event' %} - {% bootstrap_field form.state layout='event' %} - {% endif %} - {% if form.room %} -
- {% bootstrap_field form.room layout='event' %} - {% bootstrap_field form.start layout='event' %} - {% bootstrap_field form.end layout='event' %} + + + {% csrf_token %} + {% if tags_form %}{% bootstrap_form_errors tags_form %}{% endif %} +
+ +
+ {{ submission.title|default:'-' }} +
- {% endif %} - {% if form.instance.median_score != None and can_view_all_reviews %}
- -
- + +
+ {{ submission.submission_type }}
- {% endif %} - {% bootstrap_field form.submission_type layout='event' %} - {% if form.track %}{% bootstrap_field form.track layout='event' %}{% endif %} - {% if form.tags %}{% bootstrap_field form.tags layout='event' %}{% endif %} - {% if form.abstract %}{% bootstrap_field form.abstract layout='event' %}{% endif %} - {% if form.description %}{% bootstrap_field form.description layout='event' %}{% endif %} - {% if form.notes %}{% bootstrap_field form.notes layout='event' %}{% endif %} - {% bootstrap_field form.internal_notes layout='event' %} - {% if form.content_locale %}{% bootstrap_field form.content_locale layout='event' %}{% endif %} - {% if form.do_not_record %}{% bootstrap_field form.do_not_record layout='event' %}{% endif %} - {% bootstrap_field form.is_featured layout='event' %} - {% bootstrap_field form.duration addon_after='minutes' layout='event' addon_after_class="input-group-append input-group-text" %} - {% if form.slot_count %}{% bootstrap_field form.slot_count layout='event' %}{% endif %} - {% if form.image %}{% bootstrap_field form.image layout='event' %}{% endif %} - {% if action != 'create' %} -
- {{ formset.management_form }} - {% bootstrap_formset_errors formset %} - -
- {% for form in formset %} -
-
- {{ form.id }} - {% bootstrap_field form.DELETE form_group_class="" layout="inline" %} -
-
-
- {% bootstrap_form_errors form %} - {% bootstrap_field form.description layout='inline' %} - {% if form.instance.link %} - {% bootstrap_field form.link layout='inline' %} - {% else %} - {{ form.instance.filename }} - {% endif %} -
- {% if action != 'view' %} -
- -
- {% endif %} -
-
- {% empty %} -
- {% translate "This proposal has no file uploads yet." %} -
- {% endfor %} + {% if submission.track %} +
+ +
+ {{ submission.track.name|default:'-' }} +
- - {% if action != 'view' %} -
-
{% endif %} -
- {% endif %} - - {% if questions_form and questions_form.fields %} -
{% translate "Questions" %}
- {% bootstrap_form questions_form layout='event' %} - {% endif %} - - {% if can_send_mails or not form.read_only %} -
- - - {% if form.instance.code and can_send_mails %} - - - {% translate "Send mail to speakers" %} - - {% endif %} - {% if not form.read_only %} - - {% endif %} - -
- {% endif %} -
- - + {% endif %} + {% if submission.active_resources %} +
+ +
+ {% for resource in submission.active_resources %} + {% include "agenda/includes/submission_resource.html" %} + {% if not forloop.last %}
{% endif %} + {% endfor %} +
+
+ {% endif %} + {% if questions_form.fields %} +
+ +
+ {% for field_name, field in questions_form.fields.items %} +
+ {{ field.label }}: {{ field.answer.answer}} +
+ {% endfor %} +
+
+ {% endif %} + + + {% translate "Edit" %} + + {% endblock %} diff --git a/src/pretalx/orga/templates/orga/submission/content_edit.html b/src/pretalx/orga/templates/orga/submission/content_edit.html new file mode 100644 index 0000000000..a52f526f80 --- /dev/null +++ b/src/pretalx/orga/templates/orga/submission/content_edit.html @@ -0,0 +1,173 @@ +{% extends "orga/submission/base.html" %} +{% load bootstrap4 %} +{% load compress %} +{% load filesize %} +{% load formset_tags %} +{% load i18n %} +{% load static %} +{% load rules %} + +{% block submission_content %} + {% has_perm 'orga.send_mails' request.user request.event as can_send_mails %} + {% has_perm 'orga.view_all_reviews' request.user request.event as can_view_all_reviews %} + {# do not compress #} + {% compress js %} + + + + + + + + + {% endcompress %} +
+ {% if not submission %} + {% translate "Create proposal" %} + {% endif %} + + {% if submission.access_code %} +
+ {% blocktranslate trimmed %} + This proposal was created using an access code: + {% endblocktranslate %} {{ submission.access_code.code }} +
+ {% endif %} + {% bootstrap_form_errors form %} + {% csrf_token %} + {% bootstrap_field form.title layout='event' %} + {% if action == "create" %} + {% bootstrap_field form.speaker layout='event' %} + {% bootstrap_field form.speaker_name layout='event' %} + {% bootstrap_field form.state layout='event' %} + {% endif %} + {% if form.room %} +
+ {% bootstrap_field form.room layout='event' %} + {% bootstrap_field form.start layout='event' %} + {% bootstrap_field form.end layout='event' %} +
+ {% endif %} + {% if form.instance.median_score != None and can_view_all_reviews %} +
+ +
+ +
+
+ {% endif %} + {% bootstrap_field form.submission_type layout='event' %} + {% if form.track %}{% bootstrap_field form.track layout='event' %}{% endif %} + {% if form.tags %}{% bootstrap_field form.tags layout='event' %}{% endif %} + {% if form.abstract %}{% bootstrap_field form.abstract layout='event' %}{% endif %} + {% if form.description %}{% bootstrap_field form.description layout='event' %}{% endif %} + {% if form.notes %}{% bootstrap_field form.notes layout='event' %}{% endif %} + {% bootstrap_field form.internal_notes layout='event' %} + {% if form.content_locale %}{% bootstrap_field form.content_locale layout='event' %}{% endif %} + {% if form.do_not_record %}{% bootstrap_field form.do_not_record layout='event' %}{% endif %} + {% bootstrap_field form.is_featured layout='event' %} + {% bootstrap_field form.duration addon_after='minutes' layout='event' addon_after_class="input-group-append input-group-text" %} + {% if form.slot_count %}{% bootstrap_field form.slot_count layout='event' %}{% endif %} + {% if form.image %}{% bootstrap_field form.image layout='event' %}{% endif %} + {% if action != 'create' %} +
+ {{ formset.management_form }} + {% bootstrap_formset_errors formset %} + +
+ {% for form in formset %} +
+
+ {{ form.id }} + {% bootstrap_field form.DELETE form_group_class="" layout="inline" %} +
+
+
+ {% bootstrap_form_errors form %} + {% bootstrap_field form.description layout='inline' %} + {% if form.instance.link %} + {% bootstrap_field form.link layout='inline' %} + {% else %} + {{ form.instance.filename }} + {% endif %} +
+ {% if action != 'view' %} +
+ +
+ {% endif %} +
+
+ {% empty %} +
+ {% translate "This proposal has no file uploads yet." %} +
+ {% endfor %} +
+ + {% if action != 'view' %} +
+ +
+ {% endif %} +
+ {% endif %} + + {% if questions_form and questions_form.fields %} +
{% translate "Questions" %}
+ {% bootstrap_form questions_form layout='event' %} + {% endif %} + + {% if can_send_mails or not form.read_only %} +
+ + + {% if form.instance.code and can_send_mails %} + + + {% translate "Send mail to speakers" %} + + {% endif %} + {% if not form.read_only %} + + {% endif %} + +
+ {% endif %} +
+ + +{% endblock %} diff --git a/src/pretalx/orga/urls.py b/src/pretalx/orga/urls.py index e225a74f8b..c3d8da23a8 100644 --- a/src/pretalx/orga/urls.py +++ b/src/pretalx/orga/urls.py @@ -425,13 +425,13 @@ [ path( "", - submission.SubmissionContent.as_view(), - name="submissions.content.view", + submission.SubmissionContentView.as_view(), + name="submissions.content", ), path( - "submit", - submission.SubmissionStateChange.as_view(), - name="submissions.submit", + "edit", + submission.SubmissionContent.as_view(), + name="submissions.content.view", ), path( "accept", diff --git a/src/pretalx/orga/views/submission.py b/src/pretalx/orga/views/submission.py index 40b90d6841..ee28991b4b 100644 --- a/src/pretalx/orga/views/submission.py +++ b/src/pretalx/orga/views/submission.py @@ -375,7 +375,7 @@ class SubmissionContent( ): model = Submission form_class = SubmissionForm - template_name = "orga/submission/content.html" + template_name = "orga/submission/content_edit.html" permission_required = "orga.view_submissions" def get_object(self): @@ -557,6 +557,30 @@ def get_form_kwargs(self): return kwargs +class SubmissionContentView(SubmissionContent): + template_name = "orga/submission/content.html" + + def get_object(self): + try: + return super().get_object() + except Http404 as not_found: + if self.request.path.rstrip("/").endswith("/new"): + return None + raise not_found + + def get_permission_required(self): + if "code" in self.kwargs: + return ["submission.edit_submission"] + return ["orga.create_submission"] + + @property + def permission_object(self): + return self.object or self.request.event + + def get_permission_object(self): + return self.permission_object + + class BaseSubmissionList(Sortable, ReviewerSubmissionFilter, PaginationMixin, ListView): model = Submission context_object_name = "submissions" diff --git a/src/pretalx/submission/models/submission.py b/src/pretalx/submission/models/submission.py index 5872369d8a..a47a966a06 100644 --- a/src/pretalx/submission/models/submission.py +++ b/src/pretalx/submission/models/submission.py @@ -263,6 +263,7 @@ class urls(EventUrls): class orga_urls(EventUrls): base = edit = "{self.event.orga_urls.submissions}{self.code}/" + edit = "{base}edit" make_submitted = "{base}submit" accept = "{base}accept" reject = "{base}reject"