Merge branch 'feature/allow-to-extend-the-content-of-a-dashlet-on-the-right-6677'

resolves #6677
This commit is contained in:
Johannes Meyer 2015-08-04 15:30:02 +02:00
commit 802e18ac47
10 changed files with 109 additions and 2 deletions

View File

@ -17,7 +17,7 @@
data-icinga-multiselect-url="/icingaweb2/monitoring/comments/show"
data-icinga-multiselect-data="comment_id">
<tbody>
<?php foreach ($comments as $comment): ?>
<?php foreach ($comments->peekAhead($this->compact) as $comment): ?>
<tr class="state invalid">
<td class="state" style="width: 12em;">
<?= $this->partial('partials/comment/comment-description.phtml', array('comment' => $comment)); ?>
@ -86,5 +86,15 @@
</table>
<?php if (! $comments->hasResult()): ?>
<?= $this->translate('No comments found matching the filter'); ?>
<?php elseif ($comments->hasMore()): ?>
<?= $this->qlink(
$this->translate('Show More'),
$this->url()->without(array('view', 'limit')),
null,
array(
'data-base-target' => '_next',
'class' => 'pull-right show-more'
)
); ?>
<?php endif ?>
</div>

View File

@ -8,7 +8,7 @@
</div>
<?php endif ?>
<div data-base-target="_next" class="content contacts">
<?php foreach ($contacts as $contact): ?>
<?php foreach ($contacts->peekAhead($this->compact) as $contact): ?>
<div class="contact">
<?= $this->img('/static/gravatar', array('email' => $contact->contact_email)); ?>
<strong><?= $this->qlink(
@ -54,5 +54,15 @@
<?php endif; ?>
<?php if (! $contacts->hasResult()): ?>
<?= $this->translate('No contacts found matching the filter'); ?>
<?php elseif ($contacts->hasMore()): ?>
<?= $this->qlink(
$this->translate('Show More'),
$this->url()->without(array('view', 'limit')),
null,
array(
'data-base-target' => '_next',
'class' => 'pull-right show-more'
)
); ?>
<?php endif ?>
</div>

View File

@ -2,6 +2,8 @@
use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service;
$downtimes->peekAhead($this->compact);
if (! $this->compact): ?>
<div class="controls">
<?= $this->tabs; ?>
@ -137,5 +139,15 @@ if (! $this->compact): ?>
</table>
<?php if (! $downtimes->hasResult()): ?>
<?= $this->translate('No downtimes found matching the filter, maybe the downtime already expired.'); ?>
<?php elseif ($downtimes->hasMore()): ?>
<?= $this->qlink(
$this->translate('Show More'),
$this->url()->without(array('view', 'limit')),
null,
array(
'data-base-target' => '_next',
'class' => 'pull-right show-more'
)
); ?>
<?php endif ?>
</div>

View File

@ -2,6 +2,8 @@
use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service;
$history->peekAhead($this->compact);
if (! $this->compact): ?>
<div class="controls">
<?= $this->tabs; ?>
@ -92,5 +94,15 @@ if (! $this->compact): ?>
</table>
<?php if (! $history->hasResult()): ?>
<?= $this->translate('No history events found matching the filter'); ?>
<?php elseif ($history->hasMore()): ?>
<?= $this->qlink(
$this->translate('Show More'),
$this->url()->without(array('view', 'limit')),
null,
array(
'data-base-target' => '_next',
'class' => 'pull-right show-more'
)
); ?>
<?php endif ?>
</div>

View File

@ -13,6 +13,7 @@ if (! $this->compact): ?>
<div class="content">
<?php
$hostgroups->peekAhead($this->compact);
$firstRow = true;
foreach ($hostgroups as $h): ?>
<?php if ($firstRow): ?>
@ -467,6 +468,17 @@ if ($h->hosts_down_unhandled) {
<?php if ($hostgroups->hasResult()): ?>
</tbody>
</table>
<?php if ($hostgroups->hasMore()): ?>
<?= $this->qlink(
$this->translate('Show More'),
$this->url()->without(array('view', 'limit')),
null,
array(
'data-base-target' => '_next',
'class' => 'pull-right show-more'
)
); ?>
<?php endif ?>
<?php else: ?>
<?= $this->translate('No hostgroups found matching the filter'); ?>
<?php endif ?>

View File

@ -1,6 +1,8 @@
<?php
use Icinga\Module\Monitoring\Object\Host;
$hosts->peekAhead($this->compact);
if (! $this->compact): ?>
<div class="controls separated">
<?= $this->tabs; ?>
@ -93,5 +95,15 @@ if (! $this->compact): ?>
</table>
<?php if (! $hosts->hasResult()): ?>
<?= $this->translate('No hosts found matching the filter'); ?>
<?php elseif ($hosts->hasMore()): ?>
<?= $this->qlink(
$this->translate('Show More'),
$this->url()->without(array('view', 'limit')),
null,
array(
'data-base-target' => '_next',
'class' => 'pull-right show-more'
)
); ?>
<?php endif ?>
</div>

View File

@ -2,6 +2,8 @@
use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service;
$notifications->peekAhead($this->compact);
if (! $this->compact): ?>
<div class="controls">
<?= $this->tabs; ?>
@ -66,5 +68,15 @@ if (! $this->compact): ?>
</table>
<?php if (! $notifications->hasResult()): ?>
<?= $this->translate('No notifications found matching the filter'); ?>
<?php elseif ($notifications->hasMore()): ?>
<?= $this->qlink(
$this->translate('Show More'),
$this->url()->without(array('view', 'limit')),
null,
array(
'data-base-target' => '_next',
'class' => 'pull-right show-more'
)
); ?>
<?php endif ?>
</div>

View File

@ -10,6 +10,7 @@
<div class="content">
<?php
$servicegroups->peekAhead($this->compact);
$firstRow = true;
foreach ($servicegroups as $s): ?>
<?php if ($firstRow): ?>
@ -301,6 +302,17 @@ foreach ($servicegroups as $s): ?>
<?php if ($servicegroups->hasResult()): ?>
</tbody>
</table>
<?php if ($servicegroups->hasMore()): ?>
<?= $this->qlink(
$this->translate('Show More'),
$this->url()->without(array('view', 'limit')),
null,
array(
'data-base-target' => '_next',
'class' => 'pull-right show-more'
)
); ?>
<?php endif ?>
<?php else: ?>
<?= $this->translate('No servicegroups found matching the filter'); ?>
<?php endif ?>

View File

@ -3,6 +3,7 @@ use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service;
$selfUrl = 'monitoring/list/services';
$services->peekAhead($this->compact);
if (! $this->compact): ?>
<div class="controls separated">
@ -86,5 +87,15 @@ if (! $this->compact): ?>
</table>
<?php if (! $services->hasResult()): ?>
<?= $this->translate('No services found matching the filter'); ?>
<?php elseif ($services->hasMore()): ?>
<?= $this->qlink(
$this->translate('Show More'),
$this->url()->without(array('view', 'limit')),
null,
array(
'data-base-target' => '_next',
'class' => 'pull-right show-more'
)
); ?>
<?php endif ?>
</div>

View File

@ -62,3 +62,7 @@ ul.pagination {
cursor: default;
}
a.show-more {
display: block;
margin: 0.5em;
}