Files
Plenario/templates/Admin/present.php
T

107 lines
6.1 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, 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
* @var \App\Model\Entity\Poll $poll
* @var string $adminToken
* @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<?= $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]) ?>"
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">
<?php if ($speaker) : ?>
<p class="stage__label"><?= __('Aktuelle Folie') ?></p>
<?php endif; ?>
<p class="stage__status" data-status></p>
<h1 class="stage__question" data-question><?= __('Lade …') ?></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>
<?php if ($speaker) : ?>
<aside class="stage__next" data-next aria-label="<?= h(__('Nächste Folie')) ?>">
<p class="stage__label 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>
<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" data-action="stop" data-pause aria-keyshortcuts="P" title="<?= __('Pause: Teilnehmende sehen eine Pause-Seite (P)') ?>"
data-title-pause="<?= h(__('Pause: Teilnehmende sehen eine Pause-Seite (P)')) ?>"
data-title-resume="<?= h(__('Fortsetzen: pausierte Folie wieder zeigen (P)')) ?>">
<span aria-hidden="true" data-pause-icon>⏸</span><span class="sr-only" data-pause-label><?= __('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>
<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',
]) ?>
<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>