Skip to content

Commit bb84ccf

Browse files
testing
1 parent facc616 commit bb84ccf

File tree

3 files changed

+45
-27
lines changed

3 files changed

+45
-27
lines changed

library/Notifications/Widget/TimeGrid/BaseGrid.php

+1
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ final protected function yieldFixedEntries(Traversable $entries): Generator
429429
if ($entry instanceof FutureEntry) {
430430
// (no. of days * - 2) - 1, example: 7 days (week) = -15
431431
$colStart = (($this->getNoOfVisuallyConnectedHours() / 24) * - 2) - 1;
432+
$colStart = ($this->getNoOfVisuallyConnectedHours() / 24 + 1) * - 1;
432433
$colEnd = $gridBorderAt;
433434
} else {
434435
$actualStart = Util::roundToNearestThirtyMinute($entry->getStart());
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,39 @@
11
<?php
22

3+
/* Icinga Notifications Web | (c) 2025 Icinga GmbH | GPLv2 */
4+
35
namespace Icinga\Module\Notifications\Widget\Timeline;
46

57
use Icinga\Module\Notifications\Widget\TimeGrid\Entry;
68
use ipl\Html\Attributes;
79
use ipl\Html\BaseHtmlElement;
8-
use ipl\I18n\Translation;
10+
use ipl\Html\HtmlElement;
911
use ipl\Web\Widget\Icon;
1012

1113
class FutureEntry extends Entry
1214
{
13-
use Translation;
14-
1515
public function getColor(int $transparency): string
1616
{
1717
return sprintf('~"hsl(%d %d%% 50%% / %d%%)"', 166, 90, $transparency);
1818
}
1919

2020
protected function assembleContainer(BaseHtmlElement $container): void
2121
{
22-
$this
22+
/*$this
2323
->addHtml(new Icon('angle-right'))
2424
->addAttributes(new Attributes([
2525
'class' => 'future',
2626
'title' => $this->translate('rotation starts in the future')
27-
]));
27+
]));*/
28+
29+
$this->addAttributes(new Attributes(['class' => 'future-rotation-container']));
30+
31+
$container->addHtml(
32+
new HtmlElement(
33+
'div',
34+
Attributes::create(['class' => 'future', 'title' => $this->translate('rotation starts in the future')]),
35+
new Icon('angle-right')
36+
)
37+
);
2838
}
2939
}

public/css/timeline.less

+29-22
Original file line numberDiff line numberDiff line change
@@ -59,29 +59,36 @@
5959
}
6060
}
6161

62-
&.future {
62+
&.future-rotation-container {
6363
display: flex;
64-
align-items: center;
65-
justify-content: center;
66-
67-
position: relative;
68-
padding-left: 6px; // 2px before + 1px border + 2px after + 1px border
69-
70-
&:before,
71-
&:after {
72-
content: '';
73-
display: block;
74-
position: absolute;
75-
border: 1px solid var(--entry-border-color);
76-
border-right: transparent;
77-
height: ~"calc(100% + 2px)"; // border top and bottom
78-
width: 100%;
79-
left: 2px;
80-
.rounded-corners(0.25em);
81-
}
82-
83-
&:after {
84-
left: 5px; // 2px before + 1px border + 2px after
64+
justify-content: end;
65+
66+
.future {
67+
display: flex;
68+
align-items: center;
69+
justify-content: center;
70+
71+
position: relative;
72+
padding-left: 6px; // 2px before + 1px border + 2px after + 1px border
73+
74+
width: 2em;
75+
76+
&:before,
77+
&:after {
78+
content: '';
79+
display: block;
80+
position: absolute;
81+
border: 1px solid var(--entry-border-color);
82+
border-right: transparent;
83+
height: ~"calc(100% + 2px)"; // border top and bottom
84+
width: 100%;
85+
left: 2px;
86+
.rounded-corners(0.25em);
87+
}
88+
89+
&:after {
90+
left: 5px; // 2px before + 1px border + 2px after
91+
}
8592
}
8693
}
8794
}

0 commit comments

Comments
 (0)