monitoring: Style ack and comments in the host and service detail views

refs #5543
This commit is contained in:
Eric Lippmann 2015-10-01 02:58:29 +02:00
parent d6774a0f64
commit 9efdc149d8
2 changed files with 37 additions and 43 deletions

View File

@ -1,4 +1,4 @@
<?php modules/monitoring/application/views/scripts/partials/command/object-command-form.phtml<?php
/** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */ /** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */
@ -15,14 +15,11 @@ if ($object->acknowledged): ?>
<tr> <tr>
<th><?= $this->translate('Acknowledged') ?></th> <th><?= $this->translate('Acknowledged') ?></th>
<td data-base-target="_self"> <td data-base-target="_self">
<ul class="inline-comments"> <dl class="feed-list">
<li class="comment-item"> <dt class="feed-author clearfix">
<h3> <?= $this->escape($acknowledgement->getAuthor()) ?>
<?= sprintf( <span class="text-small"><?= $this->translate('acknowledged') ?></span>
$this->translate('%s acknowledged %s'), <?= $this->timeAgo($acknowledgement->getEntryTime()) ?>
'<span class="author">' . $this->escape($acknowledgement->getAuthor()) . '</span>',
$this->timeAgo($acknowledgement->getEntryTime())
) ?>
<?php <?php
if ($acknowledgement->getSticky()) { if ($acknowledgement->getSticky()) {
echo $this->icon('pin', sprintf( echo $this->icon('pin', sprintf(
@ -33,26 +30,24 @@ if ($object->acknowledged): ?>
)); ));
} }
if (isset($removeAckForm)) { if (isset($removeAckForm)) {
// Form is unset if the current user lacks the respective permission $removeAckForm->setAttrib('class', $removeAckForm->getAttrib('class') . ' pull-right');
// Form is unset if the current user lacks the respective permission // Form is unset if the current user lacks the respective permission
echo $removeAckForm; echo $removeAckForm;
} }
?> ?>
</h3> </dt>
<p> <dd class="comment-text">
<span class="sr-only">(<?= $this->translate('Comment') ?>): </span>
<?= nl2br($this->createTicketLinks($acknowledgement->getComment()), false) ?> <?= nl2br($this->createTicketLinks($acknowledgement->getComment()), false) ?>
</p> </dd>
<?php if ($acknowledgement->expires()): ?> <?php if ($acknowledgement->expires()): ?>
<p class="info"> <dd>
<?= sprintf( <?= sprintf(
$this->translate('Expires %s'), $this->translate('Expires %s'),
$this->timeUntil($acknowledgement->getExpirationTime()) $this->timeUntil($acknowledgement->getExpirationTime())
) ?> ) ?>
</p> </dd>
<?php endif ?> <?php endif ?>
</li> </dl>
</ul>
</td> </td>
</tr> </tr>
<?php else: ?> <?php else: ?>

View File

@ -60,16 +60,15 @@ if (empty($object->comments) && ! $addLink) {
$deleteButton = ''; $deleteButton = '';
} }
?> ?>
<dt class="feed-author"> <dt class="feed-author clearfix">
<?= $this->escape($comment->author) ?> <?= $this->escape($comment->author) ?>
<span class="text-small"><?= $this->translate('commented') ?></span>
<?= $this->timeAgo($comment->timestamp) ?> <?= $this->timeAgo($comment->timestamp) ?>
<?php if ($deleteButton): ?> <?php if ($deleteButton): ?>
<span class="clearfix">
<?= $deleteButton ?> <?= $deleteButton ?>
</span>
<?php endif ?> <?php endif ?>
</dt> </dt>
<dd> <dd class="comment-text">
<?= str_replace(array('\r\n', '\n'), '<br>', $this->createTicketLinks($comment->comment)) ?> <?= str_replace(array('\r\n', '\n'), '<br>', $this->createTicketLinks($comment->comment)) ?>
</dd> </dd>
<?php endforeach ?> <?php endforeach ?>