From 132ca6b80a6c396e8a9b33fcd5c3bb2be866ffed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Mummert?= Date: Sun, 7 Jun 2026 21:09:36 +0200 Subject: [PATCH] Polish survey list actions and backend toggle --- contao/dca/tl_survey.php | 1 + .../frontend/_survey_assets.html.twig | 56 +++++++++++----- .../frontend/member_survey_list.html.twig | 67 ++++++++++--------- 3 files changed, 76 insertions(+), 48 deletions(-) diff --git a/contao/dca/tl_survey.php b/contao/dca/tl_survey.php index 7da245b..4cea940 100644 --- a/contao/dca/tl_survey.php +++ b/contao/dca/tl_survey.php @@ -64,6 +64,7 @@ $GLOBALS['TL_DCA']['tl_survey'] = [ 'href' => 'act=toggle&field=isActive', 'icon' => 'visible.svg', 'primary' => true, + 'showInHeader' => true, ], 'delete' => [ 'href' => 'act=delete', diff --git a/contao/templates/frontend/_survey_assets.html.twig b/contao/templates/frontend/_survey_assets.html.twig index 39d39b7..99c088a 100644 --- a/contao/templates/frontend/_survey_assets.html.twig +++ b/contao/templates/frontend/_survey_assets.html.twig @@ -283,28 +283,32 @@ .survey-list-card__head { display: flex; - gap: 0.75rem; - justify-content: space-between; - align-items: flex-start; + gap: 0.6rem; + align-items: center; + } + + .survey-list-card__headline { + display: flex; + align-items: center; + gap: 0.6rem; + flex-wrap: wrap; + min-width: 0; + flex: 1 1 auto; } .survey-list-card__title-wrap { - display: grid; - gap: 0.45rem; min-width: 0; } .survey-list-card__title-wrap h3 { margin: 0; - } - - .survey-list-card__stats { - gap: 0.6rem; + line-height: 1.15; } .survey-list-card__actions { margin-top: 0; align-items: center; + flex: 1 1 auto; } .survey-list-card__actions .survey-question-action-form { @@ -313,10 +317,19 @@ .survey-list-card__head-actions { display: flex; - align-items: flex-start; + align-items: center; justify-content: flex-end; - gap: 0.6rem; - margin-left: auto; + gap: 0.5rem; + flex: 0 0 auto; + margin-left: 1rem; + } + + .survey-list-card__footer { + display: flex; + align-items: center; + justify-content: space-between; + gap: 0.75rem; + flex-wrap: wrap; } .survey-list-card__stats { @@ -355,6 +368,11 @@ position: relative; } + .survey-list-card__head-actions .survey-button { + padding: 0.55rem 0.82rem; + font-size: 0.9rem; + } + .survey-list-publish-button[disabled] { opacity: 1; background: rgba(162, 168, 180, 0.4); @@ -391,8 +409,8 @@ } .survey-visibility-dot { - width: 2.75rem; - height: 2.75rem; + width: 2.2rem; + height: 2.2rem; border-radius: 999px; border: 1px solid rgba(162, 168, 180, 0.62); background: rgba(162, 168, 180, 0.22); @@ -404,8 +422,8 @@ } .survey-visibility-dot__icon { - width: 1rem; - height: 1rem; + width: 0.9rem; + height: 0.9rem; border-radius: 50%; background: #7f8793; display: inline-block; @@ -843,10 +861,14 @@ .survey-list-card__head-actions { margin-left: 0; - justify-content: flex-start; + justify-content: flex-end; width: 100%; } + .survey-list-card__footer { + align-items: flex-start; + } + .survey-list-publish-help { left: 0; right: auto; diff --git a/contao/templates/frontend/member_survey_list.html.twig b/contao/templates/frontend/member_survey_list.html.twig index eeccc0a..bdad33e 100644 --- a/contao/templates/frontend/member_survey_list.html.twig +++ b/contao/templates/frontend/member_survey_list.html.twig @@ -33,9 +33,43 @@ {% for survey in surveys %}
-
-

{{ survey.title|striptags|trim }}

+
+
+

{{ survey.title|striptags|trim }}

+
+
+ {{ 'survey.list.questions'|trans({'%count%': survey.questionCount}) }} + {{ 'survey.list.participations'|trans({'%count%': survey.participationCount}) }} +
+
+ -
- {{ 'survey.list.questions'|trans({'%count%': survey.questionCount}) }} - {{ 'survey.list.participations'|trans({'%count%': survey.participationCount}) }} -
-
- {% if survey.editUrl %} - {% if survey.published %} - {{ 'survey.list.edit'|trans }} - {% else %} - {{ 'survey.list.edit'|trans }} - {% endif %} - {% endif %} - {% if survey.publicUrl and survey.published %} - {{ 'survey.list.public_view'|trans }} - {% endif %} - {% if survey.draftUrl and not survey.published %} - {{ 'survey.list.draft_view'|trans }} - {% endif %} - {% if survey.resultsUrl %} - {{ 'survey.list.show_results'|trans }} - {% endif %} -
- - - - - -
-
{% else %}
{{ 'survey.list.empty'|trans }}