diff --git a/WebApp/Components/Features/Calendar/EventOccurrenceDetailsDialog.razor b/WebApp/Components/Features/Calendar/EventOccurrenceDetailsDialog.razor index 8b13789..ecc4ac4 100644 --- a/WebApp/Components/Features/Calendar/EventOccurrenceDetailsDialog.razor +++ b/WebApp/Components/Features/Calendar/EventOccurrenceDetailsDialog.razor @@ -1 +1,72 @@ +@namespace WebApp.Components.Features.Calendar +@using Core.Entities + + + + @if (EventOccurrence == null) + { + + Event details are unavailable. + + } + else + { + + + @(EventDefinition?.Name ?? EventOccurrence.Name) + + + + + + Occurrence: @EventOccurrence.Name + + + Start: @EventOccurrence.StartTime.ToString("f") + + @if (EventOccurrence.EndTime != null) + { + + End: @EventOccurrence.EndTime.Value.ToString("f") + + } + @if (!string.IsNullOrWhiteSpace(EventOccurrence.Location)) + { + + Location: @EventOccurrence.Location + + } + @if (StudentFirstNames.Any()) + { + + Students: @string.Join(", ", StudentFirstNames) + + } + + } + + + + Close + + + +@code { + [CascadingParameter] + public IMudDialogInstance MudDialog { get; set; } = null!; + + [Parameter] + public EventOccurrence? EventOccurrence { get; set; } + + [Parameter] + public EventDefinition? EventDefinition { get; set; } + + [Parameter] + public List StudentFirstNames { get; set; } = []; + + private void Close() + { + MudDialog.Close(); + } +} diff --git a/WebApp/Components/Features/Calendar/StateScheduleHandout.razor b/WebApp/Components/Features/Calendar/StateScheduleHandout.razor index aaceb79..a533b93 100644 --- a/WebApp/Components/Features/Calendar/StateScheduleHandout.razor +++ b/WebApp/Components/Features/Calendar/StateScheduleHandout.razor @@ -123,13 +123,59 @@ else - @foreach (var occ in dateGroup.OrderBy(o => o.StartTime)) + @foreach (var tlGroup in dateGroup + .OrderBy(o => o.StartTime) + .GroupBy(o => (FormatTimeDisplay(o), o.Location ?? "")) + .Select(g => g.ToList())) { - - @FormatTimeDisplay(occ) - @FormatCombinedScheduleEventCell(occ) - @(occ.Location ?? "") - + if (tlGroup.Count == 1) + { + var occ = tlGroup[0]; + + @FormatTimeDisplay(occ) + @FormatCombinedScheduleEventCell(occ) + @(occ.Location ?? "") + + } + else + { + var genericOcc = tlGroup.FirstOrDefault(o => !o.EventDefinitionId.HasValue); + var specificOccs = tlGroup + .Where(o => o.EventDefinitionId.HasValue) + .OrderBy(o => FormatEventColumn(o), StringComparer.OrdinalIgnoreCase) + .ToList(); + var rowCount = (genericOcc != null ? 1 : 0) + specificOccs.Count; + var representative = genericOcc ?? specificOccs[0]; + + if (genericOcc != null) + { + + @FormatTimeDisplay(representative) + @FormatCombinedScheduleEventCell(genericOcc) + @(representative.Location ?? "") + + @foreach (var sub in specificOccs) + { + + @FormatCombinedScheduleEventCell(sub) + + } + } + else + { + + @FormatTimeDisplay(representative) + @FormatCombinedScheduleEventCell(specificOccs[0]) + @(representative.Location ?? "") + + @foreach (var sub in specificOccs.Skip(1)) + { + + @FormatCombinedScheduleEventCell(sub) + + } + } + } } diff --git a/WebApp/wwwroot/app.css b/WebApp/wwwroot/app.css index c9bd47a..1d66831 100644 --- a/WebApp/wwwroot/app.css +++ b/WebApp/wwwroot/app.css @@ -52,6 +52,17 @@ width: 100%; } +.state-schedule-table th, +.state-schedule-table td, +.state-schedule-table table th, +.state-schedule-table table td { + vertical-align: top !important; +} + +.combined-sub-event { + padding-left: 1.5rem !important; +} + @media print { .state-schedule-handout { margin-left: -30pt !important; @@ -100,6 +111,11 @@ .state-schedule-table table tbody tr:last-child td { border-bottom: none !important; } + + .state-schedule-table .combined-sub-event, + .state-schedule-table table .combined-sub-event { + padding-left: 1.5rem !important; + } } .page-header {