Skip to content

Commit f000268

Browse files
Make rotation editable by clicking on the title in the sidebar
1 parent 928d2a2 commit f000268

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

library/Notifications/Widget/Timeline.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use ipl\Web\Style;
2323
use ipl\Web\Url;
2424
use ipl\Web\Widget\Icon;
25+
use ipl\Web\Widget\Link;
2526
use SplObjectStorage;
2627
use Traversable;
2728

@@ -281,7 +282,10 @@ protected function assembleSidebarEntry(Rotation $rotation): BaseHtmlElement
281282
$entry->addHtml(
282283
$form,
283284
new Icon('bars', ['data-drag-initiator' => true]),
284-
new HtmlElement('span', null, Text::create($rotation->getName()))
285+
(new Link(
286+
[new HtmlElement('span', null, Text::create($rotation->getName())), new Icon('cog')],
287+
Links::rotationSettings($rotation->getId(), $rotation->getScheduleId())
288+
))->openInModal()
285289
);
286290

287291
return $entry;

public/css/timeline.less

+30
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,20 @@
2828
margin-left: .5em;
2929
.text-ellipsis();
3030
}
31+
32+
> a {
33+
display: flex;
34+
width: 100%;
35+
align-items: baseline;
36+
margin-left: .5em;
37+
38+
span {
39+
width: 0;
40+
flex: 1 0 auto;
41+
margin-right: 0.25em;
42+
.text-ellipsis();
43+
}
44+
}
3145
}
3246

3347
.overlay .entry {
@@ -98,6 +112,22 @@
98112
&.sortable-ghost {
99113
opacity: .5;
100114
}
115+
116+
> a {
117+
text-decoration: none;
118+
119+
i {
120+
display: none;
121+
}
122+
123+
&:hover {
124+
color: @list-item-title-hover-color;
125+
126+
i {
127+
display: inline-block;
128+
}
129+
}
130+
}
101131
}
102132

103133
.entry .icon {

0 commit comments

Comments
 (0)