|
| 1 | +<?php |
| 2 | + |
| 3 | +/* Icinga Notifications Web | (c) 2025 Icinga GmbH | GPLv2 */ |
| 4 | + |
| 5 | +namespace Icinga\Module\Notifications\Widget\Timeline; |
| 6 | + |
| 7 | +use Icinga\Module\Notifications\Widget\TimeGrid\Entry; |
| 8 | +use ipl\Html\Attributes; |
| 9 | +use ipl\Html\BaseHtmlElement; |
| 10 | +use ipl\Html\HtmlElement; |
| 11 | +use ipl\Web\Widget\Icon; |
| 12 | + |
| 13 | +/** |
| 14 | + * FutureEntry |
| 15 | + * |
| 16 | + * Visualize a future entry of the rotation |
| 17 | + */ |
| 18 | +class FutureEntry extends Entry |
| 19 | +{ |
| 20 | + protected $defaultAttributes = ['class' => 'future-entry']; |
| 21 | + |
| 22 | + protected $continuationType = Entry::TO_NEXT_GRID; |
| 23 | + |
| 24 | + public function __construct() |
| 25 | + { |
| 26 | + parent::__construct(0); |
| 27 | + } |
| 28 | + |
| 29 | + public function getColor(int $transparency): string |
| 30 | + { |
| 31 | + return ''; // No user, no color, CSS will handle it |
| 32 | + } |
| 33 | + |
| 34 | + protected function assembleContainer(BaseHtmlElement $container): void |
| 35 | + { |
| 36 | + $container->addHtml(new HtmlElement( |
| 37 | + 'div', |
| 38 | + new Attributes([ |
| 39 | + 'title' => $this->translate('Rotation starts in the future') |
| 40 | + ]), |
| 41 | + new Icon('angle-right'), |
| 42 | + new HtmlElement('span', new Attributes(['class' => 'outline'])), |
| 43 | + new HtmlElement('span', new Attributes(['class' => 'outline'])), |
| 44 | + new HtmlElement('span', new Attributes(['class' => 'outline'])) |
| 45 | + )); |
| 46 | + } |
| 47 | +} |
0 commit comments