[icinga-checkins] icinga.org: icingaweb2/bugfix/Improve-tooltip-descriptions-8110: monitoring: Improve tooltips for services command links

git at icinga.org git at icinga.org
Tue Feb 3 12:35:38 CET 2015


Module: icingaweb2
Branch: bugfix/Improve-tooltip-descriptions-8110
Commit: dd0638c5d03ded339c53b1cffd3943da6bdac308
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=dd0638c5d03ded339c53b1cffd3943da6bdac308

Author: Eric Lippmann <eric.lippmann at netways.de>
Date:   Tue Feb  3 12:35:06 2015 +0100

monitoring: Improve tooltips for services command links

refs #8110

---

 .../application/controllers/ServicesController.php |    2 +-
 .../application/views/scripts/services/show.phtml  |   75 +++++++++++++++-----
 2 files changed, 57 insertions(+), 20 deletions(-)

diff --git a/modules/monitoring/application/controllers/ServicesController.php b/modules/monitoring/application/controllers/ServicesController.php
index dc7feb2..48ff647 100644
--- a/modules/monitoring/application/controllers/ServicesController.php
+++ b/modules/monitoring/application/controllers/ServicesController.php
@@ -144,7 +144,7 @@ class Monitoring_ServicesController extends Controller
         $this->view->objectsInDowntime = $objectsInDowntime;
         $this->view->inDowntimeLink = Url::fromPath('monitoring/list/downtimes')
             ->setQueryString(Filter::matchAny($downtimeFilterExpressions)->toQueryString());
-        $this->view->havingCommentsLink = Url::fromRequest()
+        $this->view->commentsLink = Url::fromRequest()
             ->setPath('monitoring/list/comments');
         $this->view->serviceStatesPieChart = $this->createPieChart(
             $serviceStates,
diff --git a/modules/monitoring/application/views/scripts/services/show.phtml b/modules/monitoring/application/views/scripts/services/show.phtml
index 522d32c..1cc895d 100644
--- a/modules/monitoring/application/views/scripts/services/show.phtml
+++ b/modules/monitoring/application/views/scripts/services/show.phtml
@@ -37,7 +37,7 @@
         </div>
 
         <div>
-            <a href="<?= $listAllLink ?>" title="<?= $this->translate('List all') ?>">
+            <a href="<?= $listAllLink ?>" title="<?= sprintf($this->translate('List all %u services'), $serviceCount) ?>">
                 <?= $this->translate('List all') ?>
             </a>
         </div>
@@ -81,17 +81,43 @@
             ) ?>
         </h3>
         <div>
-            <a href="<?= $downtimeUnhandledLink ?>"
-               title="<?= $this->translate('Schedule downtimes for unhandled problem services') ?>">
+            <a href="<?= $downtimeUnhandledLink ?>" title="<?= sprintf(
+                $this->translatePlural(
+                    'Schedule downtime for %u unhandled service problem',
+                    'Schedule downtimes for %u unhandled service problems',
+                    $unhandledCount
+                ),
+                $unhandledCount
+            ) ?>">
                 <?= $this->icon('plug') ?>
-                <?= $this->translate('Schedule downtimes for unhandled problem services') ?>
+                <?= sprintf(
+                    $this->translatePlural(
+                        'Schedule downtime for unhandled service problem',
+                        'Schedule downtimes for unhandled service problems',
+                        $unhandledCount
+                    ),
+                    $unhandledCount
+                ) ?>
             </a>
         </div>
         <div>
-            <a href="<?= $acknowledgeUnhandledLink ?>"
-               title="<?= $this->translate('Acknowledge unhandled problem services') ?>">
+            <a href="<?= $acknowledgeUnhandledLink ?>" title="<?= sprintf(
+                $this->translatePlural(
+                    'Acknowledge %u unhandled service problem',
+                    'Acknowledge %u unhandled service problems',
+                    $unhandledCount
+                ),
+                $unhandledCount
+            ) ?>">
                 <?= $this->icon('ok') ?>
-                <?= $this->translate('Acknowledge unhandled problem services') ?>
+                <?= sprintf(
+                    $this->translatePlural(
+                        'Acknowledge unhandled service problem',
+                        'Acknowledge unhandled service problems',
+                        $unhandledCount
+                    ),
+                    $unhandledCount
+                ) ?>
             </a>
         </div>
         <?php endif ?>
@@ -116,13 +142,18 @@
         <?php if (! empty($objectsInDowntime)): ?>
             <h2>
                 <?php $inDowntimeCount = count($objectsInDowntime) ?>
-                <a href="<?= $inDowntimeLink ?>"
-                   title="<?= $this->translate('Services in downtime') ?>">
+                <a href="<?= $inDowntimeLink ?>" title="<?= sprintf(
+                    $this->translatePlural(
+                        'List %u service currently in downtime',
+                        'List %u services currently in downtime',
+                        $inDowntimeCount
+                    ),
+                $inDowntimeCount) ?>">
                     <?= $this->icon('plug') ?>
                     <?= sprintf(
                         $this->translatePlural(
-                            '%u service is in downtime',
-                            '%u services are in downtime',
+                            'List %u service currently in downtime',
+                            'List %u services currently in downtime',
                             $inDowntimeCount
                         ),
                         $inDowntimeCount
@@ -131,19 +162,25 @@
             </h2>
         <?php endif ?>
 
-        <?php $havingCommentsCount = count($objects->getComments()) ?>
-        <?php if ($havingCommentsCount): ?>
+        <?php $commentCount = count($objects->getComments()) ?>
+        <?php if ($commentCount): ?>
             <h2>
-                <a href="<?= $havingCommentsLink ?>"
-                   title="<?= $this->translate('Comments') ?>">
+                <a href="<?= $commentsLink ?>" title="<?= sprintf(
+                    $this->translatePlural(
+                        'List %u service comment',
+                        'List %u service comments',
+                        $commentCount
+                    ),
+                    $commentCount
+                ) ?>">
                     <?= $this->icon('comment') ?>
                     <?= sprintf(
                         $this->translatePlural(
-                            '%u comment',
-                            '%u comments',
-                            $havingCommentsCount
+                            'List %u service comment',
+                            'List %u service comments',
+                            $commentCount
                         ),
-                        $havingCommentsCount
+                        $commentCount
                     ) ?>
                 </a>
             </h2>



More information about the icinga-checkins mailing list