Skip to content

Commit

Permalink
list/contacts: Ensure dashboard compliance
Browse files Browse the repository at this point in the history
refs #7876
  • Loading branch information
Johannes Meyer committed Apr 17, 2015
1 parent a09e41e commit d725b2f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
4 changes: 4 additions & 0 deletions modules/monitoring/application/controllers/ListController.php
Expand Up @@ -339,7 +339,9 @@ public function contactsAction()
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',
Expand All @@ -363,6 +365,8 @@ public function contactsAction()
$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'),
Expand Down
27 changes: 15 additions & 12 deletions modules/monitoring/application/views/scripts/list/contacts.phtml
@@ -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(
Expand Down

0 comments on commit d725b2f

Please sign in to comment.