monitoring: Count services having comments once in services/show.phtml

This commit is contained in:
Eric Lippmann 2014-12-30 10:48:30 +01:00
parent 2e4e04551d
commit 9c989306d9
1 changed files with 10 additions and 2 deletions

View File

@ -131,12 +131,20 @@
</h2>
<?php endif ?>
<?php if (count($objects->getComments())): ?>
<?php $havingCommentsCount = count($objects->getComments()) ?>
<?php if ($havingCommentsCount): ?>
<h2>
<a href="<?= $havingCommentsLink ?>"
title="<?= $this->translate('Comments') ?>">
<?= $this->icon('comment') ?>
<?= sprintf($this->translatePlural('%u comment', '%u comments', count($objects->getComments())), count($objects->getComments())) ?>
<?= sprintf(
$this->translatePlural(
'%u comment',
'%u comments',
$havingCommentsCount
),
$havingCommentsCount
) ?>
</a>
</h2>
<?php endif ?>