Add a speaker view with a next-slide preview and keep the live slide in view
- 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:
1 parent
8262411225
commit
66ed198f87
11 files changed
+264
-5
No files matched your search
@@ -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.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user