Add embeddable slides and pause mode
Every slide gets an embed URL /e/{key}/{id} for presentation software
like Canva. The page goes live while it is visible, keeps itself live
with heartbeats and pauses when it disappears; stale embeds are paused
lazily. The embed key is separate from the admin token and only allows
showing, activating, pausing and voting controls of that slide.
Participants see a pause page while no slide is live. The presenter
can pause (P) and resume the paused slide with the arrow keys; the
dashboard has a pause button.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
58145e9753
commit
07a292d109
19 files changed
+1116
-68
No files matched your search
@@ -10,6 +10,7 @@
|
||||
* @var array<string, string> $typeLabels
|
||||
* @var array<string, string> $typeDescriptions
|
||||
* @var string $joinUrl
|
||||
* @var string $embedKey
|
||||
*/
|
||||
$this->assign('title', $poll->title);
|
||||
$this->assign('noindex', '1');
|
||||
@@ -25,12 +26,22 @@ $url = fn(string $name, array $params = []) => ['_name' => $name, 'token' => $ad
|
||||
<?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">
|
||||
<a class="button button--primary" target="_blank" rel="noopener"
|
||||
href="<?= $this->Url->build($url('admin:present')) ?>">▶ <?= __('Präsentieren') ?></a>
|
||||
<?php if ($poll->current_slide_id !== null) : ?>
|
||||
<?= $this->Form->postLink('⏸ ' . __('Pause'), $url('admin:control'), [
|
||||
'data' => ['action' => 'stop'],
|
||||
'class' => 'button',
|
||||
'title' => __('Keine Folie zeigen – Teilnehmende sehen eine Pause-Seite'),
|
||||
]) ?>
|
||||
<?php endif; ?>
|
||||
<a class="button" href="<?= $this->Url->build($url('admin:export')) ?>"><?= __('CSV-Export') ?></a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -97,6 +108,15 @@ $url = fn(string $name, array $params = []) => ['_name' => $name, 'token' => $ad
|
||||
$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) : ?>
|
||||
@@ -145,6 +165,17 @@ $url = fn(string $name, array $params = []) => ['_name' => $name, 'token' => $ad
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="card" id="embed">
|
||||
<h2><?= __('In Präsentation einbetten') ?></h2>
|
||||
<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->postLink(__('Neue Einbett-Links erzeugen'), $url('admin:rotate-embed'), [
|
||||
'class' => 'button button--small',
|
||||
'confirm' => __('Neue Einbett-Links erzeugen? Alle bisher eingebetteten Folien funktionieren danach nicht mehr.'),
|
||||
]) ?>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h2><?= __('Einstellungen') ?></h2>
|
||||
<?= $this->Form->create($poll, ['url' => $url('admin:settings'), 'type' => 'post']) ?>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* 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, T light/dark.
|
||||
* Keyboard: ←/→ slides, P pause (→ resumes), V voting on/off, H hide results, F fullscreen, Q QR code, T light/dark.
|
||||
* Q&A slides: V switches to the next stage; while discussing ←/→ step through the questions first.
|
||||
*
|
||||
* @var \App\View\AppView $this
|
||||
@@ -50,6 +50,10 @@ $host = preg_replace('#^https?://#', '', $joinBaseUrl);
|
||||
<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" data-action="stop" aria-keyshortcuts="P" title="<?= __('Pause: Teilnehmende sehen eine Pause-Seite (P)') ?>">
|
||||
<span aria-hidden="true">⏸</span><span class="sr-only"><?= __('Pause') ?></span>
|
||||
<kbd class="ctrl__key" aria-hidden="true">[P]</kbd>
|
||||
</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>
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* One slide embedded in other presentation software (e.g. Canva), /e/{key}/{id}.
|
||||
* Same stage as the presenter screen (filled by webroot/js/plenario.js, presenter in
|
||||
* embed mode via [data-embed]), but only for this slide and without slide navigation –
|
||||
* the surrounding presentation does that. Goes live while visible, see EmbedController.
|
||||
*
|
||||
* Keyboard (when the embed has focus): V voting on/off, H hide results, T light/dark.
|
||||
*
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\Poll $poll
|
||||
* @var \App\Model\Entity\Slide $slide
|
||||
* @var array<string, string> $urls state, activate, heartbeat, pause, control
|
||||
* @var string $joinBaseUrl
|
||||
* @var int $pollIntervalMs
|
||||
* @var int $heartbeatMs
|
||||
*/
|
||||
$this->assign('title', $slide->question);
|
||||
$host = preg_replace('#^https?://#', '', $joinBaseUrl);
|
||||
?>
|
||||
<div class="stage stage--embed"
|
||||
data-presenter
|
||||
data-embed
|
||||
data-state-url="<?= h($urls['state']) ?>"
|
||||
data-control-url="<?= h($urls['control']) ?>"
|
||||
data-activate-url="<?= h($urls['activate']) ?>"
|
||||
data-heartbeat-url="<?= h($urls['heartbeat']) ?>"
|
||||
data-pause-url="<?= h($urls['pause']) ?>"
|
||||
data-interval="<?= (int)$pollIntervalMs ?>"
|
||||
data-heartbeat="<?= (int)$heartbeatMs ?>">
|
||||
|
||||
<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>
|
||||
<span class="live-indicator" data-live role="status" aria-live="polite"></span>
|
||||
</header>
|
||||
|
||||
<main class="stage__main">
|
||||
<p class="stage__type" data-type></p>
|
||||
<h1 class="stage__question" data-question><?= h($slide->question) ?></h1>
|
||||
<p class="stage__description" data-description></p>
|
||||
<div class="stage__media" data-media hidden></div>
|
||||
<div class="stage__results" data-results></div>
|
||||
</main>
|
||||
|
||||
<footer class="stage__controls">
|
||||
<button type="button" class="ctrl ctrl--wide" data-go-live hidden title="<?= __('Diese Folie den Teilnehmenden zeigen') ?>">
|
||||
<?= __('Live schalten') ?>
|
||||
</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>
|
||||
<?= $this->element('theme_switch', [
|
||||
'key' => 'plenario-theme-present',
|
||||
'modes' => 'dark,light',
|
||||
'class' => 'ctrl ctrl--wide',
|
||||
'shortcut' => 'T',
|
||||
]) ?>
|
||||
</footer>
|
||||
</div>
|
||||
@@ -41,6 +41,13 @@ $countdown = function (?int $remaining): string {
|
||||
<p class="muted"><?= __('Danke fürs Vorbeischauen!') ?></p>
|
||||
</section>
|
||||
|
||||
<?php elseif ($slide === null && $poll->isPaused()) : ?>
|
||||
<section class="card center waiting waiting--pause">
|
||||
<div class="pulse" aria-hidden="true"></div>
|
||||
<h1><?= __('Kurze Pause') ?></h1>
|
||||
<p class="muted"><?= __('Gerade ist keine Frage aktiv. Sobald es weitergeht, erscheint sie hier automatisch – du musst nichts tun.') ?></p>
|
||||
</section>
|
||||
|
||||
<?php elseif ($slide === null) : ?>
|
||||
<section class="card center waiting">
|
||||
<div class="pulse" aria-hidden="true"></div>
|
||||
|
||||
Reference in new issue
Block a user