monitoring: Don't loop more than 5 comments in the comments-header view script

What the ...
This commit is contained in:
Eric Lippmann 2015-08-27 23:16:25 +02:00
parent d92f2cca0e
commit f72c8e30fe

View File

@ -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 ?>