Add survey template list module
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
$GLOBALS['TL_DCA']['tl_module']['palettes']['member_survey_list'] = '{title_legend},name,headline,type;{survey_navigation_legend},surveyEditPage;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID';
|
||||
$GLOBALS['TL_DCA']['tl_module']['palettes']['member_survey_template_list'] = '{title_legend},name,headline,type;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID';
|
||||
$GLOBALS['TL_DCA']['tl_module']['palettes']['member_survey_edit'] = '{title_legend},name,headline,type;{survey_navigation_legend},surveyListPage;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID';
|
||||
$GLOBALS['TL_DCA']['tl_module']['palettes']['show_survey'] = '{title_legend},name,headline,type;{expert_legend:hide},guests,cssID';
|
||||
$GLOBALS['TL_DCA']['tl_module']['palettes']['survey_results'] = '{title_legend},name,headline,type;{expert_legend:hide},guests,cssID';
|
||||
|
||||
@@ -5,6 +5,7 @@ $GLOBALS['TL_LANG']['MOD']['survey_bundle_categories'] = ['Umfrage-Kategorien',
|
||||
|
||||
$GLOBALS['TL_LANG']['FMD']['survey'] = 'Umfragen';
|
||||
$GLOBALS['TL_LANG']['FMD']['member_survey_list'] = ['Meine Umfragen', 'Zeigt alle dem Mitglied zugewiesenen Umfragen an.'];
|
||||
$GLOBALS['TL_LANG']['FMD']['member_survey_template_list'] = ['Meine Umfrage-Vorlagen', 'Zeigt alle dem Mitglied zugewiesenen Umfrage-Vorlagen an und bietet nur das Duplizieren an.'];
|
||||
$GLOBALS['TL_LANG']['FMD']['member_survey_edit'] = ['Umfrage bearbeiten', 'Bearbeitungsbereich für zugewiesene Umfragen im Frontend.'];
|
||||
$GLOBALS['TL_LANG']['FMD']['show_survey'] = ['Umfrage ausfüllen', 'Öffentliche Umfrageansicht über den öffentlichen Link.'];
|
||||
$GLOBALS['TL_LANG']['FMD']['survey_results'] = ['Ergebnisse', 'Zeigt die Ergebnisse einer Umfrage über den konfigurierten Ergebnis-Link an.'];
|
||||
@@ -5,6 +5,7 @@ $GLOBALS['TL_LANG']['MOD']['survey_bundle_categories'] = ['Survey categories', '
|
||||
|
||||
$GLOBALS['TL_LANG']['FMD']['survey'] = 'Surveys';
|
||||
$GLOBALS['TL_LANG']['FMD']['member_survey_list'] = ['My surveys', 'Displays all surveys assigned to the member.'];
|
||||
$GLOBALS['TL_LANG']['FMD']['member_survey_template_list'] = ['My survey templates', 'Displays all survey templates assigned to the member and only offers duplication.'];
|
||||
$GLOBALS['TL_LANG']['FMD']['member_survey_edit'] = ['Edit survey', 'Frontend editing area for assigned surveys.'];
|
||||
$GLOBALS['TL_LANG']['FMD']['show_survey'] = ['Fill out survey', 'Public survey view accessible via the public link.'];
|
||||
$GLOBALS['TL_LANG']['FMD']['survey_results'] = ['Results', 'Displays the results of a survey via the configured results link.'];
|
||||
@@ -4,6 +4,7 @@
|
||||
{% include '@Survey/frontend/_survey_branding.html.twig' %}
|
||||
|
||||
{% set moduleHeadline = (headline is iterable ? headline.text|default('') : headline|default(''))|striptags|trim %}
|
||||
{% set templatesOnly = templatesOnly|default(false) %}
|
||||
|
||||
<section class="survey-shell survey-grid">
|
||||
{% for message in app.flashes('success') %}
|
||||
@@ -45,20 +46,20 @@
|
||||
</div>
|
||||
<div class="survey-list-card__footer">
|
||||
<div class="survey-button-row survey-list-card__actions">
|
||||
{% if survey.editUrl %}
|
||||
{% if not templatesOnly and survey.editUrl %}
|
||||
{% if survey.published %}
|
||||
<span class="survey-button primary is-disabled" aria-disabled="true">{{ 'survey.list.edit'|trans }}</span>
|
||||
{% else %}
|
||||
<a class="survey-button primary" href="{{ survey.editUrl }}">{{ 'survey.list.edit'|trans }}</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if survey.publicUrl and survey.published %}
|
||||
{% if not templatesOnly and survey.publicUrl and survey.published %}
|
||||
<a class="survey-button secondary" href="{{ survey.publicUrl }}" target="_blank" rel="noreferrer">{{ 'survey.list.public_view'|trans }}</a>
|
||||
{% endif %}
|
||||
{% if survey.draftUrl and not survey.published %}
|
||||
{% if not templatesOnly and survey.draftUrl and not survey.published %}
|
||||
<a class="survey-button secondary" href="{{ survey.draftUrl }}" target="_blank" rel="noreferrer">{{ 'survey.list.draft_view'|trans }}</a>
|
||||
{% endif %}
|
||||
{% if survey.resultsUrl %}
|
||||
{% if not templatesOnly and survey.resultsUrl %}
|
||||
<a class="survey-button secondary" href="{{ survey.resultsUrl }}" target="_blank" rel="noreferrer">{{ 'survey.list.show_results'|trans }}</a>
|
||||
{% endif %}
|
||||
<form method="post" class="survey-question-action-form">
|
||||
@@ -68,42 +69,46 @@
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('duplicate-survey-' ~ survey.id) }}">
|
||||
<button class="survey-button secondary" onclick="return confirm('{{ 'survey.list.duplicate_confirm'|trans({'%title%': survey.title|striptags|trim})|e('js') }}');">{{ 'survey.list.duplicate'|trans }}</button>
|
||||
</form>
|
||||
<form method="post" class="survey-question-action-form">
|
||||
<input type="hidden" name="REQUEST_TOKEN" value="{{ contao.request_token }}">
|
||||
<input type="hidden" name="_survey_action" value="delete-survey">
|
||||
<input type="hidden" name="item_id" value="{{ survey.id }}">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete-survey-' ~ survey.id) }}">
|
||||
<button class="survey-button danger" onclick="return confirm('{{ 'survey.list.delete_confirm'|trans|e('js') }}') && confirm('{{ 'survey.list.delete_confirm_second'|trans|e('js') }}');">{{ 'survey.list.delete'|trans }}</button>
|
||||
</form>
|
||||
{% if not templatesOnly %}
|
||||
<form method="post" class="survey-question-action-form">
|
||||
<input type="hidden" name="REQUEST_TOKEN" value="{{ contao.request_token }}">
|
||||
<input type="hidden" name="_survey_action" value="delete-survey">
|
||||
<input type="hidden" name="item_id" value="{{ survey.id }}">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete-survey-' ~ survey.id) }}">
|
||||
<button class="survey-button danger" onclick="return confirm('{{ 'survey.list.delete_confirm'|trans|e('js') }}') && confirm('{{ 'survey.list.delete_confirm_second'|trans|e('js') }}');">{{ 'survey.list.delete'|trans }}</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="survey-list-card__head-actions">
|
||||
<form method="post" class="survey-list-publish-form">
|
||||
<input type="hidden" name="REQUEST_TOKEN" value="{{ contao.request_token }}">
|
||||
<input type="hidden" name="_survey_action" value="publish-survey">
|
||||
<input type="hidden" name="item_id" value="{{ survey.id }}">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('publish-survey-' ~ survey.id) }}">
|
||||
<button
|
||||
type="submit"
|
||||
class="survey-button primary survey-list-publish-button"
|
||||
{% if survey.published %}disabled{% endif %}
|
||||
{% if not survey.published %}onclick="return confirm('{{ 'survey.edit.publish_confirm'|trans|e('js') }}');"{% endif %}
|
||||
>
|
||||
{{ survey.published ? 'survey.list.publish_done'|trans : 'survey.list.publish'|trans }}
|
||||
</button>
|
||||
{% if not survey.published %}
|
||||
<span class="survey-list-publish-help">{{ 'survey.list.publish_help'|trans }}</span>
|
||||
{% endif %}
|
||||
</form>
|
||||
{% if not templatesOnly %}
|
||||
<div class="survey-list-card__head-actions">
|
||||
<form method="post" class="survey-list-publish-form">
|
||||
<input type="hidden" name="REQUEST_TOKEN" value="{{ contao.request_token }}">
|
||||
<input type="hidden" name="_survey_action" value="publish-survey">
|
||||
<input type="hidden" name="item_id" value="{{ survey.id }}">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('publish-survey-' ~ survey.id) }}">
|
||||
<button
|
||||
type="submit"
|
||||
class="survey-button primary survey-list-publish-button"
|
||||
{% if survey.published %}disabled{% endif %}
|
||||
{% if not survey.published %}onclick="return confirm('{{ 'survey.edit.publish_confirm'|trans|e('js') }}');"{% endif %}
|
||||
>
|
||||
{{ survey.published ? 'survey.list.publish_done'|trans : 'survey.list.publish'|trans }}
|
||||
</button>
|
||||
{% if not survey.published %}
|
||||
<span class="survey-list-publish-help">{{ 'survey.list.publish_help'|trans }}</span>
|
||||
{% endif %}
|
||||
</form>
|
||||
|
||||
<form method="post" class="survey-list-eye-form">
|
||||
<input type="hidden" name="REQUEST_TOKEN" value="{{ contao.request_token }}">
|
||||
<input type="hidden" name="_survey_action" value="toggle-active">
|
||||
<input type="hidden" name="item_id" value="{{ survey.id }}">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('toggle-active-' ~ survey.id) }}">
|
||||
<button type="submit" class="survey-visibility-dot{{ survey.isActive ? ' is-on' : '' }}" title="{{ survey.isActive ? 'survey.edit.deactivate_survey'|trans : 'survey.edit.activate_survey'|trans }}" aria-label="{{ survey.isActive ? 'survey.edit.deactivate_survey'|trans : 'survey.edit.activate_survey'|trans }}"></button>
|
||||
</form>
|
||||
</div>
|
||||
<form method="post" class="survey-list-eye-form">
|
||||
<input type="hidden" name="REQUEST_TOKEN" value="{{ contao.request_token }}">
|
||||
<input type="hidden" name="_survey_action" value="toggle-active">
|
||||
<input type="hidden" name="item_id" value="{{ survey.id }}">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('toggle-active-' ~ survey.id) }}">
|
||||
<button type="submit" class="survey-visibility-dot{{ survey.isActive ? ' is-on' : '' }}" title="{{ survey.isActive ? 'survey.edit.deactivate_survey'|trans : 'survey.edit.activate_survey'|trans }}" aria-label="{{ survey.isActive ? 'survey.edit.deactivate_survey'|trans : 'survey.edit.activate_survey'|trans }}"></button>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</article>
|
||||
{% else %}
|
||||
|
||||
Reference in New Issue
Block a user