From c2ac8418715e103d2fd6d38d5388e17a0a4eb2e5 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 30 Sep 2015 17:07:55 +0200 Subject: [PATCH] Make the about page pretty refs #9247 --- application/controllers/AboutController.php | 15 +- application/views/scripts/about/index.phtml | 182 ++++++++++++++------ library/Icinga/Web/StyleSheet.php | 3 +- library/Icinga/Web/View/helpers/url.php | 5 + 4 files changed, 144 insertions(+), 61 deletions(-) diff --git a/application/controllers/AboutController.php b/application/controllers/AboutController.php index f9f5be5b0..77d829679 100644 --- a/application/controllers/AboutController.php +++ b/application/controllers/AboutController.php @@ -3,16 +3,23 @@ namespace Icinga\Controllers; -use Icinga\Application\Version; -use Icinga\Web\Controller\ActionController; use Icinga\Application\Icinga; +use Icinga\Application\Version; +use Icinga\Web\Controller; -class AboutController extends ActionController +class AboutController extends Controller { public function indexAction() { - $this->view->hasPermission = $this->hasPermission('config/modules'); $this->view->version = Version::get(); $this->view->modules = Icinga::app()->getModuleManager()->getLoadedModules(); + $this->view->tabs = $this->getTabs()->add( + 'about', + array( + 'label' => $this->translate('About'), + 'title' => $this->translate('About Icinga Web 2'), + 'url' => 'about' + ) + )->activate('about'); } } diff --git a/application/views/scripts/about/index.phtml b/application/views/scripts/about/index.phtml index cd9a9aabd..6c20a3e77 100644 --- a/application/views/scripts/about/index.phtml +++ b/application/views/scripts/about/index.phtml @@ -1,58 +1,128 @@ -
-

Icinga Web 2

- $this->translate('Version: %s'), - 'gitCommitID' => $this->translate('Git commit ID: %s'), - 'gitCommitDate' => $this->translate('Git commit date: %s') - ) as $key => $label) { - if (array_key_exists($key, $version) && null !== ($value = $version[$key])) { - $versionInfo[] = sprintf($label, htmlspecialchars($value)); - } - } - - ?> -

', $versionInfo) ?>

-

Copyright © 2013-2015 translate('The Icinga Project') - ?>
translate('License: GNU GPL v2 or later') ?>

-

translate('Report a bug') - ?>translate('Support') - ?>translate('Icinga Wiki') - ?>translate('Icinga Documentation') - ?>
translate('Icinga on Twitter') - ?>translate('Icinga on Facebook') - ?>

-

translate('Loaded modules') ?>

- - - - - - - - - getName(); - ?> - - - - - - +
+ +
+
+ img( + 'img/logo_icinga_big_dark.png', + null, + array( + 'width' => 400, + 'class' => 'about-logo' + ) + ); ?> +

+ + translate('Version'); ?>: escape($version['appVersion']); ?> + + +
+ translate('Git commit ID'); ?>: escape($version['gitCommitID']); ?> + + +
+ translate('Git commit date'); ?>: escape($version['gitCommitDate']); ?> + +

+

+ translate('Copyright'); ?>: © 2013- qlink( + $this->translate('The Icinga Project'), + 'https://www.icinga.org', + null, + array( + 'target' => '_blank' + ) + ); ?> +
+ translate('License'); ?>: GNU GPL v2+ +

+

+ qlink( + null, + 'https://www.twitter.com/icinga', + null, + array( + 'target' => '_blank', + 'icon' => 'host',//'twitter', + 'title' => $this->translate('Icinga on Twitter') + ) + ); ?> qlink( + null, + 'https://www.facebook.com/icinga', + null, + array( + 'target' => '_blank', + 'icon' => 'service',//'facebook-squared', + 'title' => $this->translate('Icinga on Facebook') + ) + ); ?> +

+
+
qlink( + null, + 'https://dev.icinga.org/projects/icingaweb2', + null, + array( + 'target' => '_blank', + 'img' => 'img/bugreport.png', + 'title' => $this->translate('Report a bug') + ) + ); ?> qlink( + null, + 'https://www.icinga.org/services/support', + null, + array( + 'target' => '_blank', + 'img' => 'img/support.png', + 'title' => $this->translate('Support / Mailinglists') + ) + ); ?>
+
qlink( + null, + 'https://wiki.icinga.org', + null, + array( + 'target' => '_blank', + 'img' => 'img/wiki.png', + 'title' => $this->translate('Icinga Wiki') + ) + ); ?> qlink( + null, + 'https://docs.icinga.org/', + null, + array( + 'target' => '_blank', + 'img' => 'img/docs.png', + 'title' => $this->translate('Icinga Documentation') + ) + ); ?>
+
+

translate('Loaded modules') ?>

+
translate('Name') ?>translate('Version') ?>
qlink( - $name, - 'config/module/', - array('name' => $name), - array('title' => sprintf($this->translate('Show the overview of the %s module'), $name)) - ) : $name ?>getVersion() ?>
+ + + + + + + + + + + + +
translate('Name') ?>translate('Version') ?>
+ hasPermission('config/modules')): ?> + qlink( + $module->getName(), + 'config/module/', + array('name' => $module->getName()), + array('title' => sprintf($this->translate('Show the overview of the %s module'), $module->getName())) + ); ?> + + escape($module->getName()); ?> + + + escape($module->getVersion()); ?> +
diff --git a/library/Icinga/Web/StyleSheet.php b/library/Icinga/Web/StyleSheet.php index dd45743fd..38f894487 100644 --- a/library/Icinga/Web/StyleSheet.php +++ b/library/Icinga/Web/StyleSheet.php @@ -29,7 +29,8 @@ class StyleSheet 'css/icinga/selection-toolbar.less', 'css/icinga/login.less', 'css/icinga/logo.less', - 'css/icinga/controls.less' + 'css/icinga/controls.less', + 'css/icinga/about.less' ); public static function compileForPdf() diff --git a/library/Icinga/Web/View/helpers/url.php b/library/Icinga/Web/View/helpers/url.php index 06ace7f19..962f3cb6e 100644 --- a/library/Icinga/Web/View/helpers/url.php +++ b/library/Icinga/Web/View/helpers/url.php @@ -43,6 +43,11 @@ $this->addHelperFunction('qlink', function ($title, $url, $params = null, $prope $icon = $view->icon($properties['icon']); unset($properties['icon']); } + + if (array_key_exists('img', $properties)) { + $icon = $view->img($properties['img']); + unset($properties['img']); + } } return sprintf(