Skip to content

Commit 59a081f

Browse files
Move Schedule class to detail and rename it to ScheduleDetail
- Rename css class to `schedule-detail` _ Move the schedule controls
1 parent cd1f7b1 commit 59a081f

5 files changed

Lines changed: 18 additions & 16 deletions

File tree

application/controllers/ScheduleController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Icinga\Module\Notifications\Forms\ScheduleForm;
1212
use Icinga\Module\Notifications\Model\Schedule;
1313
use Icinga\Module\Notifications\Widget\RecipientSuggestions;
14-
use Icinga\Module\Notifications\Widget\Schedule as ScheduleWidget;
14+
use Icinga\Module\Notifications\Widget\Detail\ScheduleDetail;
1515
use ipl\Html\Form;
1616
use ipl\Html\Html;
1717
use ipl\Stdlib\Filter;
@@ -52,15 +52,15 @@ public function indexAction(): void
5252

5353
$this->controls->addAttributes(['class' => 'schedule-detail-controls']);
5454

55-
$scheduleControls = (new ScheduleWidget\Controls())
55+
$scheduleControls = (new ScheduleDetail\Controls())
5656
->setAction(Url::fromRequest()->getAbsoluteUrl())
5757
->populate(['mode' => $this->params->get('mode')])
58-
->on(Form::ON_SUCCESS, function (ScheduleWidget\Controls $controls) use ($id) {
58+
->on(Form::ON_SUCCESS, function (ScheduleDetail\Controls $controls) use ($id) {
5959
$this->redirectNow(Links::schedule($id)->with(['mode' => $controls->getMode()]));
6060
})
6161
->handleRequest($this->getServerRequest());
6262

63-
$this->addContent(new ScheduleWidget($schedule, $scheduleControls));
63+
$this->addContent(new ScheduleDetail($schedule, $scheduleControls));
6464
}
6565

6666
public function settingsAction(): void

library/Notifications/Widget/Schedule.php renamed to library/Notifications/Widget/Detail/ScheduleDetail.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
/* Icinga Notifications Web | (c) 2023 Icinga GmbH | GPLv2 */
44

5-
namespace Icinga\Module\Notifications\Widget;
5+
namespace Icinga\Module\Notifications\Widget\Detail;
66

7-
use Icinga\Module\Notifications\Widget\Schedule\Controls;
7+
use Icinga\Module\Notifications\Model\Schedule;
8+
use Icinga\Module\Notifications\Widget\Detail\ScheduleDetail\Controls;
9+
use Icinga\Module\Notifications\Widget\Timeline;
810
use Icinga\Module\Notifications\Widget\Timeline\Rotation;
911
use Icinga\Util\Csp;
1012
use ipl\Html\Attributes;
@@ -13,15 +15,15 @@
1315
use ipl\Web\Common\BaseTarget;
1416
use ipl\Web\Style;
1517

16-
class Schedule extends BaseHtmlElement
18+
class ScheduleDetail extends BaseHtmlElement
1719
{
1820
use BaseTarget;
1921

2022
protected $tag = 'div';
2123

22-
protected $defaultAttributes = ['id' => 'notifications-schedule', 'class' => 'schedule'];
24+
protected $defaultAttributes = ['id' => 'notifications-schedule', 'class' => 'schedule-detail'];
2325

24-
/** @var \Icinga\Module\Notifications\Model\Schedule */
26+
/** @var Schedule */
2527
protected $schedule;
2628

2729
/** @var Controls */
@@ -30,10 +32,10 @@ class Schedule extends BaseHtmlElement
3032
/**
3133
* Create a new Schedule
3234
*
33-
* @param \Icinga\Module\Notifications\Model\Schedule $schedule
35+
* @param Schedule $schedule
3436
* @param Controls $controls
3537
*/
36-
public function __construct(\Icinga\Module\Notifications\Model\Schedule $schedule, Controls $controls)
38+
public function __construct(Schedule $schedule, Controls $controls)
3739
{
3840
$this->schedule = $schedule;
3941
$this->controls = $controls;

library/Notifications/Widget/Schedule/Controls.php renamed to library/Notifications/Widget/Detail/ScheduleDetail/Controls.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/* Icinga Notifications Web | (c) 2024 Icinga GmbH | GPLv2 */
44

5-
namespace Icinga\Module\Notifications\Widget\Schedule;
5+
namespace Icinga\Module\Notifications\Widget\Detail\ScheduleDetail;
66

77
use DateTime;
88
use Icinga\Web\Session;

public/css/schedule.less

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
}
1515
}
1616

17-
.schedule {
17+
.schedule-detail {
1818
display: flex;
1919
flex-direction: column;
2020
height: 100%;
@@ -58,12 +58,12 @@
5858

5959
/* Design */
6060

61-
.schedule .entry.highlighted {
61+
.schedule-detail .entry.highlighted {
6262
outline: 2px solid var(--entry-border-color);
6363
outline-offset: 1px;
6464
}
6565

66-
.schedule .step.highlighted {
66+
.schedule-detail .step.highlighted {
6767
background-color: @gray-lighter;
6868
border-color: @gray-light;
6969
}

public/css/timeline.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,6 @@
236236
padding-bottom: .25em;
237237
}
238238

239-
#layout.twocols .schedule .timescale:has(:nth-child(n+62)) { // month view (--timestampsPerDay * --primaryColumns = 62)
239+
#layout.twocols .schedule-detail .timescale:has(:nth-child(n+62)) { // month view (--timestampsPerDay * --primaryColumns = 62)
240240
display: none;
241241
}

0 commit comments

Comments
 (0)