From 583184af380692c850cc42be86aeea7cbcd8d25b Mon Sep 17 00:00:00 2001 From: Mira Weller Date: Thu, 19 Mar 2026 21:45:32 +0100 Subject: [PATCH] change existing views --- src/pretix/control/navigation.py | 6 +- .../pretixcontrol/items/question_edit.html | 231 ++++++++---------- .../pretixcontrol/items/questionnaires.html | 5 +- .../pretixcontrol/items/questions.html | 65 ++--- src/pretix/control/views/item.py | 82 +------ 5 files changed, 123 insertions(+), 266 deletions(-) diff --git a/src/pretix/control/navigation.py b/src/pretix/control/navigation.py index 61e3411344..c1959680e3 100644 --- a/src/pretix/control/navigation.py +++ b/src/pretix/control/navigation.py @@ -182,12 +182,12 @@ def get_event_navigation(request: HttpRequest): 'active': 'event.items.categories' in url.url_name, }, { - 'label': _('Questions'), - 'url': reverse('control:event.items.questions', kwargs={ + 'label': _('Questionnaires'), + 'url': reverse('control:event.items.questionnaires', kwargs={ 'event': request.event.slug, 'organizer': request.event.organizer.slug, }), - 'active': 'event.items.questions' in url.url_name, + 'active': 'event.items.questionnaires' in url.url_name or 'event.items.questions' in url.url_name, }, { 'label': _('Discounts'), diff --git a/src/pretix/control/templates/pretixcontrol/items/question_edit.html b/src/pretix/control/templates/pretixcontrol/items/question_edit.html index e42b084cf7..3f8e5b2458 100644 --- a/src/pretix/control/templates/pretixcontrol/items/question_edit.html +++ b/src/pretix/control/templates/pretixcontrol/items/question_edit.html @@ -12,142 +12,113 @@ {% endblock %} {% block inside %} {% if question %} -

{% blocktrans with name=question.question %}Question: {{ name }}{% endblocktrans %}

+

{% blocktrans with name=question.question %}Data field: {{ name }}{% endblocktrans %}

{% else %} -

{% trans "Question" %}

+

{% trans "Data field" %}

{% endif %}
{% csrf_token %} {% bootstrap_form_errors form %} -
-
- {% trans "General" %} - {% bootstrap_field form.question layout="control" %} - {% bootstrap_field form.type layout="control" %} - {% bootstrap_field form.items layout="control" %} - {% bootstrap_field form.required layout="control" %} -
- {% blocktrans trimmed %} - If you mark a Yes/No question as required, it means that the user has to select Yes and No is not - accepted. If you want to allow both options, do not make this field required. - {% endblocktrans %} -
-
- {% bootstrap_field form.valid_number_min layout="control" %} - {% bootstrap_field form.valid_number_max layout="control" %} -
-
- {% bootstrap_field form.valid_date_min layout="control" %} - {% bootstrap_field form.valid_date_max layout="control" %} -
-
- {% bootstrap_field form.valid_datetime_min layout="control" %} - {% bootstrap_field form.valid_datetime_max layout="control" %} -
-
- {% bootstrap_field form.valid_string_length_max layout="control" %} -
-
- {% bootstrap_field form.valid_file_portrait layout="control" %} -
-
-

{% trans "Answer options" %}

- -
- {{ formset.management_form }} - {% bootstrap_formset_errors formset %} -
- {% for form in formset %} -
-
- {{ form.id }} - {% bootstrap_field form.DELETE form_group_class="" layout="inline" %} - {% bootstrap_field form.ORDER form_group_class="" layout="inline" %} -
-
-
- - {% blocktrans trimmed with id=form.instance.identifier %} - Answer option {{ id }} - {% endblocktrans %} - - {% bootstrap_form_errors form %} - {% bootstrap_field form.answer layout='inline' form_group_class="" %} -
-
-  
- - - -
-
-
- {% endfor %} -
- -

- -

-
-
-
-
- {% trans "Advanced" %} - {% bootstrap_field form.help_text layout="control" %} - {% bootstrap_field form.identifier layout="control" %} - {% bootstrap_field form.ask_during_checkin layout="control" %} - {% bootstrap_field form.show_during_checkin layout="control" %} - {% bootstrap_field form.hidden layout="control" %} - {% bootstrap_field form.print_on_invoice layout="control" %} - -
- -
- {% bootstrap_field form.dependency_question layout="inline" form_group_class="inner" %} -
-
- - {% bootstrap_field form.dependency_values layout="inline" form_group_class="inner" %} -
-
-
+ {% bootstrap_field form.question layout="control" %} + {% bootstrap_field form.type layout="control" %} +
+ {% bootstrap_field form.valid_number_min layout="control" %} + {% bootstrap_field form.valid_number_max layout="control" %}
+
+ {% bootstrap_field form.valid_date_min layout="control" %} + {% bootstrap_field form.valid_date_max layout="control" %} +
+
+ {% bootstrap_field form.valid_datetime_min layout="control" %} + {% bootstrap_field form.valid_datetime_max layout="control" %} +
+
+ {% bootstrap_field form.valid_string_length_max layout="control" %} +
+
+ {% bootstrap_field form.valid_file_portrait layout="control" %} +
+
+

{% trans "Answer options" %}

+ +
+ {{ formset.management_form }} + {% bootstrap_formset_errors formset %} +
+ {% for form in formset %} +
+
+ {{ form.id }} + {% bootstrap_field form.DELETE form_group_class="" layout="inline" %} + {% bootstrap_field form.ORDER form_group_class="" layout="inline" %} +
+
+
+ + {% blocktrans trimmed with id=form.instance.identifier %} + Answer option {{ id }} + {% endblocktrans %} + + {% bootstrap_form_errors form %} + {% bootstrap_field form.answer layout='inline' form_group_class="" %} +
+
+  
+ + + +
+
+
+ {% endfor %} +
+ +

+ +

+
+
+ {% bootstrap_field form.identifier layout="control" %} + {% bootstrap_field form.ask_during_checkin layout="control" %} + {% bootstrap_field form.show_during_checkin layout="control" %} + {% bootstrap_field form.hidden layout="control" %} + {% bootstrap_field form.print_on_invoice layout="control" %} + +