Slides (except YouTube) can carry one image. Uploads are validated, rotated by EXIF orientation, scaled to 1600 px and stored as WebP outside webroot, which also strips camera metadata. Images have an alt text (or are marked decorative) and a layout: top, side or full screen (content slides). Files are removed after the commit when a slide is deleted or its image is replaced, with the poll, and `bin/cake images_cleanup` sweeps leftovers. Duplicated slides get their own file. Docker image gains gd with WebP. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
68 lines
3.0 KiB
PHP
68 lines
3.0 KiB
PHP
<?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__status" data-status></p>
|
||
<h1 class="stage__question" data-question><?= h($slide->question) ?></h1>
|
||
<div class="stage__description formatted" data-description></div>
|
||
<div class="stage__media" data-media hidden></div>
|
||
<figure class="stage__image" data-image hidden></figure>
|
||
<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>
|