Do not display table when there are no results and fix code style

refs #5543
This commit is contained in:
Matthias Jentsch 2015-09-29 11:12:45 +02:00 committed by Eric Lippmann
parent a0b9a06461
commit 77f5203bbf
2 changed files with 97 additions and 100 deletions

View File

@ -1,5 +1,4 @@
<?php
use Icinga\Module\Monitoring\Web\Widget\StateBadges;
if (! $this->compact): ?>
<div class="controls">
@ -12,13 +11,11 @@ if (! $this->compact): ?>
<?php endif ?>
<div class="content">
<?php
if (count($groupData) === 0) {
echo $this->translate('No contactgroups found matching the filter') . '</div>';
return;
}
?>
<table class="action action-table listing-table" data-base-target="_next">
<thead>
<tr>
@ -43,7 +40,7 @@ if (count($groupData) === 0) {
$this->translate('Show detailed information about %s'),
$groupName
))
); ?>
) ?>
</td>
<td>
<?php if ($groupInfo['alias'] !== $groupName): ?>

View File

@ -8,6 +8,8 @@
</div>
<?php endif ?>
<div class="content">
<?php if ($contacts->hasResult()): ?>
<table class="action action-table listing-table" data-base-target="_next">
<thead>
<tr>
@ -31,7 +33,7 @@
); ?>
</td>
<td>
<?= $this->translate('Email'); ?>:
<?= $this->translate('Email') ?>:
<a href="mailto:<?= $contact->contact_email; ?>"
title="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias); ?>"
aria-label="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias); ?>">
@ -40,9 +42,7 @@
</td>
<td>
<?php if ($contact->contact_pager): ?>
<div>
<?= $this->escape($contact->contact_pager) ?>
</div>
<?php endif; ?>
</td>
@ -61,10 +61,7 @@
<?php endforeach ?>
</tbody>
</table>
<?php if (! $contacts->hasResult()): ?>
<?= $this->translate('No contacts found matching the filter'); ?>
<?php elseif ($contacts->hasMore()): ?>
<?php if ($contacts->hasMore()): ?>
<?= $this->qlink(
$this->translate('Show More'),
$this->url()->without(array('view', 'limit')),
@ -75,4 +72,7 @@
)
); ?>
<?php endif ?>
<?php else: ?>
<?= $this->translate('No contacts found matching the filter'); ?>
<?php endif ?>
</div>