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

+23 -1
View File
@@ -169,7 +169,16 @@ class AdminController extends AdminAppController
*/
public function present(): void
{
if ($this->poll->current_slide_id === null && !$this->poll->isPaused()) {
$this->prepareStage(true);
}
/**
* @param bool $start Show the first slide if the presentation has not been started yet
* @return void
*/
private function prepareStage(bool $start): void
{
if ($start && $this->poll->current_slide_id === null && !$this->poll->isPaused()) {
$first = $this->Slides->find()
->where(['poll_id' => $this->poll->id, 'is_hidden' => false])
->orderBy(['position' => 'ASC', 'id' => 'ASC'])
@@ -186,6 +195,19 @@ class AdminController extends AdminAppController
$this->setPollInterval();
}
/**
* Speaker view for a second window or screen: current slide, preview of the next one and the
* same controls as the presenter screen. Unlike present() it never starts the presentation.
*
* @return void
*/
public function speaker(): void
{
$this->prepareStage(false);
$this->set('speaker', true);
$this->viewBuilder()->setTemplate('present');
}
/**
* JSON state for the presenter screen.
*