downtimes-header: Be more efficient when listing downtimes

This commit is contained in:
Johannes Meyer 2015-07-10 14:39:30 +02:00
parent bba57d2bbc
commit 006d2cb537

View File

@ -2,7 +2,7 @@
<tbody>
<?php $i = 0; foreach ($downtimes as $downtime):
if (++ $i > 5) {
continue;
break;
} ?>
<tr class="state <?= $downtime->stateText ?>">
<td class="state">
@ -68,18 +68,18 @@
</tr>
<?php endforeach; ?>
</tbody>
</table>
</table>
<p>
<?php if ($i > 5): ?>
<?php if (count($downtimes) > 5): ?>
<p>
<?= $this->qlink(
sprintf($this->translate('show all %d downtimes'), $i),
$listAllLink,
null,
array(
'icon' => $i > 5 ? 'down-open' : '',
'data-base-target' => "_next"
'icon' => 'down-open',
'data-base-target' => "_next"
)
) ?>
<?php endif ?>
</p>
</p>
<?php endif ?>