monitoring: Use comment-list markup for acknowledgements instead of feed-list

refs #5543
This commit is contained in:
Eric Lippmann 2015-10-28 09:53:53 +01:00
parent 0b332bba22
commit acb01dc07a

View File

@ -8,50 +8,52 @@ if (in_array((int) $object->state, array(0, 99))) {
} }
if ($object->acknowledged): ?> if ($object->acknowledged): ?>
<?php <?php
$acknowledgement = $object->acknowledgement; $acknowledgement = $object->acknowledgement;
/** @var \Icinga\Module\Monitoring\Object\Acknowledgement $acknowledgement */ /** @var \Icinga\Module\Monitoring\Object\Acknowledgement $acknowledgement */
?> ?>
<tr> <tr>
<th><?= $this->translate('Acknowledged') ?></th> <th><?= $this->translate('Acknowledged') ?></th>
<td data-base-target="_self"> <td data-base-target="_self">
<dl class="feed-list"> <dl class="comment-list">
<dt class="feed-author clearfix"> <dt class="comment-header">
<?= $this->escape($acknowledgement->getAuthor()) ?> <?= $this->escape($acknowledgement->getAuthor()) ?>
<span class="text-small"><?= $this->translate('acknowledged') ?></span> <span class="comment-meta">
<?= $this->translate('acknowledged') ?>
<?= $this->timeAgo($acknowledgement->getEntryTime()) ?> <?= $this->timeAgo($acknowledgement->getEntryTime()) ?>
<?php
if ($acknowledgement->getSticky()) {
echo $this->icon('pin', sprintf(
$this->translate(
'Acknowledgement remains until the %1$s recovers even if the %1$s changes state'
),
$object->getType(true)
));
}
if (isset($removeAckForm)) {
$removeAckForm->setAttrib('class', $removeAckForm->getAttrib('class') . ' pull-right');
// Form is unset if the current user lacks the respective permission
echo $removeAckForm;
}
?>
</dt>
<dd class="comment-text">
<?= nl2br($this->createTicketLinks($acknowledgement->getComment()), false) ?>
</dd>
<?php if ($acknowledgement->expires()): ?> <?php if ($acknowledgement->expires()): ?>
<dd class="text-small"> <span aria-hidden="true">&#448;</span>
<?= sprintf( <?= sprintf(
$this->translate('Expires %s'), $this->translate('Expires %s'),
$this->timeUntil($acknowledgement->getExpirationTime()) $this->timeUntil($acknowledgement->getExpirationTime())
) ?> ) ?>
</dd>
<?php endif ?> <?php endif ?>
<?php if ($acknowledgement->getSticky()): ?>
<?= $this->icon('pin', sprintf(
$this->translate(
'Acknowledgement remains until the %1$s recovers even if the %1$s changes state'
),
$object->getType(true)
)) ?>
<?php endif ?>
<?php if (isset($removeAckForm)): // Form is unset if the current user lacks the respective permission ?>
<span class="meta-icons">
<?php
$removeAckForm->setAttrib('class', $removeAckForm->getAttrib('class') . ' remove-comment');
echo $removeAckForm;
?>
</span>
<?php endif ?>
</span>
</dt>
<dd class="comment-text">
<p><?= nl2br($this->createTicketLinks($acknowledgement->getComment()), false) ?></p>
</dd>
</dl> </dl>
</td> </td>
</tr> </tr>
<?php else: ?> <?php else: ?>
<tr> <tr>
<th><?= $this->translate('Not acknowledged') ?></th> <th><?= $this->translate('Not acknowledged') ?></th>
<td> <td>
<?php if ($this->hasPermission('monitoring/command/acknowledge-problem')) { <?php if ($this->hasPermission('monitoring/command/acknowledge-problem')) {
@ -88,5 +90,5 @@ if ($object->acknowledged): ?>
echo '&#45;'; echo '&#45;';
} // endif ?> } // endif ?>
</td> </td>
</tr> </tr>
<?php endif ?> <?php endif ?>