Notification view cleanup, first steps

This commit is contained in:
Thomas Gelf 2014-03-07 11:26:26 +00:00
parent 04d968b4bf
commit 6be6cabb9f

View File

@ -1,35 +1,25 @@
<div class="row"> <div class="controls">
<div class="pull-left"> <?= $this->tabs ?>
<h1>Notifications</h1> <?= $this->sortControl->render($this) ?>
</div> <?= $this->selectionToolbar('single') ?>
<div class="pull-right"> <?= $this->paginationControl($notifications, null, null, array('preserve' => $this->preserve)) ?>
<?= $this->tabs->render($this); ?>
</div>
</div> </div>
<?php if (!empty($notifications)): ?> <div class="content">
<div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="single">
<div class="container pull-left">
<div class="row">
<div class="col-md-12">
<?= $this->sortControl->render($this); ?>
</div>
</div>
<div class="row">
<?= $this->paginationControl($notifications, null, null, array('preserve' => $this->preserve)); ?>
</div>
<div class="row">
<?= $this->selectionToolbar('single'); ?>
</div>
</div>
<table class="table table-condensed pull-left">
<tbody>
<?php foreach ($notifications as $notification): ?>
<?php <?php
if (empty($this->notifications)) {
echo 'No notifications yet</div>';
return;
}
?>
<table class="action">
<tbody>
<?php
foreach ($notifications as $notification):
if (isset($notification->service)) { if (isset($notification->service)) {
$isService = true; $isService = true;
$href = $this->href('monitoring/show/service', array( $href = $this->href('monitoring/show/service', array(
@ -45,8 +35,8 @@
$stateName = strtolower($this->util()->getHostStateName($notification->notification_state)); $stateName = strtolower($this->util()->getHostStateName($notification->notification_state));
} }
?> ?>
<tr> <tr class="state <?= $stateName ?>">
<td class="border-status-<?= $stateName ?>"><?= date('d.m. H:i', $notification->notification_start_time); ?></td> <td class="state"><?= $this->timeSince($notification->notification_start_time) ?></td>
<td> <td>
<?php if ($isService): ?> <?php if ($isService): ?>
<a href="<?= $href ?>"><?= $notification->service ?></a> <a href="<?= $href ?>"><?= $notification->service ?></a>
@ -68,14 +58,8 @@
</small> </small>
</td> </td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach ?>
</tbody> </tbody>
</table> </table>
<div class="container pull-left">
<?= $this->paginationControl($notifications, null, null, array('preserve' => $this->preserve)); ?>
</div> </div>
</div>
<?php else: ?>
No notifications yet
<?php endif; ?>