Dashboard: show a nice message if no dashboard...

...is available

fixes #13027
This commit is contained in:
Thomas Gelf 2016-11-03 14:27:15 +01:00
parent fb74ac2b39
commit 58245108c4
2 changed files with 3 additions and 4 deletions

View File

@ -25,10 +25,6 @@ class DashboardController extends ActionController
}
}
if (empty($dashboards)) {
throw new NotFoundError('Got no "%s" dashboard for you', $name);
}
$this->view->dashboards = $dashboards;
}
}

View File

@ -7,6 +7,9 @@
<p class="error"><?= $this->errorMessage ?></p>
<?php endif ?>
<?= $this->form ?>
<?php if (empty($this->dashboards)): ?>
<?= $this->translate('No dashboard available, you might have not enough permissions') ?>
<?php endif ?>
<?php foreach ($this->dashboards as $dashboard): ?>
<h1><?= $this->escape($dashboard->getTitle()) ?></h1>
<ul class="main-actions" data-base-target="_next">