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

This commit is contained in:
Eric Lippmann 2014-12-30 10:35:18 +01:00
parent b82f4e5356
commit 56102a1e39
1 changed files with 10 additions and 2 deletions

View File

@ -123,12 +123,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 ?>