Refactor StateScheduleHandout component for improved print layout and styling

This commit is contained in:
2026-04-07 08:39:14 -04:00
parent a9036d5d04
commit 4401e4a3ec
2 changed files with 76 additions and 23 deletions
@@ -11,12 +11,14 @@
@inject IOptionsMonitor<StateScheduleHandoutOptions> HandoutOptionsMonitor @inject IOptionsMonitor<StateScheduleHandoutOptions> HandoutOptionsMonitor
@inject IEventOccurrenceService EventOccurrenceService @inject IEventOccurrenceService EventOccurrenceService
<div class="no-print">
<PageHeader <PageHeader
Title="State schedule handout" Title="State schedule handout"
Description="Print per-student schedules and the combined master list (browser Print)." Description="Print per-student schedules and the combined master list."
Icon="@Icons.Material.Filled.Print" Icon="@Icons.Material.Filled.Print"
ShowBackButton="true" ShowBackButton="true"
BackButtonUrl="/calendar" /> BackButtonUrl="/calendar" />
</div>
@if (_students == null || _allOccurrences == null) @if (_students == null || _allOccurrences == null)
{ {
@@ -26,7 +28,7 @@ else
{ {
var opts = HandoutOptionsMonitor.CurrentValue; var opts = HandoutOptionsMonitor.CurrentValue;
<MudContainer> <MudContainer Class="state-schedule-handout">
@foreach (var student in _students) @foreach (var student in _students)
{ {
<MudContainer Class="pagebreak"> <MudContainer Class="pagebreak">
@@ -45,18 +47,25 @@ else
</MudText> </MudText>
<MudText Typo="Typo.subtitle1" Class="mb-1">Events</MudText> <MudText Typo="Typo.subtitle1" Class="mb-1">Events</MudText>
<MudTable Items="@GetEventSummaryRows(student)" Dense="true" Hover="false" Class="mb-4 nobrk"> <MudSimpleTable Dense="true" Class="state-schedule-table mb-4 nobrk">
<HeaderContent> <thead>
<MudTh>State ID</MudTh> <tr>
<MudTh>Event</MudTh> <th>State ID</th>
<MudTh>Activity</MudTh> <th>Event</th>
</HeaderContent> <th>Activity</th>
<RowTemplate> </tr>
<MudTd DataLabel="State ID">@context.StateRegistrationId</MudTd> </thead>
<MudTd DataLabel="Event">@context.EventName</MudTd> <tbody>
<MudTd DataLabel="Activity">@context.Activity</MudTd> @foreach (var eventRow in GetEventSummaryRows(student))
</RowTemplate> {
</MudTable> <tr>
<td>@eventRow.StateRegistrationId</td>
<td>@eventRow.EventName</td>
<td>@eventRow.Activity</td>
</tr>
}
</tbody>
</MudSimpleTable>
@{ @{
var scheduleRows = BuildStudentSchedule(student, opts).ToList(); var scheduleRows = BuildStudentSchedule(student, opts).ToList();
+45 -1
View File
@@ -52,10 +52,54 @@
width: 100%; width: 100%;
} }
@media print {
.state-schedule-handout {
margin-left: -30pt !important;
margin-right: -12pt !important;
padding-left: 0 !important;
padding-right: 0 !important;
width: calc(100% + 42pt) !important;
max-width: none !important;
}
.state-schedule-handout .mud-paper,
.state-schedule-handout .mud-table-container,
.state-schedule-handout .mud-table {
box-shadow: none !important;
}
.state-schedule-table,
.state-schedule-table table {
width: 100%;
border-collapse: collapse;
}
.state-schedule-table th, .state-schedule-table th,
.state-schedule-table td { .state-schedule-table td,
.state-schedule-table table th,
.state-schedule-table table td {
vertical-align: top; vertical-align: top;
padding: 4px 8px; padding: 4px 8px;
border-top: none !important;
border-left: none !important;
border-right: none !important;
border-bottom: none !important;
}
.state-schedule-table thead th,
.state-schedule-table table thead th {
border-bottom: 2px solid #000 !important;
}
.state-schedule-table tbody td,
.state-schedule-table table tbody td {
border-bottom: 1px solid #000 !important;
}
.state-schedule-table tbody tr:last-child td,
.state-schedule-table table tbody tr:last-child td {
border-bottom: none !important;
}
} }
.page-header { .page-header {