Improve layout of comment view

Change each table row layout to display the data in horizontal rows instead of
single columns

fixes #4934
This commit is contained in:
Matthias Jentsch 2013-10-22 10:33:10 +02:00
parent 9e9142055f
commit 7614dcbbe8
2 changed files with 56 additions and 47 deletions

View File

@ -288,7 +288,8 @@ class Monitoring_ListController extends MonitoringController
'comment_timestamp' => 'Comment Timestamp', 'comment_timestamp' => 'Comment Timestamp',
'host_service' => 'Host and Service', 'host_service' => 'Host and Service',
'comment_id' => 'Comment Id', 'comment_id' => 'Comment Id',
'comment_expires' => 'Expiration Timestamp' 'comment_expires' => 'Expiration Timestamp',
'comment_type' => 'Comment Type'
) )
); );
$this->handleFormatRequest($query); $this->handleFormatRequest($query);

View File

@ -16,7 +16,6 @@ $viewHelper = $this->getHelper('MonitoringState');
<?= $this->sortControl->render($this); ?> <?= $this->sortControl->render($this); ?>
<?= $this->paginationControl($comments, null, null, array('preserve' => $this->preserve)); ?> <?= $this->paginationControl($comments, null, null, array('preserve' => $this->preserve)); ?>
<table class="table table-condensed"> <table class="table table-condensed">
@ -47,63 +46,72 @@ $viewHelper = $this->getHelper('MonitoringState');
?> ?>
<tr> <tr>
<td> <td>
<a class="hidden" href="<?= $detailLink; ?>"></a> <?= date('d.m. H:i', $comment->comment_timestamp); ?>
</td>
<td>
<?php if ($comment->comment_objecttype_id === '1'): ?> <?php if ($comment->comment_objecttype_id === '1'): ?>
<i class="icinga-icon-host" rel="tooltip" title="Host comment" ></i> <i class="icinga-icon-host" rel="tooltip" title="Host comment" ></i>
<?php elseif ($comment->comment_objecttype_id === '2'): ?> <?php elseif ($comment->comment_objecttype_id === '2'): ?>
<i class="icinga-icon-service" rel="tooltip" title="Service comment"></i> <i class="icinga-icon-service" rel="tooltip" title="Service comment"></i>
<?php endif; ?> <?php endif; ?>
</td>
<td>
<small> <small>
<?php <?php
switch ($comment->comment_type) { switch ($comment->comment_type) {
case 'flapping': case 'flapping':
$icon = 'icinga-icon-flapping'; $icon = 'icinga-icon-flapping';
$tooltip = 'Comment is caused by a flapping host or service.'; $tooltip = 'Comment was caused by a flapping host or service.';
break; break;
case 'comment':
$icon = 'icinga-icon-user';
$tooltip = 'Comment was created by an user.';
break;
case 'downtime':
$icon = 'icinga-icon-down';
$tooltip = 'Comment was caused by a downtime.';
case 'ack':
$icon = 'icinga-icon-acknowledgement';
$tooltip = 'Comment was caused by an acknowledgement.';
} }
?> ?>
<i class="<?= $icon ?>" rel="tooltip" title="<?= $tooltip ?>"> </i> <i class="<?= $icon ?>" rel="tooltip" title="<?= $tooltip ?>"> </i>
</small> </small>
</td> </td>
<div rel="tooltip" title="Comment #<?=$comment->comment_id ?>">
<td> <td>
<a class="hidden" href="<?= $detailLink; ?>"></a>
<div rel="tooltip" title="Comment #<?=$comment->comment_id ?>">
For
<?php if ($comment->service_name): ?> <?php if ($comment->service_name): ?>
<a href="<?= $detailLink ?>"> <a href="<?= $detailLink ?>">
<?= $comment->service_name ?> <?= $comment->service_name ?>
</a>
on on
<?= $comment->host_name; ?>
</a>
<?php else: ?> <?php else: ?>
&nbsp;
<?php endif; ?>
<a href="<?= $hostLink ?>"> <a href="<?= $hostLink ?>">
<?= $comment->host_name; ?> <?= $comment->host_name; ?>
</a> </a>
</td> <?php endif; ?>
<td> by
<?= date('d.m. H:i', $comment->comment_timestamp); ?>
</td>
<td>
<?= $comment->comment_author; ?> <?= $comment->comment_author; ?>
</td>
<td>
<div class="small-row"> <div class="small-row">
<?= $comment->comment_data; ?> <?= $comment->comment_data; ?>
</div> </div>
</td>
<td>
<?= ($comment->comment_is_persistent === '1') ? 'Yes' : 'No'; ?>
</td>
<td>
<small> <small>
expires <br /> <?= <span>
<b>Persists: </b><?= ($comment->comment_is_persistent === '1') ? 'Yes' : 'No'; ?>
</span>
<span>
<b>Expires: </b> <?=
($comment->comment_expiration_timestamp) ? ($comment->comment_expiration_timestamp) ?
'at ' . date('d.m H:i', $comment->comment_expiration_timestamp) : 'at ' . date('d.m H:i', $comment->comment_expiration_timestamp) :
'Never'; 'Never';
?> </small> ?>
</span>
</small>
</td> </td>
<td> <td>