Refine survey editor workflow and publication handling
This commit is contained in:
@@ -16,10 +16,15 @@
|
||||
<article class="survey-card">
|
||||
<div class="survey-meta">
|
||||
<h3>{{ survey.title|striptags|trim }}</h3>
|
||||
{% if isPreview %}<span class="survey-badge warning">{{ 'survey.survey.preview_badge'|trans }}</span>{% endif %}
|
||||
{% if progress.total > 0 %}<span class="survey-badge neutral">{{ progress.current }}/{{ progress.total }}</span>{% endif %}
|
||||
</div>
|
||||
<p>{{ (survey.description|striptags|trim) ?: 'survey.survey.default_description'|trans }}</p>
|
||||
|
||||
{% if isPreview %}
|
||||
<div class="survey-alert warning">{{ 'survey.survey.preview_notice'|trans }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if progress.total > 0 %}
|
||||
<div class="survey-progress"><span style="width: {{ progress.percentage }}%"></span></div>
|
||||
{% endif %}
|
||||
@@ -28,7 +33,7 @@
|
||||
{% if isComplete %}
|
||||
<article class="survey-card">
|
||||
<h3>{{ 'survey.survey.thanks_title'|trans }}</h3>
|
||||
<p>{{ 'survey.survey.thanks_text'|trans }}</p>
|
||||
<p>{{ isPreview ? 'survey.survey.preview_thanks_text'|trans : 'survey.survey.thanks_text'|trans }}</p>
|
||||
{% if answers %}
|
||||
<div class="survey-grid">
|
||||
{% for answer in answers %}
|
||||
@@ -47,8 +52,25 @@
|
||||
<h3>{{ question.question|striptags|trim }}</h3>
|
||||
{% if question.description|striptags|trim %}<p>{{ question.description|striptags|trim }}</p>{% endif %}
|
||||
|
||||
{% if canGoBack %}
|
||||
<form method="post" class="survey-button-row survey-button-row--navigation">
|
||||
<input type="hidden" name="REQUEST_TOKEN" value="{{ contao.request_token }}">
|
||||
<input type="hidden" name="_survey_navigation" value="back">
|
||||
<input type="hidden" name="_navigation_token" value="{{ csrf_token((isPreview ? 'survey-preview-back-' : 'survey-back-') ~ survey.id) }}">
|
||||
{% if isPreview %}
|
||||
<input type="hidden" name="preview_question" value="{{ question.id }}">
|
||||
<input type="hidden" name="preview_history" value="{{ historyState }}">
|
||||
{% endif %}
|
||||
<button type="submit" class="survey-button secondary">{{ 'survey.survey.back'|trans }}</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
{{ form_start(surveyForm, {attr: {class: 'survey-form-grid'}}) }}
|
||||
<input type="hidden" name="REQUEST_TOKEN" value="{{ contao.request_token }}">
|
||||
{% if isPreview %}
|
||||
<input type="hidden" name="preview_question" value="{{ question.id }}">
|
||||
<input type="hidden" name="preview_history" value="{{ historyState }}">
|
||||
{% endif %}
|
||||
{% if question.type == 'yes_no_maybe' %}
|
||||
<div class="survey-grid" style="grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));">
|
||||
{% for child in surveyForm.answer %}
|
||||
|
||||
Reference in New Issue
Block a user