@extends('layouts.app') @php $reg = new \App\Support\SubdomainRegistry(); $en = $reg->currentLocale() === 'en'; $lc = $en ? 'en' : 'de'; $t = fn ($de, $enT) => $en ? $enT : $de; $L = fn (array $pair) => $en ? ($pair[1] ?? $pair[0]) : $pair[0]; // [de, en] $O = fn (array $o) => $en ? $o[2] : $o[1]; // [value, de, en] $bySection = collect($q['questions'])->groupBy('section'); $quick = $quick ?? false; $secList = array_keys($q['sections']); @endphp @section('title', $t('Die große Problemumfrage — ProblemRadar', 'The full problem survey — ProblemRadar')) @section('meta_description', $t('Der vollständige Fragebogen — 5 bis 8 Minuten. Anonym und freiwillig.', 'The complete questionnaire — 5 to 8 minutes. Anonymous and voluntary.')) @section('content') @include('umfrage._shell')
{{ $quick ? $t('Kurzumfrage', 'Quick survey') : $t('Große Umfrage', 'Full survey') }}

{{ $quick ? $t('In zwei Minuten', 'In two minutes') : $t('Die große', 'The full') }} {{ $quick ? $t('mitgestalten', 'shape it') : $t('Problemumfrage', 'problem survey') }}

{{ $quick ? $t('Nur die wichtigsten Fragen — in rund zwei Minuten.', 'Only the key questions — in about two minutes.') : $t('Etwa 5–8 Minuten. Nicht jede Frage muss beantwortet werden — persönliche Angaben sind freiwillig.', 'About 5–8 minutes. Not every question is required — personal details are voluntary.') }}

{{ $t('Anonym · dein Name erscheint nie in Statistiken · keine E-Mail nötig.', 'Anonymous · your name never appears in statistics · no email needed.') }}

@if ($errors->any()) @endif
@csrf @foreach ($q['sections'] as $code => $sec)
{{ str_pad(array_search($code, $secList) + 1, 2, '0', STR_PAD_LEFT) }}

{{ $L($sec) }}

@foreach ($bySection->get($code, collect()) as $question) @php $k = $question['key']; $req = $question['required'] ?? false; @endphp
@isset($question['help'])

{{ $L($question['help']) }}

@endisset @switch($question['type']) @case('text') @break @case('textarea') @break @case('single') @break @case('multi')
@foreach ($question['options'] as $o) @endforeach
@break @case('scale')
{{ old($k, $question['min']) }}
@break @endswitch @php $opts = $question['options'] ?? []; $hasOther = collect($opts)->contains(fn ($o) => in_array($o[0], ['andere','other'], true)); $sel = old($k); $otherShown = is_array($sel) ? (in_array('andere', $sel, true) || in_array('other', $sel, true)) : in_array($sel, ['andere','other'], true); @endphp @if ($hasOther)
@endif @error($k)

{{ $message }}

@enderror
@endforeach @endforeach

{{ $t('Mit dem Absenden stimmst du der anonymen, statistischen Auswertung zu. Es wird keine E-Mail-Adresse abgefragt.', 'By submitting you agree to anonymous, statistical evaluation. No email address is requested.') }}

@endsection