mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-03 12:04:24 +02:00
monitoring: Don't loop more than 5 comments in the comments-header view script
What the ...
This commit is contained in:
parent
d92f2cca0e
commit
f72c8e30fe
@ -1,32 +1,32 @@
|
|||||||
<table class="action">
|
<table class="action" data-base-target="_next">
|
||||||
<?php $i = 0; foreach ($comments as $comment):
|
<tbody>
|
||||||
if (++ $i > 5) {
|
<?php
|
||||||
continue;
|
foreach ($comments as $i => $comment):
|
||||||
|
if ($i > 5) {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
$this->comment = $comment;
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<tr class="state invalid">
|
<tr class="state invalid">
|
||||||
<td class="state" style="width: 12em;">
|
<td class="state" style="width: 12em;">
|
||||||
<?= $this->render('partials/comment/comment-description.phtml'); ?>
|
<?= $this->partial('partials/comment/comment-description.phtml', array('comment' => $comment)) ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?= $this->render('partials/comment/comment-detail.phtml'); ?>
|
<?= $this->partial('partials/comment/comment-detail.phtml', array('comment' => $comment)) ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach ?>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<?php if ($comments->count() > 5): ?>
|
||||||
<p>
|
<p>
|
||||||
<?php if ($i > 5): ?>
|
|
||||||
<?= $this->qlink(
|
<?= $this->qlink(
|
||||||
sprintf($this->translate('show all %d comments'), $i),
|
sprintf($this->translate('List all %d comments'), $comments->count()),
|
||||||
$listAllLink,
|
$listAllLink,
|
||||||
null,
|
null,
|
||||||
array(
|
array(
|
||||||
'icon' => $i > 5 ? 'down-open' : '',
|
'data-base-target' => '_next',
|
||||||
'data-base-target' => "_next"
|
'icon' => 'down-open'
|
||||||
)
|
)
|
||||||
) ?>
|
) ?>
|
||||||
<?php endif ?>
|
|
||||||
</p>
|
</p>
|
||||||
|
<?php endif ?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user