Files
Plenario/templates/Admin/present.php
T
gnilebeinandClaude Opus 5.5 0ca36b8ec6
CI / Deploy / test (push) Successful in 47s
CI / Deploy / deploy (push) Skipped
Show keyboard shortcuts on presenter controls
Tooltips are useless while presenting, so the controls now show their
shortcut as [V], [H], [F] and [Q]; the QR overlay hints at [Esc].
Labels of dynamic buttons live in a [data-label] span so the hint
survives updates. Shortcuts are exposed via aria-keyshortcuts and hidden
on touch-only devices.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 14:45:34 +01:00

70 lines
3.7 KiB
PHP
Raw 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
/**
* Presenter screen. Rendered empty and filled by webroot/js/plenario.js
* (Plenario.presenter) from /admin/{token}/state.
*
* Keyboard: ←/→ slides, V voting on/off, H hide results, F fullscreen, Q QR code.
*
* @var \App\View\AppView $this
* @var \App\Model\Entity\Poll $poll
* @var string $adminToken
* @var string $joinUrl
* @var string $joinBaseUrl
* @var int $pollIntervalMs
*/
$this->assign('title', $poll->title);
$host = preg_replace('#^https?://#', '', $joinBaseUrl);
?>
<div class="stage"
data-presenter
data-state-url="<?= $this->Url->build(['_name' => 'admin:state', 'token' => $adminToken]) ?>"
data-control-url="<?= $this->Url->build(['_name' => 'admin:control', 'token' => $adminToken]) ?>"
data-interval="<?= (int)$pollIntervalMs ?>">
<header class="stage__top">
<div class="stage__join">
<?= __('Mitmachen auf') ?> <strong><?= h($host) ?></strong>
<?= __('mit Code') ?> <strong class="stage__code"><?= h($poll->formattedJoinCode()) ?></strong>
</div>
<button type="button" class="stage__qr" data-qr-toggle aria-keyshortcuts="Q" title="<?= __('QR-Code vergrößern (Q)') ?>">
<img src="<?= $this->Url->build(['_name' => 'admin:qr', 'token' => $adminToken]) ?>" alt="<?= __('QR-Code') ?>">
<kbd class="ctrl__key" aria-hidden="true">[Q]</kbd>
</button>
</header>
<main class="stage__main">
<p class="stage__type" data-type></p>
<h1 class="stage__question" data-question><?= __('Lade …') ?></h1>
<p class="stage__description" data-description></p>
<div class="stage__results" data-results></div>
</main>
<footer class="stage__controls">
<a class="ctrl" href="<?= $this->Url->build(['_name' => 'admin', 'token' => $adminToken]) ?>" title="<?= __('Zur Verwaltung') ?>">✎</a>
<button type="button" class="ctrl" data-action="prev" aria-keyshortcuts="ArrowLeft PageUp" title="<?= __('Vorherige Folie (←)') ?>">
<span aria-hidden="true">←</span><span class="sr-only"><?= __('Vorherige Folie') ?></span>
</button>
<span class="ctrl-counter" data-counter>–</span>
<button type="button" class="ctrl" data-action="next" aria-keyshortcuts="ArrowRight PageDown Space" title="<?= __('Nächste Folie (→ oder Leertaste)') ?>">
<span aria-hidden="true">→</span><span class="sr-only"><?= __('Nächste Folie') ?></span>
</button>
<button type="button" class="ctrl ctrl--wide" data-action="toggle" data-voting aria-keyshortcuts="V" title="<?= __('Abstimmung öffnen/schließen (V)') ?>">
<span data-label></span> <kbd class="ctrl__key" aria-hidden="true">[V]</kbd>
</button>
<button type="button" class="ctrl ctrl--wide" data-hide-results aria-keyshortcuts="H" title="<?= __('Ergebnisse ein-/ausblenden (H)') ?>">
<span data-label><?= __('Ergebnisse verbergen') ?></span> <kbd class="ctrl__key" aria-hidden="true">[H]</kbd>
</button>
<span class="ctrl-counter" data-participants></span>
<button type="button" class="ctrl" data-fullscreen aria-keyshortcuts="F" title="<?= __('Vollbild (F)') ?>">
<span aria-hidden="true">⛶</span><span class="sr-only"><?= __('Vollbild') ?></span>
<kbd class="ctrl__key" aria-hidden="true">[F]</kbd>
</button>
</footer>
<div class="qr-overlay" data-qr-overlay hidden>
<img src="<?= $this->Url->build(['_name' => 'admin:qr', 'token' => $adminToken]) ?>" alt="<?= __('QR-Code') ?>">
<p><?= h($joinUrl) ?></p>
<p class="qr-overlay__hint"><kbd class="ctrl__key">[Esc]</kbd> <?= __('oder Klick zum Schließen') ?></p>
</div>
</div>