Skip to content

Commit b17824b

Browse files
committedFeb 13, 2025·
ScheduleForm: Add form description and placeholder for name element
1 parent 4b8e47b commit b17824b

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed
 

‎application/forms/ScheduleForm.php

+17-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
use Icinga\Module\Notifications\Model\RuleEscalationRecipient;
1010
use Icinga\Module\Notifications\Model\Schedule;
1111
use Icinga\Web\Session;
12+
use ipl\Html\Attributes;
1213
use ipl\Html\HtmlDocument;
14+
use ipl\Html\HtmlElement;
15+
use ipl\Html\Text;
1316
use ipl\Sql\Connection;
1417
use ipl\Stdlib\Filter;
1518
use ipl\Web\Common\CsrfCounterMeasure;
@@ -151,9 +154,22 @@ public function removeSchedule(int $id): void
151154

152155
protected function assemble()
153156
{
157+
if (! $this->showRemoveButton) {
158+
$this->addHtml(new HtmlElement(
159+
'p',
160+
new Attributes(['class' => 'description']),
161+
new Text($this->translate(
162+
'Organize contacts and contact groups in a time based schedule and let them rotate'
163+
. ' automatically. Multiple rotations can be added to your schedule to represent the rotating'
164+
. ' members in your admin team. Schedules can be used as recipients of event rules.'
165+
))
166+
));
167+
}
168+
154169
$this->addElement('text', 'name', [
155170
'required' => true,
156-
'label' => $this->translate('Schedule Name')
171+
'label' => $this->translate('Schedule Name'),
172+
'placeholder' => 'e.g. working hours, on call, etc ...'
157173
]);
158174

159175
$this->addElement('submit', 'submit', [

‎public/css/form.less

+5
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,8 @@
116116
border-color: transparent;
117117
}
118118
}
119+
120+
.icinga-form p.description {
121+
color: @text-color-light;
122+
}
123+

0 commit comments

Comments
 (0)
Please sign in to comment.