mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 16:54:04 +02:00
monitoring: Use comment-list markup for downtimes instead of feed-list
refs #5543
This commit is contained in:
parent
bb33a43cb9
commit
0b332bba22
@ -30,7 +30,6 @@ if (! $this->compact): ?>
|
||||
$this->stateName = Host::getStateText($downtime->host_state);
|
||||
}
|
||||
$this->downtime = $downtime;
|
||||
$this->displayComment = true;
|
||||
?>
|
||||
<tr href="<?= $this->href('monitoring/downtime/show', array('downtime_id' => $downtime->id)) ?>">
|
||||
<?= $this->render('partials/downtime/downtime-header.phtml'); ?>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td>
|
||||
<span class="comment-header">
|
||||
<div class="comment-header">
|
||||
<?php if ($isService): ?>
|
||||
<?= $this->icon('service', $this->translate('Service')); ?> <?= $this->qlink(
|
||||
$downtime->host_display_name . ': ' . $downtime->service_display_name,
|
||||
@ -38,11 +38,10 @@
|
||||
)
|
||||
); ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?= $this->translate('by') ?>
|
||||
<?= $this->escape($downtime->author_name) ?>
|
||||
|
||||
<span class="pull-right">
|
||||
<span class="comment-meta">
|
||||
<?= $this->translate('by') ?>
|
||||
<?= $this->escape($downtime->author_name) ?>
|
||||
<span class="meta-icons">
|
||||
<?php if ($downtime->is_flexible): ?>
|
||||
<?= $this->icon('magic', $this->translate('This downtime is flexible')); ?>
|
||||
<?php endif ?>
|
||||
@ -52,22 +51,23 @@
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (isset($delDowntimeForm)): // Form is unset if the current user lacks the respective permission ?>
|
||||
<?php
|
||||
$delDowntimeForm = clone $delDowntimeForm;
|
||||
$delDowntimeForm->populate(
|
||||
array(
|
||||
'downtime_id' => $downtime->id,
|
||||
'downtime_is_service' => isset($downtime->service_description)
|
||||
)
|
||||
);
|
||||
echo $delDowntimeForm;
|
||||
?>
|
||||
<?php
|
||||
$deleteButton = clone $delDowntimeForm;
|
||||
/** @var \Icinga\Module\Monitoring\Forms\Command\Object\DeleteDowntimeCommandForm $deleteButton */
|
||||
$deleteButton->setAttrib('class', $deleteButton->getAttrib('class') . ' remove-comment');
|
||||
$deleteButton->populate(
|
||||
array(
|
||||
'downtime_id' => $downtime->id,
|
||||
'downtime_is_service' => isset($downtime->service_description)
|
||||
)
|
||||
);
|
||||
echo $deleteButton;
|
||||
?>
|
||||
<?php endif ?>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
<?php if (isset ($displayComment) && $displayComment): ?>
|
||||
<p class="comment-text">
|
||||
<?= $this->escape($downtime->comment) ?>
|
||||
</p>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<p class="comment-text">
|
||||
<?= $this->escape($downtime->comment) ?>
|
||||
</p>
|
||||
</td>
|
||||
|
@ -40,14 +40,14 @@ if (empty($object->comments) && ! $addLink) {
|
||||
<th><?php
|
||||
echo $this->translate('Downtimes');
|
||||
if (! empty($object->downtimes) && $addLink) {
|
||||
echo '<br />' . $addLink;
|
||||
echo '<br>' . $addLink;
|
||||
}
|
||||
?></th>
|
||||
<td data-base-target="_self">
|
||||
<?php if (empty($object->downtimes)):
|
||||
echo $addLink;
|
||||
else: ?>
|
||||
<dl class="feed-list">
|
||||
<dl class="comment-list">
|
||||
<?php foreach ($object->downtimes as $downtime):
|
||||
if ((bool) $downtime->is_in_effect) {
|
||||
$state = sprintf(
|
||||
@ -72,30 +72,34 @@ if (empty($object->comments) && ! $addLink) {
|
||||
);
|
||||
}
|
||||
}
|
||||
// Form is unset if the current user lacks the respective permission
|
||||
if (isset($delDowntimeForm)) {
|
||||
$deleteButton = clone($delDowntimeForm);
|
||||
$deleteButton->setAttrib('class', $deleteButton->getAttrib('class') . ' pull-right');
|
||||
$deleteButton->populate(
|
||||
array(
|
||||
'downtime_id' => $downtime->id,
|
||||
'downtime_is_service' => $object->getType() === $object::TYPE_SERVICE
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$deleteButton = '';
|
||||
}
|
||||
?>
|
||||
<dt class="clearfix feed-author">
|
||||
<span class="author"><?= $this->escape($downtime->author_name) ?></span>
|
||||
<?= $this->timeAgo($downtime->entry_time) ?>
|
||||
<?= $deleteButton ?>
|
||||
</dt>
|
||||
<dd class="comment-text">
|
||||
<?= str_replace(array('\r\n', '\n'), '<br>', $this->createTicketLinks($downtime->comment)) ?>
|
||||
</dd>
|
||||
<dd class="text-small">
|
||||
<?= $state ?>
|
||||
?>
|
||||
<dt class="comment-header">
|
||||
<?= $this->escape($downtime->author_name) ?>
|
||||
<span class="comment-meta">
|
||||
<?= $this->translate('created') ?>
|
||||
<?= $this->timeAgo($downtime->entry_time) ?>
|
||||
<span aria-hidden="true">ǀ</span>
|
||||
<?= $state ?>
|
||||
<?php if (isset($delDowntimeForm)): // Form is unset if the current user lacks the respective permission ?>
|
||||
<span class="meta-icons">
|
||||
<?php
|
||||
$deleteButton = clone($delDowntimeForm);
|
||||
/** @var \Icinga\Module\Monitoring\Forms\Command\Object\DeleteDowntimeCommandForm $deleteButton */
|
||||
$deleteButton->setAttrib('class', $deleteButton->getAttrib('class') . ' remove-comment');
|
||||
$deleteButton->populate(
|
||||
array(
|
||||
'downtime_id' => $downtime->id,
|
||||
'downtime_is_service' => $object->getType() === $object::TYPE_SERVICE
|
||||
)
|
||||
);
|
||||
echo $deleteButton;
|
||||
?>
|
||||
</span>
|
||||
<?php endif ?>
|
||||
</span>
|
||||
</dt>
|
||||
<dd class="comment-text">
|
||||
<p><?= str_replace(array('\r\n', '\n'), '<br>', $this->createTicketLinks($downtime->comment)) ?></p>
|
||||
</dd>
|
||||
<?php endforeach ?>
|
||||
</dl>
|
||||
|
Loading…
x
Reference in New Issue
Block a user