Add admin menu drawer and poll cloning, drop participant screen tools
- Remove fullscreen and wake lock buttons from the participant view. - Turn the admin sidebar into a drawer below 900px, opened from a header menu button next to the theme switch (progressive enhancement). - Add "Umfrage kopieren": clone a poll with all slides, options and images but without responses, with its own join code and admin link. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0f91377de3
commit
bd57f23be6
15 files changed
+374
-138
No files matched your search
@@ -18,6 +18,16 @@ $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>
|
||||
@@ -226,7 +236,12 @@ $hasInternal = array_filter($slides, fn($slide) => !$slide->is_hidden && $slide-
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<aside class="sidebar">
|
||||
<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>
|
||||
@@ -305,6 +320,15 @@ $hasInternal = array_filter($slides, fn($slide) => !$slide->is_hidden && $slide-
|
||||
]) ?>
|
||||
</details>
|
||||
|
||||
<details class="card collapsible" id="clone">
|
||||
<summary><h2><?= __('Umfrage kopieren') ?></h2></summary>
|
||||
<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?'),
|
||||
]) ?>
|
||||
</details>
|
||||
|
||||
<details class="card card--danger collapsible">
|
||||
<summary><h2><?= __('Sicherheit') ?></h2></summary>
|
||||
<?php if ($poll->expiresAt() !== null) : ?>
|
||||
@@ -354,6 +378,8 @@ $hasInternal = array_filter($slides, fn($slide) => !$slide->is_hidden && $slide-
|
||||
</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
|
||||
|
||||
@@ -40,27 +40,6 @@ $countdown = function (?int $remaining): string {
|
||||
|
||||
<p class="eyebrow eyebrow--poll center"><?= h($poll->title) ?></p>
|
||||
|
||||
<?php // Icon buttons in the header, next to the theme switch. Hidden unless the browser supports the API (no fullscreen on iPhone). ?>
|
||||
<?php $this->start('headerTools'); ?>
|
||||
<button type="button" class="theme-switch" data-fullscreen-toggle hidden aria-pressed="false"
|
||||
data-label-on="<?= h(__('Vollbild beenden')) ?>" data-label-off="<?= h(__('Vollbild')) ?>"
|
||||
aria-label="<?= h(__('Vollbild')) ?>" title="<?= h(__('Vollbild')) ?>">
|
||||
<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 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5"/>
|
||||
</svg>
|
||||
</button>
|
||||
<button type="button" class="theme-switch" data-wakelock-toggle hidden aria-pressed="false"
|
||||
data-label-on="<?= h(__('Display bleibt an – tippen zum Ausschalten')) ?>"
|
||||
data-label-off="<?= h(__('Display bleibt nicht an – tippen zum Anlassen')) ?>"
|
||||
aria-label="<?= h(__('Display anlassen')) ?>" title="<?= h(__('Display anlassen')) ?>">
|
||||
<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="M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z"/><circle cx="12" cy="12" r="3"/>
|
||||
</svg>
|
||||
</button>
|
||||
<?php $this->end(); ?>
|
||||
|
||||
<?php if (!$poll->is_active) : ?>
|
||||
<section class="card center">
|
||||
<h1><?= __('Diese Umfrage ist geschlossen.') ?></h1>
|
||||
|
||||
@@ -33,8 +33,8 @@ $title = $this->fetch('title');
|
||||
<a href="<?= $this->Url->build(['_name' => 'recover']) ?>"><?= __('Admin-Link verloren?') ?></a>
|
||||
</nav>
|
||||
<div class="header-tools">
|
||||
<?= $this->fetch('headerTools') ?>
|
||||
<?= $this->element('theme_switch') ?>
|
||||
<?= $this->fetch('headerMenu') ?>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
Reference in new issue
Block a user