list/contacts: Ensure dashboard compliance

refs #7876
This commit is contained in:
Johannes Meyer 2015-04-17 16:13:56 +02:00
parent a09e41e3b8
commit d725b2feb7
2 changed files with 19 additions and 12 deletions

View File

@ -339,7 +339,9 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url);
}
$this->addTitleTab('contacts', $this->translate('Contacts'), $this->translate('List contacts'));
$query = $this->backend->select()->from('contact', array(
'contact_name',
'contact_id',
@ -363,6 +365,8 @@ class Monitoring_ListController extends Controller
$this->filterQuery($query);
$this->view->contacts = $query->paginate();
$this->setupLimitControl();
$this->setupPaginationControl($this->view->contacts);
$this->setupSortControl(array(
'contact_name' => $this->translate('Name'),
'contact_alias' => $this->translate('Alias'),

View File

@ -1,18 +1,21 @@
<?php if (! $this->compact): ?>
<div class="controls">
<?= $this->tabs ?>
<div style="margin: 1em">
<?= $this->sortControl->render($this); ?>
</div>
<?= $this->paginationControl($contacts, null, null, array('preserve' => $this->preserve)); ?>
<?= $this->tabs; ?>
<?= $this->sortBox; ?>
<?= $this->limiter; ?>
<?= $this->paginator; ?>
<?= $this->filterEditor; ?>
</div>
<?php endif ?>
<div data-base-target="_next" class="content contacts">
<?php
if (count($contacts) === 0) {
echo $this->translate('No contacts matching the filter');
return;
}
foreach ($contacts as $contact): ?>
<?php
if (count($contacts) === 0) {
echo $this->translate('No contacts found matching the filter') . '</div>';
return;
}
?>
<?php foreach ($contacts as $contact): ?>
<div class="contact">
<?= $this->img('/static/gravatar', array('email' => $contact->contact_email)); ?>
<strong><?= $this->qlink(