From 4bfa5298cf5d6ecf9655cb143fa0017b628571f7 Mon Sep 17 00:00:00 2001 From: Florian Strohmaier Date: Mon, 15 May 2023 17:00:16 +0200 Subject: [PATCH 01/15] CSS: Align `.cache-notice` --- public/css/detail/event-rule-detail.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/css/detail/event-rule-detail.less b/public/css/detail/event-rule-detail.less index 6f85b48d..52289864 100644 --- a/public/css/detail/event-rule-detail.less +++ b/public/css/detail/event-rule-detail.less @@ -202,7 +202,7 @@ } .cache-notice { - margin: 1em; + margin: 1em 0; padding: 1em; background-color: @gray-lighter; text-align: center; From 46a51dbcf28b0d5862e3442ae9e7e6176135b291 Mon Sep 17 00:00:00 2001 From: Florian Strohmaier Date: Mon, 15 May 2023 17:03:25 +0200 Subject: [PATCH 02/15] EventListItem: Do not render footer --- library/Notifications/Widget/ItemList/EventListItem.php | 1 - 1 file changed, 1 deletion(-) diff --git a/library/Notifications/Widget/ItemList/EventListItem.php b/library/Notifications/Widget/ItemList/EventListItem.php index 2b3dfeeb..cffa019c 100644 --- a/library/Notifications/Widget/ItemList/EventListItem.php +++ b/library/Notifications/Widget/ItemList/EventListItem.php @@ -133,6 +133,5 @@ protected function assembleMain(BaseHtmlElement $main): void { $main->add($this->createHeader()); $main->add($this->createCaption()); - $main->add($this->createFooter()); } } From da0cbf5217d892bc2ffb0e58ae2bf1948cc227a9 Mon Sep 17 00:00:00 2001 From: Florian Strohmaier Date: Mon, 15 May 2023 17:03:47 +0200 Subject: [PATCH 03/15] CSS: Align EventListItem in controls vertically --- public/css/common.less | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public/css/common.less b/public/css/common.less index b9fa4e10..23d04981 100644 --- a/public/css/common.less +++ b/public/css/common.less @@ -25,6 +25,13 @@ display: block; .box-shadow(0, 0, 0, 1px, @gray-lighter); } + + .item-list .list-item { + .main, .visual { + padding-top: 0; + padding-bottom: 0; + } + } } .source-icon { From f2fc03188b231b7fcbc661f879bd094e86331aaa Mon Sep 17 00:00:00 2001 From: Florian Strohmaier Date: Tue, 16 May 2023 13:43:23 +0200 Subject: [PATCH 04/15] list-item.less: Do not wrap `.meta` element --- public/css/list/list-item.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/css/list/list-item.less b/public/css/list/list-item.less index 5d75d4ea..9e954118 100644 --- a/public/css/list/list-item.less +++ b/public/css/list/list-item.less @@ -61,4 +61,8 @@ line-height: 1.5*.857em; } } + + .meta { + white-space: nowrap; + } } From c02bed6555e422d9b8722b6f4456eafe79f74287 Mon Sep 17 00:00:00 2001 From: Florian Strohmaier Date: Tue, 16 May 2023 13:45:25 +0200 Subject: [PATCH 05/15] event-source-badge: Optimize colors in light mode --- public/css/event-source-badge.less | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/public/css/event-source-badge.less b/public/css/event-source-badge.less index 513347a8..b0d4b9a0 100644 --- a/public/css/event-source-badge.less +++ b/public/css/event-source-badge.less @@ -6,16 +6,15 @@ } .name { - position: relative; display: inline-block; height: 2em; + line-height: 2 - 2 * @ball-pad; border-bottom-right-radius: 1em; border-top-right-radius: 1em; - z-index: -99; padding: @ball-pad .5em @ball-pad 1.5em; margin-left: 1em; - background-color: @gray; - color: @text-color-inverted; + background-color: @gray-lighter; + color: @text-color; } } From 040fd790a22eea216e6ebeeb903209a396ef1c24 Mon Sep 17 00:00:00 2001 From: Florian Strohmaier Date: Tue, 16 May 2023 15:35:35 +0200 Subject: [PATCH 06/15] CSS: Optimize `.entry .title` spacing --- public/css/calendar.less | 4 ---- 1 file changed, 4 deletions(-) diff --git a/public/css/calendar.less b/public/css/calendar.less index c653f2f1..98ac5633 100644 --- a/public/css/calendar.less +++ b/public/css/calendar.less @@ -90,10 +90,6 @@ column-gap: .5em; overflow: hidden; - time { - margin-right: .5em; - } - .attendee { word-break: break-word; } From e9ea20a406149aa291e2cf5379225ce62497a4d3 Mon Sep 17 00:00:00 2001 From: Florian Strohmaier Date: Wed, 17 May 2023 15:32:40 +0200 Subject: [PATCH 07/15] Add `.full-width` class to `.content` containers --- application/controllers/EventRulesController.php | 3 ++- application/controllers/EventsController.php | 1 + application/controllers/IncidentsController.php | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/application/controllers/EventRulesController.php b/application/controllers/EventRulesController.php index 47899613..8326d829 100644 --- a/application/controllers/EventRulesController.php +++ b/application/controllers/EventRulesController.php @@ -89,9 +89,10 @@ public function indexAction(): void 'notifications/event-rules/add', 'plus' ))->setBaseTarget('_next') - ->addAttributes(['class' => 'new-event-rule']) + ->addAttributes(['class' => 'add-new-component']) ); + $this->content->getAttributes()->add(['class' => 'full-width']); $this->addContent(new EventRuleList($eventRules)); if (! $searchBar->hasBeenSubmitted() && $searchBar->hasBeenSent()) { diff --git a/application/controllers/EventsController.php b/application/controllers/EventsController.php index 2b2e76a4..3aa040b4 100644 --- a/application/controllers/EventsController.php +++ b/application/controllers/EventsController.php @@ -90,6 +90,7 @@ public function indexAction(): void $eventList->setPageNumber($page); } + $this->content->getAttributes()->add(['class' => 'full-width']); if ($compact && $page > 1) { $this->document->addFrom($eventList); } else { diff --git a/application/controllers/IncidentsController.php b/application/controllers/IncidentsController.php index 94cd61fc..0ce41946 100644 --- a/application/controllers/IncidentsController.php +++ b/application/controllers/IncidentsController.php @@ -62,6 +62,7 @@ public function indexAction(): void $this->addControl($limitControl); $this->addControl($searchBar); + $this->content->getAttributes()->add(['class' => 'full-width']); $this->addContent(new IncidentList($incidents)); if (! $searchBar->hasBeenSubmitted() && $searchBar->hasBeenSent()) { From c8d21b5e87ae27607e1ff8ac3276894747cf6d7c Mon Sep 17 00:00:00 2001 From: Florian Strohmaier Date: Wed, 17 May 2023 15:34:25 +0200 Subject: [PATCH 08/15] Label create buttons consistently --- application/controllers/ContactsController.php | 4 ++-- application/controllers/EventRulesController.php | 2 +- application/forms/SaveEventRuleForm.php | 2 +- library/Notifications/Web/Form/ContactForm.php | 2 +- library/Notifications/Widget/Schedule.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/application/controllers/ContactsController.php b/application/controllers/ContactsController.php index de794f78..d4599442 100644 --- a/application/controllers/ContactsController.php +++ b/application/controllers/ContactsController.php @@ -88,7 +88,7 @@ public function indexAction() $this->addControl($searchBar); $this->addContent( (new ButtonLink( - t('Add Contact'), + t('New Contact'), 'notifications/contacts/add', 'plus' ))->setBaseTarget('_next') @@ -109,7 +109,7 @@ public function indexAction() public function addAction() { - $this->addTitleTab(t('Add Contact')); + $this->addTitleTab(t('New Contact')); $form = (new ContactForm($this->db)) ->on(ContactForm::ON_SUCCESS, function (ContactForm $form) { diff --git a/application/controllers/EventRulesController.php b/application/controllers/EventRulesController.php index 8326d829..37f24132 100644 --- a/application/controllers/EventRulesController.php +++ b/application/controllers/EventRulesController.php @@ -105,7 +105,7 @@ public function indexAction(): void public function addAction(): void { - $this->addTitleTab(t('Add Event Rule')); + $this->addTitleTab(t('New Event Rule')); $this->getTabs()->setRefreshUrl(Url::fromPath('notifications/event-rules/add')); $this->controls->addAttributes(['class' => 'event-rule-detail']); diff --git a/application/forms/SaveEventRuleForm.php b/application/forms/SaveEventRuleForm.php index 0e5a0626..7e6ff1c9 100644 --- a/application/forms/SaveEventRuleForm.php +++ b/application/forms/SaveEventRuleForm.php @@ -113,7 +113,7 @@ public function setSubmitLabel(string $label): self */ public function getSubmitLabel(): string { - return $this->submitLabel ?? t('Add Event Rule'); + return $this->submitLabel ?? t('Create Event Rule'); } /** diff --git a/library/Notifications/Web/Form/ContactForm.php b/library/Notifications/Web/Form/ContactForm.php index c70bce7e..6e61e5d6 100644 --- a/library/Notifications/Web/Form/ContactForm.php +++ b/library/Notifications/Web/Form/ContactForm.php @@ -156,7 +156,7 @@ protected function assemble() 'submit', [ 'label' => $this->contactId === null ? - $this->translate('Add Contact') : + $this->translate('Create Contact') : $this->translate('Save Changes') ] ); diff --git a/library/Notifications/Widget/Schedule.php b/library/Notifications/Widget/Schedule.php index 13bbed38..83b1354f 100644 --- a/library/Notifications/Widget/Schedule.php +++ b/library/Notifications/Widget/Schedule.php @@ -118,7 +118,7 @@ public function assemble() new Link( [ new Icon('plus'), - t('Add new entry') + t('Add Entry') ], Url::fromPath('notifications/schedule/add-entry', ['schedule' => $this->schedule->id]), ['class' => 'button-link'] From 308fda7fc4dd4201f32f463cd84ed626085e58e2 Mon Sep 17 00:00:00 2001 From: Florian Strohmaier Date: Mon, 22 May 2023 13:56:35 +0200 Subject: [PATCH 09/15] Clarify button labels in forms --- application/forms/EntryForm.php | 2 +- application/forms/ScheduleForm.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/forms/EntryForm.php b/application/forms/EntryForm.php index 59f14469..6c2dee1c 100644 --- a/application/forms/EntryForm.php +++ b/application/forms/EntryForm.php @@ -295,7 +295,7 @@ protected function assemble() if ($this->showRemoveButton) { $removeBtn = $this->createElement('submit', 'remove', [ - 'label' => $this->translate('Remove'), + 'label' => $this->translate('Remove Entry'), 'class' => 'btn-remove', 'formnovalidate' => true ]); diff --git a/application/forms/ScheduleForm.php b/application/forms/ScheduleForm.php index 233fe950..8b3de763 100644 --- a/application/forms/ScheduleForm.php +++ b/application/forms/ScheduleForm.php @@ -132,7 +132,7 @@ protected function assemble() if ($this->showRemoveButton) { $removeBtn = $this->createElement('submit', 'remove', [ - 'label' => $this->translate('Remove'), + 'label' => $this->translate('Delete Schedule'), 'class' => 'btn-remove', 'formnovalidate' => true ]); From b96e2bc5272fdc423d44243e63ba7e6fa3b94eb7 Mon Sep 17 00:00:00 2001 From: Florian Strohmaier Date: Mon, 22 May 2023 13:56:58 +0200 Subject: [PATCH 10/15] Realign buttons in `.form-controls` --- application/forms/EntryForm.php | 16 ++++++++-------- application/forms/ScheduleForm.php | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/application/forms/EntryForm.php b/application/forms/EntryForm.php index 6c2dee1c..b34fcae7 100644 --- a/application/forms/EntryForm.php +++ b/application/forms/EntryForm.php @@ -285,14 +285,6 @@ protected function assemble() ]); $additionalButtons = []; - $cancelBtn = $this->createElement('submit', 'cancel', [ - 'label' => $this->translate('Cancel'), - 'class' => 'btn-cancel', - 'formnovalidate' => true - ]); - $this->registerElement($cancelBtn); - $additionalButtons[] = $cancelBtn; - if ($this->showRemoveButton) { $removeBtn = $this->createElement('submit', 'remove', [ 'label' => $this->translate('Remove Entry'), @@ -303,6 +295,14 @@ protected function assemble() $additionalButtons[] = $removeBtn; } + $cancelBtn = $this->createElement('submit', 'cancel', [ + 'label' => $this->translate('Cancel'), + 'class' => 'btn-cancel btn-default', + 'formnovalidate' => true + ]); + $this->registerElement($cancelBtn); + $additionalButtons[] = $cancelBtn; + $this->getElement('submit')->prependWrapper((new HtmlDocument())->setHtmlContent(...$additionalButtons)); $this->addElement($this->createCsrfCounterMeasure(Session::getSession()->getId())); diff --git a/application/forms/ScheduleForm.php b/application/forms/ScheduleForm.php index 8b3de763..24e2f901 100644 --- a/application/forms/ScheduleForm.php +++ b/application/forms/ScheduleForm.php @@ -122,14 +122,6 @@ protected function assemble() ]); $additionalButtons = []; - $cancelBtn = $this->createElement('submit', 'cancel', [ - 'label' => $this->translate('Cancel'), - 'class' => 'btn-cancel', - 'formnovalidate' => true - ]); - $this->registerElement($cancelBtn); - $additionalButtons[] = $cancelBtn; - if ($this->showRemoveButton) { $removeBtn = $this->createElement('submit', 'remove', [ 'label' => $this->translate('Delete Schedule'), @@ -140,6 +132,14 @@ protected function assemble() $additionalButtons[] = $removeBtn; } + $cancelBtn = $this->createElement('submit', 'cancel', [ + 'label' => $this->translate('Cancel'), + 'class' => 'btn-cancel btn-default', + 'formnovalidate' => true + ]); + $this->registerElement($cancelBtn); + $additionalButtons[] = $cancelBtn; + $this->getElement('submit')->prependWrapper((new HtmlDocument())->setHtmlContent(...$additionalButtons)); $this->addElement($this->createCsrfCounterMeasure(Session::getSession()->getId())); From eb65ebd8196120a10520aab6140e3d96327154be Mon Sep 17 00:00:00 2001 From: Florian Strohmaier Date: Mon, 22 May 2023 13:57:20 +0200 Subject: [PATCH 11/15] CSS: Clarify disabled state --- public/css/detail/event-rule-detail.less | 10 +++++++-- public/css/form.less | 26 ++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/public/css/detail/event-rule-detail.less b/public/css/detail/event-rule-detail.less index 52289864..151f5659 100644 --- a/public/css/detail/event-rule-detail.less +++ b/public/css/detail/event-rule-detail.less @@ -66,6 +66,10 @@ &:first-child:before { content: ""; display: block; + top: 50%; + } + + &:first-child:last-child:before { top: calc(~"50% - 1em"); } @@ -402,10 +406,11 @@ margin-left: 1em; &:disabled { - background: @gray-light; + background: @gray-lighter; color: @disabled-gray; cursor: not-allowed; border-color: transparent; + opacity: .5; } &.btn-remove { @@ -428,9 +433,10 @@ .remove-escalation-form { button[disabled] { &:disabled { - background: @gray-light; + background: @gray-lighter; color: @disabled-gray; cursor: not-allowed; + opacity: .5; } } } diff --git a/public/css/form.less b/public/css/form.less index d78d99e2..cb77defa 100644 --- a/public/css/form.less +++ b/public/css/form.less @@ -15,6 +15,14 @@ border-radius: 0; border: none; } + + .form-controls { + margin-top: 2em; + + .btn-remove { + margin-right: auto; + } + } } .entry-form { @@ -77,3 +85,21 @@ content: "\f0c0"; } } + +.icinga-form { + .form-controls { + .btn-remove:not(:hover) { + border-color: transparent; + } + + .btn-default { + background: @low-sat-blue; + color: @icinga-blue; + border-color: transparent; + + &:hover { + background: @low-sat-blue-dark; + } + } + } +} From 2852a4d6c362d137c1d34375f7039337887f4c26 Mon Sep 17 00:00:00 2001 From: Florian Strohmaier Date: Mon, 22 May 2023 15:23:53 +0200 Subject: [PATCH 12/15] ChannelForm: Clarify delete button label --- application/forms/ChannelForm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/forms/ChannelForm.php b/application/forms/ChannelForm.php index a8a31dec..c1e2717b 100644 --- a/application/forms/ChannelForm.php +++ b/application/forms/ChannelForm.php @@ -167,7 +167,7 @@ protected function assemble() 'submit', 'delete', [ - 'label' => $this->translate('Delete'), + 'label' => $this->translate('Delete Channel'), 'class' => 'btn-remove', 'formnovalidate' => true ] From e45eb7004b2379662b601aefacc828c2504f7eea Mon Sep 17 00:00:00 2001 From: Florian Strohmaier Date: Mon, 22 May 2023 15:24:13 +0200 Subject: [PATCH 13/15] ContactForm: Clarify delete button label --- library/Notifications/Web/Form/ContactForm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Notifications/Web/Form/ContactForm.php b/library/Notifications/Web/Form/ContactForm.php index 6e61e5d6..3cef308b 100644 --- a/library/Notifications/Web/Form/ContactForm.php +++ b/library/Notifications/Web/Form/ContactForm.php @@ -166,7 +166,7 @@ protected function assemble() 'submit', 'delete', [ - 'label' => $this->translate('Delete'), + 'label' => $this->translate('Delete Contact'), 'class' => 'btn-remove', 'formnovalidate' => true ] From 4b33a04c4dd02cf818d61431d774529253b283b1 Mon Sep 17 00:00:00 2001 From: Florian Strohmaier Date: Wed, 24 May 2023 11:13:31 +0200 Subject: [PATCH 14/15] event-rule-details.less: Remove unused `. new-event-rule --- public/css/detail/event-rule-detail.less | 4 ---- 1 file changed, 4 deletions(-) diff --git a/public/css/detail/event-rule-detail.less b/public/css/detail/event-rule-detail.less index 151f5659..9a437f5e 100644 --- a/public/css/detail/event-rule-detail.less +++ b/public/css/detail/event-rule-detail.less @@ -362,10 +362,6 @@ width: 14.5em; } -.new-event-rule { - margin-bottom: 1em; -} - .event-rule-and-save-forms { display: flex; flex-wrap: wrap; From d06d36c3834550615df95610e6fc51f03e130401 Mon Sep 17 00:00:00 2001 From: Florian Strohmaier Date: Wed, 24 May 2023 15:48:41 +0200 Subject: [PATCH 15/15] Make channel form button labels consistent --- application/controllers/ChannelsController.php | 4 ++-- application/forms/ChannelForm.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/controllers/ChannelsController.php b/application/controllers/ChannelsController.php index 1e87254a..7f7c2605 100644 --- a/application/controllers/ChannelsController.php +++ b/application/controllers/ChannelsController.php @@ -85,7 +85,7 @@ public function indexAction() $this->addControl($searchBar); $this->addContent( (new ButtonLink( - t('Add Channel'), + t('New Channel'), Url::fromPath('notifications/channels/add'), 'plus' ))->setBaseTarget('_next') @@ -101,7 +101,7 @@ public function indexAction() public function addAction() { - $this->addTitleTab(t('Add Channel')); + $this->addTitleTab(t('New Channel')); $form = (new ChannelForm($this->db)) ->on(ChannelForm::ON_SUCCESS, function (ChannelForm $form) { Notification::success( diff --git a/application/forms/ChannelForm.php b/application/forms/ChannelForm.php index c1e2717b..37a38d2b 100644 --- a/application/forms/ChannelForm.php +++ b/application/forms/ChannelForm.php @@ -156,7 +156,7 @@ protected function assemble() 'submit', [ 'label' => $this->channelId === null ? - $this->translate('Add Channel') : + $this->translate('Create Channel') : $this->translate('Save Changes') ] );