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 IEventOccurrenceService EventOccurrenceService
<div class="no-print">
<PageHeader
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"
ShowBackButton="true"
BackButtonUrl="/calendar" />
</div>
@if (_students == null || _allOccurrences == null)
{
@@ -26,7 +28,7 @@ else
{
var opts = HandoutOptionsMonitor.CurrentValue;
<MudContainer>
<MudContainer Class="state-schedule-handout">
@foreach (var student in _students)
{
<MudContainer Class="pagebreak">
@@ -45,18 +47,25 @@ else
</MudText>
<MudText Typo="Typo.subtitle1" Class="mb-1">Events</MudText>
<MudTable Items="@GetEventSummaryRows(student)" Dense="true" Hover="false" Class="mb-4 nobrk">
<HeaderContent>
<MudTh>State ID</MudTh>
<MudTh>Event</MudTh>
<MudTh>Activity</MudTh>
</HeaderContent>
<RowTemplate>
<MudTd DataLabel="State ID">@context.StateRegistrationId</MudTd>
<MudTd DataLabel="Event">@context.EventName</MudTd>
<MudTd DataLabel="Activity">@context.Activity</MudTd>
</RowTemplate>
</MudTable>
<MudSimpleTable Dense="true" Class="state-schedule-table mb-4 nobrk">
<thead>
<tr>
<th>State ID</th>
<th>Event</th>
<th>Activity</th>
</tr>
</thead>
<tbody>
@foreach (var eventRow in GetEventSummaryRows(student))
{
<tr>
<td>@eventRow.StateRegistrationId</td>
<td>@eventRow.EventName</td>
<td>@eventRow.Activity</td>
</tr>
}
</tbody>
</MudSimpleTable>
@{
var scheduleRows = BuildStudentSchedule(student, opts).ToList();
+45 -1
View File
@@ -52,10 +52,54 @@
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 td {
.state-schedule-table td,
.state-schedule-table table th,
.state-schedule-table table td {
vertical-align: top;
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 {