This commit is contained in:
Sven Heidemann 2023-11-19 12:56:55 +01:00
parent 5e9280d972
commit 8788b727c5
6 changed files with 475 additions and 68 deletions

View File

@ -2,6 +2,7 @@ from datetime import datetime
from cpl_core.database.context import DatabaseContextABC from cpl_core.database.context import DatabaseContextABC
from cpl_discord.service import DiscordBotServiceABC from cpl_discord.service import DiscordBotServiceABC
from discord import EntityType
from bot_data.abc.server_repository_abc import ServerRepositoryABC from bot_data.abc.server_repository_abc import ServerRepositoryABC
from bot_data.abc.scheduled_event_repository_abc import ScheduledEventRepositoryABC from bot_data.abc.scheduled_event_repository_abc import ScheduledEventRepositoryABC
@ -85,7 +86,9 @@ class ScheduledEventMutation(QueryABC):
if "endTime" in input if "endTime" in input
else scheduled_event.end_time else scheduled_event.end_time
) )
scheduled_event.entity_type = input["entityType"] if "entityType" in input else scheduled_event.entity_type scheduled_event.entity_type = (
EntityType(int(input["entityType"])) if "entityType" in input else scheduled_event.entity_type
)
scheduled_event.location = input["location"] if "location" in input else scheduled_event.location scheduled_event.location = input["location"] if "location" in input else scheduled_event.location
self._scheduled_events.update_scheduled_event(scheduled_event) self._scheduled_events.update_scheduled_event(scheduled_event)

View File

@ -18,6 +18,6 @@ class ScheduledEventQuery(DataQueryWithHistoryABC):
self.set_field("channelId", lambda x, *_: x.channel_id) self.set_field("channelId", lambda x, *_: x.channel_id)
self.set_field("startTime", lambda x, *_: x.start_time) self.set_field("startTime", lambda x, *_: x.start_time)
self.set_field("endTime", lambda x, *_: x.end_time) self.set_field("endTime", lambda x, *_: x.end_time)
self.set_field("entityType", lambda x, *_: x.entity_type) self.set_field("entityType", lambda x, *_: x.entity_type.value)
self.set_field("location", lambda x, *_: x.location) self.set_field("location", lambda x, *_: x.location)
self.set_field("server", lambda x, *_: x.server) self.set_field("server", lambda x, *_: x.server)

View File

@ -58,7 +58,7 @@
<div style="display: flex; flex-direction: column; gap: 5px;"> <div style="display: flex; flex-direction: column; gap: 5px;">
{{'view.server.scheduled_events.edit_dialog.event_info.end_date_time' | translate}}: {{'view.server.scheduled_events.edit_dialog.event_info.end_date_time' | translate}}:
<p-calendar formControlName="endTime" dateFormat="dd.mm.yy" [showIcon]="true" <p-calendar formControlName="endTime" dateFormat="dd.mm.yy" [showIcon]="true"
[showTime]="true" [stepMinute]="15"></p-calendar> [showTime]="true"></p-calendar>
</div> </div>
<div style="display: flex; flex-direction: column; gap: 5px;"> <div style="display: flex; flex-direction: column; gap: 5px;">

View File

@ -187,12 +187,15 @@
} }
} }
.p-dialog-header { .p-dialog-header {
background-color: $secondaryBackgroundColor !important; background-color: $primaryBackgroundColor !important;
color: $primaryTextColor !important; color: $primaryTextColor !important;
} }
.p-dialog-content { .p-dialog-content {
background-color: $secondaryBackgroundColor !important;
.content-data-name, .content-data-name,
.content-data-value { .content-data-value {
color: $primaryTextColor; color: $primaryTextColor;
@ -345,9 +348,11 @@
} }
p-dropdown { p-dropdown {
.p-dropdown { .p-dropdown {
background-color: $primaryBackgroundColor !important; border: $default-border;
border-color: $primaryTextColor !important; border-radius: 10px;
background-color: $secondaryBackgroundColor !important;
color: $primaryTextColor !important; color: $primaryTextColor !important;
span { span {
@ -411,8 +416,6 @@
} }
} }
} }
} }
.table-edit-input { .table-edit-input {
@ -537,6 +540,10 @@
} }
.icon-btn { .icon-btn {
.p-button-label {
transition-duration: unset !important;
}
&:hover { &:hover {
background-color: transparent !important; background-color: transparent !important;
color: $primaryHeaderColor !important; color: $primaryHeaderColor !important;
@ -544,6 +551,7 @@
} }
} }
.danger-btn,
.danger-icon-btn { .danger-icon-btn {
background-color: transparent !important; background-color: transparent !important;
color: $primaryTextColor !important; color: $primaryTextColor !important;
@ -560,25 +568,11 @@
} }
} }
.danger-btn {
background-color: $primaryErrorColor !important;
color: $primaryErrorColor !important;
border: 0 !important;
&:hover {
background-color: $primaryErrorColor !important;
color: $primaryTextColor !important;
border: 0;
}
.pi {
font-size: 1.275rem !important;
}
}
.p-datatable .p-sortable-column.p-highlight, .p-datatable .p-sortable-column.p-highlight,
.p-datatable .p-sortable-column.p-highlight .p-sortable-column-icon { .p-datatable .p-sortable-column.p-highlight .p-sortable-column-icon,
.p-datatable .p-sortable-column:not(.p-highlight):hover {
color: $primaryHeaderColor !important; color: $primaryHeaderColor !important;
background-color: transparent !important;
} }
.p-dropdown:not(.p-disabled):hover, .p-dropdown:not(.p-disabled):hover,
@ -616,6 +610,27 @@
} }
} }
.p-selectbutton {
.p-highlight {
background-color: $primaryHeaderColor !important;
}
.p-button {
border: 1px solid $primaryHeaderColor !important;
&:hover {
background-color: $secondaryHeaderColor !important;
border: 1px solid $secondaryHeaderColor !important;
}
&:focus {
border-color: $primaryHeaderColor !important;
box-shadow: none !important;
}
}
}
.p-multiselect { .p-multiselect {
background-color: $primaryBackgroundColor !important; background-color: $primaryBackgroundColor !important;
color: $primaryTextColor !important; color: $primaryTextColor !important;
@ -661,4 +676,141 @@
} }
} }
} }
.p-inputswitch.p-inputswitch-checked .p-inputswitch-slider {
background: $primaryHeaderColor !important;
}
.p-inputswitch.p-focus .p-inputswitch-slider {
box-shadow: none !important;
}
p-inputNumber {
background-color: $primaryBackgroundColor !important;
}
p-calendar > span > button {
background-color: $primaryHeaderColor !important;
border: 1px solid $primaryHeaderColor !important;
&:focus {
box-shadow: none !important;
}
}
.p-calendar {
.p-datepicker:not(.p-datepicker-inline) {
background-color: $secondaryBackgroundColor !important;
}
.p-datepicker {
color: $primaryTextColor !important;
.p-datepicker-header {
color: $primaryHeaderColor !important;
background-color: $primaryBackgroundColor !important;
.p-datepicker-title .p-datepicker-year,
.p-datepicker-title .p-datepicker-month,
.p-datepicker .p-datepicker-header .p-datepicker-title .p-datepicker-month {
color: $primaryTextColor !important;
&:hover {
color: $primaryHeaderColor !important;
}
&:focus {
box-shadow: none !important;
}
}
}
}
table td > span {
color: $primaryTextColor !important;
&:hover {
color: $primaryHeaderColor !important;
background-color: $primaryBackgroundColor !important;
}
&:focus {
box-shadow: none !important;
}
}
table td.p-datepicker-today > span {
color: $primaryHeaderColor !important;
background-color: $primaryBackgroundColor !important;
}
table td > span.p-highlight {
color: $primaryHeaderColor !important;
background-color: $primaryBackgroundColor !important;
}
.p-yearpicker .p-yearpicker-year,
.p-monthpicker .p-monthpicker-month:not(.p-disabled):not(.p-highlight) {
color: $primaryTextColor !important;
background-color: $secondaryBackgroundColor !important;
&:hover {
color: $primaryHeaderColor !important;
}
&:focus {
box-shadow: none !important;
}
}
}
.edit-dialog {
textarea {
background-color: $secondaryBackgroundColor;
color: $primaryTextColor;
&:hover {
border-color: $primaryHeaderColor;
}
&:focus {
border-color: $primaryHeaderColor;
}
}
.p-dialog-content {
.p-tabview {
.p-tabview-nav li .p-tabview-nav-link:not(.p-disabled):focus {
box-shadow: none !important;
}
.p-tabview-nav li.p-highlight .p-tabview-nav-link {
color: $primaryHeaderColor !important;
border-color: $primaryHeaderColor !important;
}
.p-tabview-nav,
.p-tabview-nav li .p-tabview-nav-link,
.p-tabview-panels {
background-color: $secondaryBackgroundColor !important;
color: $primaryTextColor !important;
}
}
}
}
.p-radiobutton {
.p-radiobutton-box.p-highlight {
border-color: $primaryHeaderColor !important;
background: $primaryHeaderColor !important;
}
.p-radiobutton-box:not(.p-disabled):not(.p-highlight):hover {
border-color: $primaryHeaderColor !important;
}
.p-radiobutton-box:not(.p-disabled).p-focus {
box-shadow: none !important;
}
}
} }

View File

@ -544,6 +544,7 @@
} }
} }
.danger-btn,
.danger-icon-btn { .danger-icon-btn {
background-color: transparent !important; background-color: transparent !important;
color: $primaryTextColor !important; color: $primaryTextColor !important;
@ -560,22 +561,6 @@
} }
} }
.danger-btn {
background-color: $primaryErrorColor !important;
color: $primaryErrorColor !important;
border: 0 !important;
&:hover {
background-color: $primaryErrorColor !important;
color: $primaryTextColor !important;
border: 0;
}
.pi {
font-size: 1.275rem !important;
}
}
.p-datatable .p-sortable-column.p-highlight, .p-datatable .p-sortable-column.p-highlight,
.p-datatable .p-sortable-column.p-highlight .p-sortable-column-icon { .p-datatable .p-sortable-column.p-highlight .p-sortable-column-icon {
color: $primaryHeaderColor !important; color: $primaryHeaderColor !important;
@ -602,16 +587,23 @@
color: $primaryHeaderColor !important; color: $primaryHeaderColor !important;
} }
.input-number { .p-selectbutton {
span { .p-highlight {
.p-button {
background-color: $primaryHeaderColor !important; background-color: $primaryHeaderColor !important;
}
.p-button {
border: 1px solid $primaryHeaderColor !important; border: 1px solid $primaryHeaderColor !important;
&:hover { &:hover {
background-color: $secondaryHeaderColor !important; background-color: $secondaryHeaderColor !important;
border: 1px solid $secondaryHeaderColor !important; border: 1px solid $secondaryHeaderColor !important;
} }
&:focus {
border-color: $primaryHeaderColor !important;
box-shadow: none !important;
} }
} }
} }
@ -629,12 +621,12 @@
.p-multiselect-panel { .p-multiselect-panel {
.p-multiselect-header { .p-multiselect-header {
background-color: $secondaryBackgroundColor !important; background-color: $primaryBackgroundColor !important;
} }
.p-multiselect-items, .p-multiselect-items,
.p-multiselect-item { .p-multiselect-item {
background-color: $primaryBackgroundColor !important; background-color: $secondaryBackgroundColor !important;
} }
.p-multiselect-item { .p-multiselect-item {
@ -661,4 +653,141 @@
} }
} }
} }
.p-inputswitch.p-inputswitch-checked .p-inputswitch-slider {
background: $primaryHeaderColor !important;
}
.p-inputswitch.p-focus .p-inputswitch-slider {
box-shadow: none !important;
}
p-inputNumber {
background-color: $primaryBackgroundColor !important;
}
p-calendar > span > button {
background-color: $primaryHeaderColor !important;
border: 1px solid $primaryHeaderColor !important;
&:focus {
box-shadow: none !important;
}
}
.p-calendar {
.p-datepicker:not(.p-datepicker-inline) {
background-color: $primaryBackgroundColor !important;
}
.p-datepicker {
color: $primaryTextColor !important;
.p-datepicker-header {
color: $primaryHeaderColor !important;
background-color: $primaryBackgroundColor !important;
.p-datepicker-title .p-datepicker-year,
.p-datepicker-title .p-datepicker-month,
.p-datepicker .p-datepicker-header .p-datepicker-title .p-datepicker-month {
color: $primaryTextColor !important;
&:hover {
color: $primaryHeaderColor !important;
}
&:focus {
box-shadow: none !important;
}
}
}
}
table td > span {
color: $primaryTextColor !important;
&:hover {
color: $primaryHeaderColor !important;
background-color: $primaryBackgroundColor !important;
}
&:focus {
box-shadow: none !important;
}
}
table td.p-datepicker-today > span {
color: $primaryHeaderColor !important;
background-color: $primaryBackgroundColor !important;
}
table td > span.p-highlight {
color: $primaryHeaderColor !important;
background-color: $primaryBackgroundColor !important;
}
.p-yearpicker .p-yearpicker-year,
.p-monthpicker .p-monthpicker-month:not(.p-disabled):not(.p-highlight) {
color: $primaryTextColor !important;
background-color: $secondaryBackgroundColor !important;
&:hover {
color: $primaryHeaderColor !important;
}
&:focus {
box-shadow: none !important;
}
}
}
.edit-dialog {
textarea {
background-color: $primaryBackgroundColor;
color: $primaryTextColor;
&:hover {
border-color: $primaryHeaderColor;
}
&:focus {
border-color: $primaryHeaderColor;
}
}
.p-dialog-content {
.p-tabview {
.p-tabview-nav li .p-tabview-nav-link:not(.p-disabled):focus {
box-shadow: none !important;
}
.p-tabview-nav li.p-highlight .p-tabview-nav-link {
color: $primaryHeaderColor !important;
border-color: $primaryHeaderColor !important;
}
.p-tabview-nav,
.p-tabview-nav li .p-tabview-nav-link,
.p-tabview-panels {
background-color: $primaryBackgroundColor !important;
color: $primaryTextColor !important;
}
}
}
}
.p-radiobutton {
.p-radiobutton-box.p-highlight {
border-color: $primaryHeaderColor !important;
background: $primaryHeaderColor !important;
}
.p-radiobutton-box:not(.p-disabled):not(.p-highlight):hover {
border-color: $primaryHeaderColor !important;
}
.p-radiobutton-box:not(.p-disabled).p-focus {
box-shadow: none !important;
}
}
} }

View File

@ -544,6 +544,7 @@
} }
} }
.danger-btn,
.danger-icon-btn { .danger-icon-btn {
background-color: transparent !important; background-color: transparent !important;
color: $primaryTextColor !important; color: $primaryTextColor !important;
@ -560,22 +561,6 @@
} }
} }
.danger-btn {
background-color: $primaryErrorColor !important;
color: $primaryErrorColor !important;
border: 0 !important;
&:hover {
background-color: $primaryErrorColor !important;
color: $primaryTextColor !important;
border: 0;
}
.pi {
font-size: 1.275rem !important;
}
}
.p-datatable .p-sortable-column.p-highlight, .p-datatable .p-sortable-column.p-highlight,
.p-datatable .p-sortable-column.p-highlight .p-sortable-column-icon { .p-datatable .p-sortable-column.p-highlight .p-sortable-column-icon {
color: $primaryHeaderColor !important; color: $primaryHeaderColor !important;
@ -661,4 +646,142 @@
} }
} }
} }
.p-inputswitch.p-inputswitch-checked .p-inputswitch-slider {
background: $primaryHeaderColor !important;
}
.p-inputswitch.p-focus .p-inputswitch-slider {
box-shadow: none !important;
}
p-inputNumber {
background-color: $primaryBackgroundColor !important;
}
p-calendar > span > button {
background-color: $primaryHeaderColor !important;
border: 1px solid $primaryHeaderColor !important;
&:focus {
box-shadow: none !important;
}
}
.p-calendar {
.p-datepicker:not(.p-datepicker-inline) {
background-color: $primaryBackgroundColor !important;
}
.p-datepicker {
color: $primaryTextColor !important;
.p-datepicker-header {
color: $primaryHeaderColor !important;
background-color: $primaryBackgroundColor !important;
.p-datepicker-title .p-datepicker-year,
.p-datepicker-title .p-datepicker-month,
.p-datepicker .p-datepicker-header .p-datepicker-title .p-datepicker-month {
color: $primaryTextColor !important;
&:hover {
color: $primaryHeaderColor !important;
}
&:focus {
box-shadow: none !important;
}
}
}
}
table td > span {
color: $primaryTextColor !important;
&:hover {
color: $primaryHeaderColor !important;
background-color: $primaryBackgroundColor !important;
}
&:focus {
box-shadow: none !important;
}
}
table td.p-datepicker-today > span {
color: $primaryHeaderColor !important;
background-color: $primaryBackgroundColor !important;
}
table td > span.p-highlight {
color: $primaryHeaderColor !important;
background-color: $primaryBackgroundColor !important;
}
.p-yearpicker .p-yearpicker-year,
.p-monthpicker .p-monthpicker-month:not(.p-disabled):not(.p-highlight) {
color: $primaryTextColor !important;
background-color: $secondaryBackgroundColor !important;
&:hover {
color: $primaryHeaderColor !important;
}
&:focus {
box-shadow: none !important;
}
}
}
.edit-dialog {
textarea {
background-color: $primaryBackgroundColor;
color: $primaryTextColor;
&:hover {
border-color: $primaryHeaderColor;
}
&:focus {
border-color: $primaryHeaderColor;
}
}
.p-dialog-content {
.p-tabview {
.p-tabview-nav li .p-tabview-nav-link:not(.p-disabled):focus {
box-shadow: none !important;
}
.p-tabview-nav li.p-highlight .p-tabview-nav-link {
color: $primaryHeaderColor !important;
border-color: $primaryHeaderColor !important;
}
.p-tabview-nav,
.p-tabview-nav li .p-tabview-nav-link,
.p-tabview-panels {
background-color: $primaryBackgroundColor !important;
color: $primaryTextColor !important;
}
}
}
}
.p-radiobutton {
.p-radiobutton-box.p-highlight {
border-color: $primaryHeaderColor !important;
background: $primaryHeaderColor !important;
}
.p-radiobutton-box:not(.p-disabled):not(.p-highlight):hover {
border-color: $primaryHeaderColor !important;
}
.p-radiobutton-box:not(.p-disabled).p-focus {
box-shadow: none !important;
}
}
} }