diff --git a/contao/languages/de/tl_survey_content.php b/contao/languages/de/tl_survey_content.php index 36ea676..817461b 100644 --- a/contao/languages/de/tl_survey_content.php +++ b/contao/languages/de/tl_survey_content.php @@ -35,3 +35,4 @@ $GLOBALS['TL_LANG']['tl_survey_content']['mandatoryBadge'] = 'Pflicht'; $GLOBALS['TL_LANG']['tl_survey_content']['inactiveBadge'] = 'inaktiv'; $GLOBALS['TL_LANG']['tl_survey_content']['rangeMaxBelowMin'] = 'Der größte Wert muss mindestens so groß sein wie der kleinste Wert.'; $GLOBALS['TL_LANG']['tl_survey_content']['rangeStepInvalid'] = 'Die Schrittweite muss mindestens 1 sein.'; +$GLOBALS['TL_LANG']['tl_survey_content']['sectionTitle'] = ['Titel des Themenbereichs', 'Überschrift, die den folgenden Fragen vorangestellt wird.']; diff --git a/contao/languages/en/tl_survey_content.php b/contao/languages/en/tl_survey_content.php index 3b7305b..968c3cd 100644 --- a/contao/languages/en/tl_survey_content.php +++ b/contao/languages/en/tl_survey_content.php @@ -35,3 +35,4 @@ $GLOBALS['TL_LANG']['tl_survey_content']['mandatoryBadge'] = 'mandatory'; $GLOBALS['TL_LANG']['tl_survey_content']['inactiveBadge'] = 'inactive'; $GLOBALS['TL_LANG']['tl_survey_content']['rangeMaxBelowMin'] = 'The largest value must not be smaller than the smallest value.'; $GLOBALS['TL_LANG']['tl_survey_content']['rangeStepInvalid'] = 'The step must be at least 1.'; +$GLOBALS['TL_LANG']['tl_survey_content']['sectionTitle'] = ['Title of the topic section', 'Heading shown above the following questions.']; diff --git a/contao/templates/frontend/member_survey_edit.html.twig b/contao/templates/frontend/member_survey_edit.html.twig index 5bd878a..c1aadb8 100644 --- a/contao/templates/frontend/member_survey_edit.html.twig +++ b/contao/templates/frontend/member_survey_edit.html.twig @@ -116,7 +116,6 @@ > {% if isSection %} - {{ 'survey.edit.section_badge'|trans }} {{ question.question|striptags|trim ?: ('survey.edit.section_fallback'|trans) }} diff --git a/contao/templates/frontend/show_survey.html.twig b/contao/templates/frontend/show_survey.html.twig index 2cb28b7..4f8eec5 100644 --- a/contao/templates/frontend/show_survey.html.twig +++ b/contao/templates/frontend/show_survey.html.twig @@ -18,7 +18,6 @@

{{ survey.title|striptags|trim }}

{% if isPreview %}{{ 'survey.survey.preview_badge'|trans }}{% endif %} - {% if progress.total > 0 %}{{ progress.current }}/{{ progress.total }}{% endif %}
{# Der Einleitungstext erscheint nur auf der ersten Seite. #} @@ -59,12 +58,10 @@
{% if progress.sectionTitle %}
- {{ 'survey.survey.section_kicker'|trans({'%number%': progress.sectionNumber, '%count%': progress.sectionCount}) }} {{ progress.sectionTitle }} {{ 'survey.survey.section_progress'|trans({'%current%': progress.sectionCurrent, '%total%': progress.sectionTotal, '%section%': progress.sectionTitle}) }}
{% endif %} -
{{ 'survey.survey.overall_progress'|trans({'%current%': progress.current, '%total%': progress.total}) }}

{{ question.question|striptags|trim }}

{% if question.description|survey_has_text %}
{{ question.description|survey_rich }}
{% endif %} diff --git a/public/css/survey-frontend.css b/public/css/survey-frontend.css index 9380ec6..20c437a 100644 --- a/public/css/survey-frontend.css +++ b/public/css/survey-frontend.css @@ -1288,9 +1288,17 @@ .survey-section-context { display: flex; flex-wrap: wrap; + justify-content: space-between; align-items: baseline; - gap: 0.35rem 0.9rem; - margin-bottom: 0.5rem; + gap: 0.35rem 1rem; + margin-bottom: 0.75rem; + padding-bottom: 0.5rem; + border-bottom: 1px solid rgba(162, 168, 180, 0.3); +} + +.survey-section-context .survey-section-counter { + margin-left: auto; + text-align: right; } .survey-section-context .survey-section-kicker { @@ -1326,3 +1334,18 @@ .survey-results-section-head .survey-section-kicker { margin-bottom: 0.1rem; } + +/* --- Rich-Text: Fett/Kursiv explizit (die globale font-style-Rückstellung der Shell überschreiben) --- */ +.survey-shell .survey-rich-text strong, +.survey-shell .survey-rich-text b, +.survey-shell .ql-editor strong, +.survey-shell .ql-editor b { + font-weight: 700; +} + +.survey-shell .survey-rich-text em, +.survey-shell .survey-rich-text i, +.survey-shell .ql-editor em, +.survey-shell .ql-editor i { + font-style: italic; +} diff --git a/src/EventListener/SurveyDcaListener.php b/src/EventListener/SurveyDcaListener.php index cbb3849..6b5c4a0 100644 --- a/src/EventListener/SurveyDcaListener.php +++ b/src/EventListener/SurveyDcaListener.php @@ -430,6 +430,10 @@ final class SurveyDcaListener $type = (string) Input::post('type'); } + if (SurveyQuestionRepository::TYPE_SECTION === $type) { + $GLOBALS['TL_DCA']['tl_survey_content']['fields']['question']['label'] = &$GLOBALS['TL_LANG']['tl_survey_content']['sectionTitle']; + } + return match ($type) { 'range' => (string) ($GLOBALS['TL_DCA']['tl_survey_content']['palettes']['range'] ?? $palette), 'text' => (string) ($GLOBALS['TL_DCA']['tl_survey_content']['palettes']['text'] ?? $palette),