mirror of
https://github.com/pretix/pretix.git
synced 2026-08-09 10:37:50 +00:00
wip
This commit is contained in:
@@ -56,6 +56,20 @@ class BaseQuestionsViewMixin:
|
|||||||
def question_form_kwargs(self, cr):
|
def question_form_kwargs(self, cr):
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
@cached_property
|
||||||
|
def order_questions_form(self):
|
||||||
|
kwargs = {} # self.question_form_kwargs(cr)
|
||||||
|
form = self.form_class(event=self.request.event,
|
||||||
|
prefix='order',
|
||||||
|
request=self.request,
|
||||||
|
cartpos=None,
|
||||||
|
orderpos=None,
|
||||||
|
all_optional=self.all_optional,
|
||||||
|
data=(self.request.POST if self.request.method == 'POST' else None),
|
||||||
|
files=(self.request.FILES if self.request.method == 'POST' else None),
|
||||||
|
**kwargs)
|
||||||
|
return form
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def forms(self):
|
def forms(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -18,10 +18,13 @@
|
|||||||
</h1>
|
</h1>
|
||||||
<p>
|
<p>
|
||||||
{% blocktrans trimmed %}
|
{% blocktrans trimmed %}
|
||||||
Questions allow your attendees to fill in additional data about their ticket. If you provide food, one
|
Questionaires allow your attendees to fill in additional data about their ticket. If you provide food, one
|
||||||
example might be to ask your users about dietary requirements.
|
example might be to ask your users about dietary requirements.
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
TODO: add more specific explanation of the questionnaire concept.
|
||||||
|
</p>
|
||||||
|
|
||||||
{{ request.event.settings.locales|json_script:"event_locales" }}
|
{{ request.event.settings.locales|json_script:"event_locales" }}
|
||||||
{{ questionnaire_type_choices|json_script:"questionnaire_type_choices" }}
|
{{ questionnaire_type_choices|json_script:"questionnaire_type_choices" }}
|
||||||
|
|||||||
@@ -68,6 +68,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if order_questions_form %}
|
||||||
|
<details class="panel panel-default" open id="invoice-details">
|
||||||
|
<summary class="panel-heading">
|
||||||
|
<h3 class="panel-title">
|
||||||
|
<strong>{% trans "Additional order questions" %}</strong>
|
||||||
|
</h3>
|
||||||
|
</summary>
|
||||||
|
<div class="panel-body">
|
||||||
|
{% bootstrap_form order_questions_form layout="checkout" %}
|
||||||
|
</div>
|
||||||
|
</details>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% for pos, forms in formgroups %}
|
{% for pos, forms in formgroups %}
|
||||||
<details class="panel panel-default" open>
|
<details class="panel panel-default" open>
|
||||||
|
|||||||
@@ -72,16 +72,20 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.hidden-question { opacity: 0.3; }
|
.hidden-questionnaire { opacity: 0.3; }
|
||||||
.hidden-question label { text-decoration: line-through; }
|
|
||||||
|
|
||||||
.question-editor { margin-right: 180px; }
|
.questionnaires-list { margin-right: 180px; }
|
||||||
.question-edit-buttons { float:right; }
|
.question-edit-buttons { float:right; }
|
||||||
.question-edit-buttons div { position: absolute; margin-left: 10px; min-width: 100px; }
|
.question-edit-buttons div { position: absolute; margin-left: 10px; min-width: 100px; }
|
||||||
.question-edit-buttons button { }
|
.question-edit-buttons button { }
|
||||||
.form-group { margin-bottom: 30px }
|
.form-group { margin-bottom: 30px }
|
||||||
|
|
||||||
.filter-row { background: #fffee6; border: 1px solid #ecead5; padding: 10px; }
|
.questionnaires-editor.product-selected .panel .panel-heading {}
|
||||||
|
|
||||||
|
.questionnaires-editor.product-selected .panel { margin-bottom: 0; border: 0 none; border-bottom: 1px solid #ddd; box-shadow: none; border-radius: 0; }
|
||||||
|
.questionnaires-editor.product-selected .panel .panel-heading { font-style: italic; background: white; border: 0 none; }
|
||||||
|
|
||||||
|
.filter-row { background: #f8e6ff; border: 1px solid #e3cbed; padding: 10px; }
|
||||||
|
|
||||||
.debuginfo { font-size: 70%; background: rgba(200, 200, 200, 0.5); }
|
.debuginfo { font-size: 70%; background: rgba(200, 200, 200, 0.5); }
|
||||||
.dependency-info { position: absolute; }
|
.dependency-info { position: absolute; }
|
||||||
@@ -90,49 +94,53 @@ export default {
|
|||||||
.category-header { margin: 8px 0 -5px 0; font-weight: bold; color: #737373; }
|
.category-header { margin: 8px 0 -5px 0; font-weight: bold; color: #737373; }
|
||||||
</style>
|
</style>
|
||||||
<template>
|
<template>
|
||||||
<p class="filter-row">
|
<div class="questionnaires-editor">
|
||||||
Order questionnaires
|
<p class="filter-row">
|
||||||
</p>
|
Order questionnaires
|
||||||
<div class="question-editor">
|
</p>
|
||||||
<SlickList axis="y" v-model:list="order_questionnaires" useDragHandle appendTo="#orderQuestionnaireListParent" id="orderQuestionnaireListParent">
|
<div class="questionnaires-list">
|
||||||
<SlickItem v-for="(questionnaire, index) in order_questionnaires" :key="questionnaire.id || questionnaire._new_id" :index="index">
|
<SlickList axis="y" v-model:list="order_questionnaires" useDragHandle appendTo="#orderQuestionnaireListParent" id="orderQuestionnaireListParent">
|
||||||
<QuestionnaireElement
|
<SlickItem v-for="(questionnaire, index) in order_questionnaires" :key="questionnaire.id || questionnaire._new_id" :index="index">
|
||||||
:questionnaire="questionnaire"
|
<QuestionnaireElement
|
||||||
:datafields="datafields"
|
:questionnaire="questionnaire"
|
||||||
:grouped_items="null"
|
:datafields="datafields"
|
||||||
:selected_product="null" />
|
:grouped_items="null"
|
||||||
</SlickItem>
|
:selected_product="null" />
|
||||||
</SlickList>
|
</SlickItem>
|
||||||
|
</SlickList>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
<button class="btn btn-default" @click="addOrderQuestionnaire()"><i class="fa fa-plus"></i> Neuen Fragebogen erstellen</button>
|
||||||
|
<button class="btn btn-default" @click="saveData()"><i class="fa fa-save"></i> Speichern</button>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
|
||||||
<button class="btn btn-default" @click="addOrderQuestionnaire()"><i class="fa fa-plus"></i> Neuen Fragebogen erstellen</button>
|
|
||||||
<button class="btn btn-default" @click="saveData()"><i class="fa fa-save"></i> Speichern</button>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p class="filter-row">
|
<div :class="`questionnaires-editor ${selected_product ? 'product-selected':''}`">
|
||||||
Questionnaires for product:
|
<p class="filter-row">
|
||||||
<select v-model="selected_product">
|
Questionnaires for product:
|
||||||
<option value="">(all)</option>
|
<select v-model="selected_product">
|
||||||
<optgroup v-for="[category, items] in grouped_items" :label="category.internal_name || i18n_any(category.name)">
|
<option value="">(all)</option>
|
||||||
<option v-for="item in items" :value="item.id">
|
<optgroup v-for="[category, items] in grouped_items" :label="category.internal_name || i18n_any(category.name)">
|
||||||
{{ item.internal_name || i18n_any(item.name) }}
|
<option v-for="item in items" :value="item.id">
|
||||||
</option>
|
{{ item.internal_name || i18n_any(item.name) }}
|
||||||
</optgroup>
|
</option>
|
||||||
</select>
|
</optgroup>
|
||||||
</p>
|
</select>
|
||||||
<div class="question-editor">
|
</p>
|
||||||
<SlickList axis="y" v-model:list="position_questionnaires" useDragHandle appendTo="#questionnaireListParent" id="questionnaireListParent">
|
<div class="questionnaires-list">
|
||||||
<SlickItem v-for="(questionnaire, index) in position_questionnaires" :key="questionnaire.id || questionnaire._new_id" :index="index">
|
<SlickList axis="y" v-model:list="position_questionnaires" useDragHandle appendTo="#questionnaireListParent" id="questionnaireListParent">
|
||||||
<QuestionnaireElement
|
<SlickItem v-for="(questionnaire, index) in position_questionnaires" :key="questionnaire.id || questionnaire._new_id" :index="index">
|
||||||
:questionnaire="questionnaire"
|
<QuestionnaireElement
|
||||||
:datafields="datafields"
|
:questionnaire="questionnaire"
|
||||||
:grouped_items="grouped_items"
|
:datafields="datafields"
|
||||||
:selected_product="selected_product" />
|
:grouped_items="grouped_items"
|
||||||
</SlickItem>
|
:selected_product="selected_product" />
|
||||||
</SlickList>
|
</SlickItem>
|
||||||
|
</SlickList>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
<button class="btn btn-default" @click="addPositionQuestionnaire()"><i class="fa fa-plus"></i> Neuen Fragebogen erstellen</button>
|
||||||
|
<button class="btn btn-default" @click="saveData()"><i class="fa fa-save"></i> Speichern</button>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
|
||||||
<button class="btn btn-default" @click="addPositionQuestionnaire()"><i class="fa fa-plus"></i> Neuen Fragebogen erstellen</button>
|
|
||||||
<button class="btn btn-default" @click="saveData()"><i class="fa fa-save"></i> Speichern</button>
|
|
||||||
</p>
|
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -66,12 +66,12 @@ const isEditable = computed(() => props.selected_product && props.questionnaire.
|
|||||||
<div class="question-edit-buttons"><div class="btn-group">
|
<div class="question-edit-buttons"><div class="btn-group">
|
||||||
<DragHandle tag="button" class="btn btn-default"><i class="fa fa-arrows"></i></DragHandle>
|
<DragHandle tag="button" class="btn btn-default"><i class="fa fa-arrows"></i></DragHandle>
|
||||||
<button class="btn btn-default" @click="dlgEditor.show()"><i class="fa fa-edit"></i></button>
|
<button class="btn btn-default" @click="dlgEditor.show()"><i class="fa fa-edit"></i></button>
|
||||||
<button class="btn btn-default" @click="toggleItem()" v-if="selected_product"><i :class="`fa fa-eye${isHidden ? '-slash':''}`"></i></button>
|
|
||||||
</div></div>
|
</div></div>
|
||||||
|
|
||||||
<details class="panel panel-default " :open="!!isEditable"
|
<details class="panel panel-default " :open="!!isEditable"
|
||||||
:class="{ 'hidden-question': isHidden }">
|
:class="{ 'hidden-questionnaire': isHidden }">
|
||||||
<summary class="panel-heading">
|
<summary class="panel-heading">
|
||||||
|
<input type="checkbox" @click="toggleItem()" v-if="selected_product" :checked="!isHidden">
|
||||||
{{ props.questionnaire.internal_name }}
|
{{ props.questionnaire.internal_name }}
|
||||||
</summary>
|
</summary>
|
||||||
<div class="panel-body" v-if="!isHidden">
|
<div class="panel-body" v-if="!isHidden">
|
||||||
|
|||||||
Reference in New Issue
Block a user