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 */
@ -15,14 +15,11 @@ if ($object->acknowledged): ?>
<tr>
<th><?= $this->translate('Acknowledged') ?></th>
<td data-base-target="_self">
<ul class="inline-comments">
<li class="comment-item">
<h3>
<?= sprintf(
$this->translate('%s acknowledged %s'),
'<span class="author">' . $this->escape($acknowledgement->getAuthor()) . '</span>',
$this->timeAgo($acknowledgement->getEntryTime())
) ?>
<dl class="feed-list">
<dt class="feed-author clearfix">
<?= $this->escape($acknowledgement->getAuthor()) ?>
<span class="text-small"><?= $this->translate('acknowledged') ?></span>
<?= $this->timeAgo($acknowledgement->getEntryTime()) ?>
<?php
if ($acknowledgement->getSticky()) {
echo $this->icon('pin', sprintf(
@ -33,26 +30,24 @@ if ($object->acknowledged): ?>
));
}
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
echo $removeAckForm;
}
?>
</h3>
<p>
<span class="sr-only">(<?= $this->translate('Comment') ?>): </span>
</dt>
<dd class="comment-text">
<?= nl2br($this->createTicketLinks($acknowledgement->getComment()), false) ?>
</p>
</dd>
<?php if ($acknowledgement->expires()): ?>
<p class="info">
<dd>
<?= sprintf(
$this->translate('Expires %s'),
$this->timeUntil($acknowledgement->getExpirationTime())
) ?>
</p>
</dd>
<?php endif ?>
</li>
</ul>
</dl>
</td>
</tr>
<?php else: ?>

View File

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