Add a speaker view with a next-slide preview and keep the live slide in view
CI / Deploy / PHP 8.4 (push) Successful in 1m11s
CI / Deploy / PHP 8.5 (push) Successful in 1m13s
CI / Deploy / test (push) Successful in 2s
CI / Deploy / deploy (push) Skipped

- New /admin/{token}/speaker page for a second window: current slide, preview of
  the next slide and the usual controls. It does not start the presentation.
- The presenter state gets `next` (labels only, no solutions).
- The dashboard scrolls the live slide into view when the presenter moves on.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Sonnet 5.5 committed 2026-11-16 15:43:49 +01:00
1 parent 8262411225
commit 66ed198f87
11 files changed
+264 -5

No files matched your search

+2
View File
@@ -37,6 +37,8 @@ $hasInternal = array_filter($slides, fn($slide) => !$slide->is_hidden && $slide-
<div class="admin-head__actions">
<a class="button button--primary" target="_blank" rel="noopener"
href="<?= $this->Url->build($url('admin:present')) ?>">▶ <?= __('Präsentieren') ?></a>
<a class="button" target="_blank" rel="noopener" href="<?= $this->Url->build($url('admin:speaker')) ?>"
title="<?= h(__('Eigenes Fenster für den Präsentierenden: aktuelle und nächste Folie, ohne die Präsentation zu starten')) ?>">⧉ <?= __('Referentenansicht') ?></a>
<?php if ($poll->current_slide_id !== null) : ?>
<?= $this->Form->postButton('⏸ ' . __('Pause'), $url('admin:control'), [
'data' => ['action' => 'stop'],
+20 -1
View File
@@ -4,6 +4,7 @@
* (Plenario.presenter) from /admin/{token}/state.
*
* Keyboard: ←/→ slides, P pause/resume (→ resumes too), V voting on/off, H hide results, F fullscreen, Q QR code, T light/dark.
* The speaker view (admin:speaker) is this page plus a preview of the next slide, meant for the presenter's own screen.
* Q&A slides: V switches to the next stage; while discussing ←/→ step through the questions first.
*
* @var \App\View\AppView $this
@@ -12,11 +13,13 @@
* @var string $joinUrl
* @var string $joinBaseUrl
* @var int $pollIntervalMs
* @var bool|null $speaker Speaker view (second window): adds the preview of the next slide
*/
$speaker = $speaker ?? false;
$this->assign('title', $poll->title);
$host = preg_replace('#^https?://#', '', $joinBaseUrl);
?>
<div class="stage"
<div class="stage<?= $speaker ? ' stage--speaker' : '' ?>"
data-presenter
data-state-url="<?= $this->Url->build(['_name' => 'admin:state', 'token' => $adminToken]) ?>"
data-control-url="<?= $this->Url->build(['_name' => 'admin:control', 'token' => $adminToken]) ?>"
@@ -42,8 +45,24 @@ $host = preg_replace('#^https?://#', '', $joinBaseUrl);
<div class="stage__results" data-results></div>
</main>
<?php if ($speaker) : ?>
<aside class="stage__next" data-next aria-label="<?= h(__('Nächste Folie')) ?>">
<p class="stage__next-label"><?= __('Als Nächstes') ?> <span data-next-meta></span></p>
<h2 class="stage__next-question" data-next-question></h2>
<div class="stage__next-description formatted" data-next-description></div>
<ul class="stage__next-options" data-next-options></ul>
<p class="stage__next-note muted" data-next-note></p>
</aside>
<?php endif; ?>
<footer class="stage__controls">
<a class="ctrl" href="<?= $this->Url->build(['_name' => 'admin', 'token' => $adminToken]) ?>" title="<?= __('Zur Verwaltung') ?>">✎</a>
<?php if (!$speaker) : ?>
<a class="ctrl" href="<?= $this->Url->build(['_name' => 'admin:speaker', 'token' => $adminToken]) ?>" target="_blank" rel="noopener"
title="<?= __('Referentenansicht in neuem Fenster öffnen (mit Vorschau der nächsten Folie)') ?>">
<span aria-hidden="true">⧉</span><span class="sr-only"><?= __('Referentenansicht öffnen') ?></span>
</a>
<?php endif; ?>
<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>