Visualize Upcoming Deadlines (use default view)
All checks were successful
Java CI with Maven / build-and-push-frontend (push) Successful in 11s
Java CI with Maven / build-and-push-backend (push) Successful in 8s

This commit is contained in:
Sebastian Böckelmann 2024-03-17 12:04:59 +01:00
parent f921d1d222
commit 9d20335c59
3 changed files with 26 additions and 44 deletions

View File

@ -24,31 +24,3 @@
.undecorated-link:hover { .undecorated-link:hover {
color: #3498db; color: #3498db;
} }
.cal-event-title {
color: black;
margin-left: 5px;
white-space: nowrap;
display: inline-block;
}
.cal-event-circle {
width: 10px; /* Beispielgröße für den Kreis */
height: 10px; /* Beispielgröße für den Kreis */
border-radius: 50%;
display: inline-block;
background-color: #1e90ff;
vertical-align: top; /* Vertikale Ausrichtung zentrieren */
}
.event {
display: block;
align-items: center;
margin-bottom: 10px;
}
.cal-cell-content {
width: calc(100% - 20px); /* Breite der Zelle abzüglich des linken Randes für den Titel */
}

View File

@ -1,21 +1,8 @@
<div class="container"> <div class="container">
<app-navigation-link-list [navigationLinks]="defaultNavigationLinkPath"></app-navigation-link-list> <app-navigation-link-list [navigationLinks]="defaultNavigationLinkPath"></app-navigation-link-list>
<ng-template #customCellTemplate let-day="day" let-locale="locale">
<div class="cal-cell-top"> <mwl-calendar-month-view [viewDate]="viewDate" [events]="events" [refresh]="refresh" (dayClicked)="dayClicked($event.day)" [activeDayIsOpen]="activeDayIsOpen"
<span class="cal-day-badge" *ngIf="day.badgeTotal > 0">{{ day.badgeTotal }}</span>
<span class="cal-day-number">{{ day.date | calendarDate:'monthViewDayNumber':locale }}</span>
</div>
<div class="cal-cell-content">
<div class="cal-events">
<div *ngFor="let event of day.events" class="event">
<div class="cal-event-circle"></div> <!-- Small circle -->
<div class="cal-event-title">{{ event.title }}</div> <!-- Event title -->
</div>
</div>
</div>
</ng-template>
<mwl-calendar-month-view [viewDate]="viewDate" [events]="events" [cellTemplate]="customCellTemplate" [refresh]="refresh"
></mwl-calendar-month-view> ></mwl-calendar-month-view>
</div> </div>

View File

@ -24,9 +24,24 @@ export class UpcomingDeadlinesOverviewComponent implements OnInit{
} }
] ]
events: CalendarEvent[] = [] events: CalendarEvent[] = [{
title: "testdkjawfwekjdbjfbjsekdhwadvsjfbsadgascbsdadkawsdjkasfc",
start: moment("2024-03-18").toDate(),
end: moment("2024-03-18").toDate(),
resizable: {
beforeStart: false,
afterEnd: false
},
draggable: false,
allDay: true,
color: {
primary: '#1e90ff',
secondary: '#D1E8FF',
}
}]
viewDate = new Date() viewDate = new Date()
refresh: Subject<void> = new Subject<void>() refresh: Subject<void> = new Subject<void>()
activeDayIsOpen = false;
constructor(private taskService: TaskService) { constructor(private taskService: TaskService) {
} }
@ -57,4 +72,12 @@ export class UpcomingDeadlinesOverviewComponent implements OnInit{
} }
}) })
} }
dayClicked({ date, events }: { date: Date; events: CalendarEvent[] }): void {
if (moment(date).isSame(this.viewDate, 'month')) {
this.activeDayIsOpen = !((moment(date).isSame(this.viewDate, 'day') && this.activeDayIsOpen) ||
events.length === 0);
this.viewDate = date;
}
}
} }