Files
gnilebeinandClaude Sonnet 5.5 27771e7470
CI / Deploy / PHP 8.4 (push) Successful in 1m18s
CI / Deploy / PHP 8.5 (push) Successful in 1m29s
CI / Deploy / test (push) Successful in 1s
CI / Deploy / deploy (push) Skipped
Add an optional countdown to every slide that collects answers
Choice, word cloud, open question, scale and ordering slides get a time
limit like the quiz. With a limit the slide waits ("ready") showing only
the question; next starts the countdown, the next one ends it, the third
moves on. Stage results and the ordering solution are withheld until the
countdown has started. The countdown music plays during any countdown.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-21 12:18:33 +01:00

430 lines
29 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Admin dashboard of a poll.
*
* @var \App\View\AppView $this
* @var \App\Model\Entity\Poll $poll
* @var string $adminToken
* @var list<\App\Model\Entity\Slide> $slides
* @var array<int, int> $responseCounts
* @var array<string, string> $typeLabels
* @var array<string, string> $typeDescriptions
* @var string $joinUrl
* @var string $embedKey
* @var int $pollIntervalMs
*/
$this->assign('title', $poll->title);
$this->assign('noindex', '1');
$url = fn(string $name, array $params = []) => ['_name' => $name, 'token' => $adminToken] + $params;
$hasInternal = array_filter($slides, fn($slide) => !$slide->is_hidden && $slide->isInteractive() && $slide->isPrivate()) !== [];
?>
<?php // Phone/tablet: the sidebar (participation, settings, …) becomes a menu drawer opened from the header, right of the colour scheme switch. ?>
<?php $this->start('headerMenu'); ?>
<button type="button" class="theme-switch menu-toggle" data-drawer-toggle hidden aria-expanded="false" aria-controls="admin-menu"
aria-label="<?= h(__('Menü: Teilnahme, Einstellungen und mehr')) ?>" title="<?= h(__('Menü')) ?>">
<svg class="theme-switch__icon" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M4 6h16M4 12h16M4 18h16"/>
</svg>
</button>
<?php $this->end(); ?>
<div class="admin-head" data-refresh="head" data-live>
<div>
<p class="eyebrow"><?= __('Verwaltung') ?></p>
<h1><?= h($poll->title) ?></h1>
<p class="muted">
<?php if ($poll->is_active) : ?>
<span class="badge badge--ok"><?= __('aktiv') ?></span>
<?php else : ?>
<span class="badge badge--off"><?= __('geschlossen') ?></span>
<?php endif; ?>
<?php if ($poll->isPaused()) : ?>
<span class="badge"><?= __('Pause') ?></span>
<?php endif; ?>
<?= __('{0} Folien', count($slides)) ?>
</p>
</div>
<div class="admin-head__actions">
<div class="split">
<a class="button button--primary split__main" target="_blank" rel="noopener"
href="<?= $this->Url->build($url('admin:present')) ?>">▶ <?= __('Präsentieren') ?></a>
<button type="button" class="button button--primary split__toggle" data-menu-toggle aria-haspopup="true" aria-expanded="false"
aria-controls="present-menu" title="<?= h(__('Weitere Ansichten')) ?>">
<span aria-hidden="true">▾</span><span class="sr-only"><?= __('Weitere Ansichten') ?></span>
</button>
<div class="split__menu" id="present-menu" data-menu hidden>
<a class="split__item" target="_blank" rel="noopener" href="<?= $this->Url->build($url('admin:speaker')) ?>">
⧉ <?= __('Referentenansicht') ?>
<small><?= __('Aktuelle und nächste Folie im eigenen Fenster, startet die Präsentation nicht') ?></small>
</a>
</div>
</div>
<?php if ($poll->current_slide_id !== null) : ?>
<?= $this->Form->postButton('⏸ ' . __('Pause'), $url('admin:control'), [
'data' => ['action' => 'stop'],
'class' => 'button',
'title' => __('Keine Folie zeigen – Teilnehmende sehen eine Pause-Seite'),
]) ?>
<?php endif; ?>
<a class="button" href="#export"><?= __('PDF-Export') ?></a>
</div>
</div>
<div class="notice">
<strong><?= __('Bookmark diese Seite!') ?></strong>
<?= __('Diese URL ist dein Zugang zur Umfrage. Wer sie kennt, kann alles bearbeiten.') ?>
</div>
<div class="grid grid--sidebar"
data-dashboard-live="<?= $this->Url->build($url('admin:live')) ?>"
data-interval="<?= (int)$pollIntervalMs ?>">
<section>
<div class="section-head">
<h2><?= __('Folien') ?></h2>
</div>
<?php if ($slides === []) : ?>
<div class="empty">
<p><?= __('Noch keine Folien. Wähle unten einen Typ, um die erste Frage anzulegen.') ?></p>
</div>
<?php endif; ?>
<div data-refresh="slides" data-live>
<?php if (count($slides) > 1) : ?>
<p class="muted slide-list__hint" data-sortable-hint hidden><?= __('Tipp: Folien am Griff ⠿ ziehen, um die Reihenfolge zu ändern (oder Griff fokussieren und Pfeiltasten nutzen).') ?></p>
<?php endif; ?>
<ol class="slide-list" data-sortable="<?= h($this->Url->build($url('slides:reorder'))) ?>">
<?php foreach ($slides as $i => $slide) :
$isCurrent = $poll->current_slide_id === $slide->id;
$count = $responseCounts[$slide->id] ?? 0;
?>
<li class="slide-item<?= $isCurrent ? ' slide-item--current' : '' ?><?= $slide->is_hidden ? ' slide-item--hidden' : '' ?>" data-slide-id="<?= $slide->id ?>">
<div class="slide-item__lead">
<button type="button" class="drag-handle" data-drag-handle hidden
aria-label="<?= h(__('Folie „{0}“ verschieben (Pfeiltasten)', $slide->question)) ?>"
title="<?= __('Ziehen zum Sortieren') ?>">⠿</button>
<span class="slide-item__pos" data-position><?= $i + 1 ?></span>
</div>
<div class="slide-item__body">
<div class="slide-item__meta">
<span class="badge badge--type-<?= h($slide->type) ?>"><?= h($slide->typeLabel()) ?></span>
<?php if ($isCurrent) : ?><span class="badge badge--live"><?= __('live') ?></span><?php endif; ?>
<?php if ($slide->hasImage()) : ?><span class="badge" title="<?= h(__('Die Folie hat ein Bild')) ?>">🖼 <?= __('Bild') ?></span><?php endif; ?>
<?php if ($slide->is_hidden) : ?><span class="badge badge--off" title="<?= __('Wird beim Präsentieren übersprungen und fehlt im PDF-Export') ?>"><?= __('ausgeblendet') ?></span><?php endif; ?>
<?php if ($slide->isInteractive()) : ?>
<span class="muted"><?= __n('{0} Antwort', '{0} Antworten', $count, $count) ?></span>
<?php if ($slide->isQuiz()) : ?>
<span class="muted">· <?= h([
'ready' => __('Quiz noch nicht gestartet'),
'running' => __('Quiz läuft'),
'finished' => __('Quiz beendet'),
][$slide->quizPhase()]) ?></span>
<?php elseif ($slide->usesPhases()) : ?>
<span class="muted">· ⏱ <?= __('{0} s', (int)$slide->setting('time_limit')) ?> · <?= h([
'ready' => __('noch nicht gestartet'),
'running' => __('Countdown läuft'),
'finished' => __('beendet'),
][$slide->phase()]) ?></span>
<?php elseif ($slide->isQa()) : ?>
<span class="muted">· <?= h([
'collect' => __('Fragen sammeln'),
'vote' => __('Abstimmung läuft'),
'discuss' => __('Fragen werden besprochen'),
][$slide->qaStage()]) ?> · <?php if (!$slide->hasQaUpvotes()) : ?><?= __('ohne Upvotes') ?><?php else :
$perQuestion = (int)$slide->setting('max_upvotes_per_question'); ?>
<?= __('Stimmen für {0} % der Fragen pro Person', (int)$slide->setting('upvote_share')) ?><?= $perQuestion > 0 ? ' · ' . __n('{0} pro Frage', '{0} pro Frage', $perQuestion, $perQuestion) : '' ?><?= $slide->setting('allow_self_upvote') ? ' · ' . __('auch für eigene Fragen') : '' ?>
<?php endif; ?></span>
<?php elseif ($slide->isRanking()) : ?>
<span class="muted">· <?= $slide->is_voting_open ? __('Eigene Einschätzung') : __('Eigene Einschätzung, Abstimmung geschlossen') ?></span>
<?php elseif ($slide->isOrder() && !$slide->is_voting_open) : ?>
<span class="muted">· <?= __('Abstimmung geschlossen, aufgelöst') ?></span>
<?php elseif (!$slide->is_voting_open) : ?><span class="muted">· <?= __('Abstimmung geschlossen') ?></span><?php endif; ?>
<?php if ($slide->hasComments()) : ?><span class="badge" title="<?= __('Teilnehmende können einen Kommentar abgeben') ?>">💬 <?= __('Kommentare') ?></span><?php endif; ?>
<?php if ($slide->isPrivate()) : ?><span class="badge" title="<?= __('In der Präsentation zunächst verborgen, für Teilnehmende nie sichtbar') ?>">🔒 <?= $slide->type === 'scale' ? __('intern') : __('anonym') ?></span><?php endif; ?>
<?php endif; ?>
</div>
<a class="slide-item__title" data-modal href="<?= $this->Url->build($url('slides:edit', ['id' => $slide->id])) ?>"><?= h($slide->question) ?></a>
<?php if ($slide->type === 'choice' && $slide->slide_options) : ?>
<p class="slide-item__options muted"><?= h(implode(' · ', array_map(fn($o) => $o->label, $slide->slide_options))) ?></p>
<?php elseif ($slide->isQuiz() && $slide->slide_options) : ?>
<p class="slide-item__options muted"><?= h(implode(' · ', array_map(
fn($o) => $o->is_correct ? '✓ ' . $o->label : $o->label,
$slide->slide_options,
))) ?></p>
<?php elseif ($slide->isOrder() && $slide->slide_options) : ?>
<p class="slide-item__options muted"><?= h(implode($slide->isRanking() ? ' · ' : ' → ', array_map(
fn($o) => $o->label,
$slide->slide_options,
))) ?></p>
<?php endif; ?>
<details class="slide-embed">
<summary><?= __('Einbett-Link') ?></summary>
<div class="copy-field">
<input type="text" readonly data-copy-source
value="<?= h($this->Url->build(['_name' => 'embed', 'key' => $embedKey, 'id' => $slide->id], ['fullBase' => true])) ?>"
aria-label="<?= h(__('Einbett-Link für Folie „{0}“', $slide->question)) ?>">
<button type="button" class="button button--small" data-copy><?= __('Kopieren') ?></button>
</div>
</details>
</div>
<div class="slide-item__actions">
<?php if (!$isCurrent && !$slide->is_hidden) : ?>
<?= $this->Form->postButton('▶', $url('admin:control'), [
'data' => ['action' => 'goto', 'slide_id' => $slide->id],
'class' => 'button button--small button--icon',
'title' => __('Live: diese Folie jetzt den Teilnehmenden zeigen'),
'aria-label' => __('Folie „{0}“ live schalten', $slide->question),
]) ?>
<?php endif; ?>
<?php if (($slide->type === 'open' || $slide->isPrivate() || $slide->hasComments()) && $count > 0) :
$answersLabel = match ($slide->type) {
'scale' => __('Auswertung'),
'choice' => __('Kommentare'),
default => __('Antworten'),
}; ?>
<a class="button button--small button--icon" data-modal href="<?= $this->Url->build($url('slides:answers', ['id' => $slide->id])) ?>"
title="<?= h($answersLabel) ?>" aria-label="<?= h(__('{0} der Folie „{1}“ ansehen', $answersLabel, $slide->question)) ?>">📊</a>
<?php endif; ?>
<a class="button button--small button--icon" data-modal href="<?= $this->Url->build($url('slides:edit', ['id' => $slide->id])) ?>"
title="<?= __('Bearbeiten') ?>" aria-label="<?= h(__('Folie „{0}“ bearbeiten', $slide->question)) ?>">✎</a>
<?= $this->Form->postButton('⧉', $url('slides:duplicate', ['id' => $slide->id]), [
'class' => 'button button--small button--icon',
'title' => __('Duplizieren: Kopie direkt dahinter anlegen (ohne Antworten)'),
'aria-label' => __('Folie „{0}“ duplizieren', $slide->question),
]) ?>
<?php if ($slide->is_hidden) : ?>
<?= $this->Form->postButton('👁', $url('slides:visibility', ['id' => $slide->id]), [
'data' => ['hidden' => 0],
'class' => 'button button--small button--icon',
'title' => __('Einblenden: Folie wieder in die Präsentation aufnehmen'),
'aria-label' => __('Folie „{0}“ einblenden', $slide->question),
]) ?>
<?php else : ?>
<?= $this->Form->postButton('⊘', $url('slides:visibility', ['id' => $slide->id]), [
'data' => ['hidden' => 1],
'class' => 'button button--small button--icon',
'title' => __('Ausblenden: Folie behalten, aber beim Präsentieren überspringen'),
'aria-label' => __('Folie „{0}“ ausblenden', $slide->question),
'data-confirm' => $isCurrent ? __('Diese Folie ist gerade live. Ausblenden und die Umfrage pausieren?') : null,
]) ?>
<?php endif; ?>
<?php if ($count > 0 || !$slide->isFresh()) : ?>
<?= $this->Form->postButton('↺', $url('slides:reset', ['id' => $slide->id]), [
'class' => 'button button--small button--icon',
'title' => __('Zurücksetzen: Antworten löschen und Folie wie neu starten'),
'aria-label' => __('Folie „{0}“ zurücksetzen', $slide->question),
'data-confirm' => $count > 0
? __('Alle {0} Antworten dieser Folie löschen und die Folie zurücksetzen?', $count)
: __('Folie zurücksetzen?'),
]) ?>
<?php endif; ?>
<?= $this->Form->postButton('🗑', $url('slides:delete', ['id' => $slide->id]), [
'class' => 'button button--small button--icon button--danger',
'title' => __('Löschen'),
'aria-label' => __('Folie „{0}“ löschen', $slide->question),
'data-confirm' => __('Folie „{0}“ inkl. aller Antworten löschen?', $slide->question),
]) ?>
</div>
</li>
<?php endforeach; ?>
</ol>
<p class="sr-only" role="status" aria-live="polite" data-sortable-status></p>
</div>
<h3><?= __('Neue Folie') ?></h3>
<div class="type-picker">
<?php foreach ($typeLabels as $type => $label) : ?>
<a class="type-card type-card--<?= h($type) ?>" data-modal href="<?= $this->Url->build($url('slides:add', ['?' => ['type' => $type]])) ?>">
<strong><?= h($label) ?></strong>
<span><?= h($typeDescriptions[$type]) ?></span>
</a>
<?php endforeach; ?>
</div>
</section>
<aside class="sidebar" id="admin-menu" aria-label="<?= h(__('Menü')) ?>">
<div class="sidebar__bar" data-drawer-bar>
<strong><?= __('Menü') ?></strong>
<button type="button" class="modal__close sidebar__close" data-drawer-close
aria-label="<?= h(__('Menü schließen')) ?>" title="<?= h(__('Schließen (Esc)')) ?>">✕</button>
</div>
<details class="card collapsible" open>
<summary><h2><?= __('Teilnahme') ?></h2></summary>
<p class="join-code"><?= h($poll->formattedJoinCode()) ?></p>
<div class="qr-wrap">
<img class="qr" src="<?= $this->Url->build($url('admin:qr')) ?>" alt="<?= __('QR-Code zur Teilnahme') ?>" width="160" height="160">
<button type="button" class="button button--small qr-wrap__download" data-qr-download
data-filename="plenario-qr-<?= h($poll->join_code) ?>.png" hidden><?= __('Als PNG speichern') ?></button>
</div>
<div class="copy-field">
<input type="text" readonly value="<?= h($joinUrl) ?>" aria-label="<?= __('Teilnahme-Link') ?>" data-copy-source>
<button type="button" class="button button--small" data-copy><?= __('Kopieren') ?></button>
</div>
</details>
<details class="card collapsible" open>
<summary><h2><?= __('Einstellungen') ?></h2></summary>
<?= $this->Form->create($poll, ['url' => $url('admin:settings'), 'type' => 'post']) ?>
<?= $this->Form->control('title', ['label' => __('Titel'), 'maxlength' => 200]) ?>
<?= $this->Form->control('is_active', [
'type' => 'checkbox',
'label' => __('Umfrage ist aktiv (Teilnehmende können abstimmen)'),
]) ?>
<?= $this->Form->control('comment_speed', [
'type' => 'select',
'label' => __('Tempo der Kommentare in der Präsentation'),
'options' => [
50 => __('Viel langsamer (doppelt so lange)'),
75 => __('Langsamer'),
100 => __('Normal'),
125 => __('Schneller'),
150 => __('Deutlich schneller'),
200 => __('Sehr schnell (halb so lange)'),
],
'aria-describedby' => 'comment-speed-hint',
]) ?>
<p class="hint" id="comment-speed-hint"><?= __('Gilt für die Kommentare von Skala-Folien, die nacheinander durchlaufen. Die Anzeigedauer richtet sich weiter nach der Textlänge und wird mit diesem Faktor verkürzt oder verlängert.') ?></p>
<?= $this->Form->button(__('Speichern'), ['class' => 'button']) ?>
<?= $this->Form->end() ?>
<section class="card-section">
<h3 id="audio"><?= __('Musik zum Quiz-Countdown') ?></h3>
<?php
$audioMb = (int)round((int)\Cake\Core\Configure::read('Plenario.audio.maxUploadBytes', 10 * 1024 * 1024) / 1024 / 1024);
$audioUrl = $poll->hasAudio()
? $this->Url->build(['_name' => 'participate:audio', 'code' => $poll->join_code, 'file' => $poll->audio])
: null;
?>
<p class="hint" id="audio-hint"><?= __('Läuft in der Präsentation, solange ein Quiz läuft, und wiederholt sich bei Bedarf. Teilnehmende hören nichts.') ?></p>
<?= $this->Form->create(null, ['url' => $url('admin:audio'), 'type' => 'file', 'class' => 'image-fields', 'data-audio-form' => '']) ?>
<input type="file" id="audio-file" name="audio" class="sr-only" aria-describedby="audio-hint"
accept="audio/mpeg,audio/mp4,audio/ogg,audio/wav,.mp3,.m4a,.ogg,.wav">
<?php if ($audioUrl === null) : ?>
<label class="image-drop image-drop--compact" for="audio-file" data-audio-drop>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6"
stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M9 18V5l11-2v13"/><circle cx="6.5" cy="18" r="2.5"/><circle cx="17.5" cy="16" r="2.5"/>
</svg>
<span class="image-drop__title"><?= __('Audiodatei auswählen') ?><span data-audio-drop-extra hidden> <?= __('oder hierher ziehen') ?></span></span>
<span class="image-drop__hint"><?= __('MP3, M4A, OGG, WAV · bis {0} MB', $audioMb) ?></span>
</label>
<?php else : ?>
<div class="image-fields__row audio-row" data-audio-drop>
<audio controls preload="none" class="audio-row__player" src="<?= h($audioUrl) ?>"></audio>
<div class="image-fields__buttons">
<label class="button button--small" for="audio-file"><?= __('Ersetzen') ?></label>
<button type="submit" name="remove" value="1" class="button button--danger button--small"
data-confirm="<?= h(__('Die Audiodatei entfernen?')) ?>"><?= __('Entfernen') ?></button>
</div>
</div>
<?php endif; ?>
<?php // Without JavaScript the chosen file is sent with this button; with it, choosing a file sends it right away. ?>
<button type="submit" class="button button--small" data-audio-submit><?= __('Hochladen') ?></button>
<?= $this->Form->end() ?>
</section>
<section class="card-section">
<h3 id="embed"><?= __('In Präsentation einbetten') ?></h3>
<p class="hint"><?= __('Jede Folie hat einen eigenen Einbett-Link (unter „Einbett-Link“ in der Folienliste). Füge ihn z. B. in Canva als Einbettung auf einer Folie ein.') ?></p>
<p class="hint"><?= __('Sobald die eingebettete Folie im Vortrag zu sehen ist, wird sie live geschaltet. Bei allen anderen Folien sehen Teilnehmende eine Pause-Seite.') ?></p>
<p class="hint"><?= __('Der Link zeigt nur diese Folie und kann sie live schalten – die Umfrage bearbeiten kann damit niemand.') ?></p>
<?= $this->Form->postButton(__('Neue Einbett-Links erzeugen'), $url('admin:rotate-embed'), [
'class' => 'button button--small',
'data-confirm' => __('Neue Einbett-Links erzeugen? Alle bisher eingebetteten Folien funktionieren danach nicht mehr.'),
]) ?>
</section>
<section class="card-section">
<h3 id="clone"><?= __('Umfrage kopieren') ?></h3>
<p class="hint"><?= __('Legt eine neue Umfrage mit allen Folien, Einstellungen und Bildern an – ohne Antworten und noch nicht gestartet. Die Kopie bekommt einen eigenen Teilnahme-Code und Admin-Link, der an dieselbe E-Mail-Adresse geschickt wird.') ?></p>
<?= $this->Form->postButton(__('Umfrage kopieren'), $url('admin:clone'), [
'class' => 'button button--small',
'data-confirm' => __('Die Umfrage mit allen Folien (ohne Antworten) kopieren?'),
]) ?>
</section>
</details>
<details class="card collapsible" id="export">
<summary><h2><?= __('Ergebnisse als PDF') ?></h2></summary>
<p class="hint"><?= __('Alle Folien mit Abstimmung und ihre Ergebnisse in einem Dokument, z. B. fürs Protokoll.') ?></p>
<?= $this->Form->create(null, ['url' => $url('admin:export'), 'type' => 'get']) ?>
<?php if ($hasInternal) : ?>
<fieldset class="export-choice">
<legend><?= __('Welche Fassung?') ?></legend>
<label>
<input type="radio" name="internal" value="0" checked>
<span>
<strong><?= __('Ohne interne Inhalte') ?></strong>
<span class="hint"><?= __('Zum Weitergeben. Bei anonymem bzw. internem Feedback steht nur, wie viele teilgenommen haben.') ?></span>
</span>
</label>
<label>
<input type="radio" name="internal" value="1">
<span>
<strong><?= __('Vollständig, inkl. interner Inhalte') ?></strong>
<span class="hint"><?= __('Enthält anonyme Antworten und interne Bewertungen samt Kommentaren. Nur für dich, nicht weitergeben.') ?></span>
</span>
</label>
</fieldset>
<?php endif; ?>
<?= $this->Form->button(__('PDF herunterladen'), ['class' => 'button']) ?>
<?= $this->Form->end() ?>
</details>
<details class="card card--danger collapsible">
<summary><h2><?= __('Sicherheit') ?></h2></summary>
<?php if ($poll->expiresAt() !== null) : ?>
<p class="hint"><?= __('Diese Umfrage wird am {0} automatisch gelöscht. Sichere die Ergebnisse vorher als PDF.', h($poll->expiresAt()->i18nFormat('dd.MM.yyyy'))) ?></p>
<?php endif; ?>
<p class="hint"><?= __('Link versehentlich geteilt? Erzeuge einen neuen – der alte wird sofort ungültig.') ?></p>
<?= $this->Form->postButton(__('Neuen Admin-Link erzeugen'), $url('admin:rotate'), [
'class' => 'button button--small',
'data-confirm' => __('Neuen Admin-Link erzeugen? Der aktuelle Link funktioniert danach nicht mehr.'),
]) ?>
<h3><?= __('Umfrage zurücksetzen') ?></h3>
<p class="hint"><?= __('Löscht alle Antworten aller Folien und setzt die Präsentation auf „nicht gestartet“ zurück, z. B. für eine neue Gruppe. Folien und Einstellungen bleiben erhalten.') ?></p>
<?php if ($canReset) : ?>
<?php if ($responseCounts !== []) : ?>
<p class="hint"><?= $this->Html->link(__('Ergebnisse vorher als PDF sichern'), '#export') ?></p>
<?php endif; ?>
<?= $this->Form->create(null, ['url' => $url('admin:reset')]) ?>
<?php if ($hasPrepared) : ?>
<?= $this->Form->control('keep_prepared', [
'type' => 'checkbox',
'checked' => true,
'label' => __('Vorab eingetragene Fragen (Fragen & Antworten) behalten'),
]) ?>
<?php endif; ?>
<?= $this->Form->button(__('Umfrage zurücksetzen'), [
'class' => 'button button--small button--danger',
'data-confirm' => $responseCounts !== []
? __('Umfrage zurücksetzen? Alle Antworten aller Folien werden unwiderruflich gelöscht und die Präsentation wird auf „nicht gestartet“ gestellt.')
: __('Alle Folien zurücksetzen und die Präsentation auf „nicht gestartet“ stellen?'),
]) ?>
<?= $this->Form->end() ?>
<?php else : ?>
<p class="hint"><em><?= __('Noch nichts zurückzusetzen: keine Antworten, alle Folien im Ausgangszustand, Präsentation nicht gestartet.') ?></em></p>
<?php endif; ?>
<h3><?= __('Umfrage löschen') ?></h3>
<?= $this->Form->create(null, ['url' => $url('admin:delete')]) ?>
<?= $this->Form->control('confirm_code', [
'label' => __('Zum Bestätigen Code {0} eingeben', $poll->join_code),
'autocomplete' => 'off',
'required' => true,
]) ?>
<?= $this->Form->button(__('Endgültig löschen'), ['class' => 'button button--danger']) ?>
<?= $this->Form->end() ?>
</details>
</aside>
</div>
<div class="drawer-backdrop" data-drawer-close aria-hidden="true"></div>
<?php // Slide form in a dialog (loaded via fetch, see [data-modal] in plenario.js); without JS the links open the full page. ?>
<dialog class="modal" data-modal-dialog aria-labelledby="modal-title">
<button type="button" class="modal__close" data-modal-close
aria-label="<?= h(__('Schließen')) ?>" title="<?= h(__('Schließen (Esc)')) ?>">✕</button>
<div class="modal__panel" data-modal-panel>
<div data-modal-body></div>
</div>
</dialog>