From c227bcc94d6fdd8f64ca4ee7669e68b8ceb5f0ac Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Thu, 10 Dec 2015 13:02:25 +0100 Subject: [PATCH] Rename error layout for guests and support theming refs #10705 --- application/controllers/ErrorController.php | 3 ++- application/layouts/scripts/error.phtml | 8 ------ application/layouts/scripts/guest-error.phtml | 10 ++++++++ application/views/scripts/error/error.phtml | 8 +++--- public/css/icinga/layout.less | 25 +++++++++++++++++++ public/css/icinga/main.less | 4 +++ 6 files changed, 45 insertions(+), 13 deletions(-) delete mode 100644 application/layouts/scripts/error.phtml create mode 100644 application/layouts/scripts/guest-error.phtml diff --git a/application/controllers/ErrorController.php b/application/controllers/ErrorController.php index ed35c3162..c7c998101 100644 --- a/application/controllers/ErrorController.php +++ b/application/controllers/ErrorController.php @@ -36,7 +36,7 @@ class ErrorController extends ActionController Logger::error('Stacktrace: %s', $exception->getTraceAsString()); if (! ($isAuthenticated = $this->Auth()->isAuthenticated())) { - $this->innerLayout = 'error'; + $this->innerLayout = 'guest-error'; } switch ($error->type) { @@ -89,6 +89,7 @@ class ErrorController extends ActionController if ($this->getInvokeArg('displayExceptions')) { $this->view->stackTrace = $exception->getTraceAsString(); } + break; } diff --git a/application/layouts/scripts/error.phtml b/application/layouts/scripts/error.phtml deleted file mode 100644 index c0ffd3394..000000000 --- a/application/layouts/scripts/error.phtml +++ /dev/null @@ -1,8 +0,0 @@ - - diff --git a/application/layouts/scripts/guest-error.phtml b/application/layouts/scripts/guest-error.phtml new file mode 100644 index 000000000..49cdd68f5 --- /dev/null +++ b/application/layouts/scripts/guest-error.phtml @@ -0,0 +1,10 @@ +
+
+
+ +
+ render('inline.phtml') ?> +
+
+
+
diff --git a/application/views/scripts/error/error.phtml b/application/views/scripts/error/error.phtml index aeef97e91..9599cb888 100644 --- a/application/views/scripts/error/error.phtml +++ b/application/views/scripts/error/error.phtml @@ -1,12 +1,12 @@ -compact && !$hideControls): ?> +compact && ! $hideControls): ?>
- showOnlyCloseButton(); ?> + showOnlyCloseButton() ?>
-

escape($message)); ?>

+

escape($message)) ?>


escape($stackTrace) ?>
-
\ No newline at end of file + diff --git a/public/css/icinga/layout.less b/public/css/icinga/layout.less index 1cc7c4710..589d7c37b 100644 --- a/public/css/icinga/layout.less +++ b/public/css/icinga/layout.less @@ -1,5 +1,20 @@ /*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ +#guest-error { + background-color: @icinga-blue; + height: 100%; +} + +#guest-error #icinga-logo { + .fadein(); +} + +#guest-error-message { + .fadein(); + color: @body-bg-color; + font-size: 2em; +} + #footer { position: fixed; left: 0; @@ -42,6 +57,16 @@ height: 100%; } +#icinga-logo { + background-image: url('../img/logo_icinga_big.png'); + background-position: center; + background-repeat: no-repeat; + background-size: contain; // Does not work in IE < 10 + height: 177px; + margin-bottom: 2em; + width: 100%; +} + #sidebar { background-color: @gray-lighter; } diff --git a/public/css/icinga/main.less b/public/css/icinga/main.less index 307b79e1d..58c515733 100644 --- a/public/css/icinga/main.less +++ b/public/css/icinga/main.less @@ -7,6 +7,10 @@ color: @icinga-blue; } +.error-message { + font-weight: @font-weight-bold; +} + .large-icon { font-size: 200%; }