/**
  * Render the dashboard.
  *
  * @param SidebarPanelPair $result
  *
  * @return mixed
  */
 protected function renderDashboard(SidebarPanelPair $result)
 {
     $panel = $result->getPanel();
     // Redirect the user if we actually get a redirect response instead of
     // a panel.
     if ($panel instanceof RedirectResponse) {
         return $panel;
     }
     // Show any alerts on the top of the panel (if any).
     if (count($this->alerts->peekAll()) > 0) {
         $panel = new Div([], [new AlertPresenter($this->alerts), $panel]);
     }
     if ($result->hasSidebar()) {
         return (new ConferencePage($this->context, $this->dashboard, $panel, $result->getSidebar()))->render();
     }
     return (new ConferencePage($this->context, $this->dashboard, $panel))->render();
 }
 /**
  * Push an alert informing the user about missing fields.
  *
  * @param string[] $missingFields
  */
 protected function pushMissingAlert($missingFields)
 {
     $this->alerts->push($missingFields, Alert::TYPE_VALIDATION, 'The following fields are missing:', 'alerts.validation');
 }
 /**
  * Construct an instance of a AlertPresenter.
  *
  * @param AlertManager $manager
  */
 public function __construct(AlertManager $manager)
 {
     parent::__construct();
     $this->alerts = $manager->all();
 }