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

View File

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