diff --git a/WebApp/Components/Features/Events/Details.razor b/WebApp/Components/Features/Events/Details.razor index d1008eb..9fa7d71 100644 --- a/WebApp/Components/Features/Events/Details.razor +++ b/WebApp/Components/Features/Events/Details.razor @@ -4,6 +4,7 @@ @using WebApp.Components.Shared.Components @inject AppDbContext context @inject NavigationManager NavigationManager +@inject IJSRuntime JSRuntime @if (eventdefinition is null) { @@ -17,8 +18,13 @@ ShowBackButton="true" BackButtonUrl="/events"> - Edit - Back to List +
+ Print + Edit + Back to List +
@@ -102,4 +108,9 @@ NavigationManager.NavigateTo("notfound"); } } + + private async Task PrintPage() + { + await JSRuntime.InvokeVoidAsync("window.print"); + } } diff --git a/WebApp/Components/Features/Events/Index.razor b/WebApp/Components/Features/Events/Index.razor index 0530d49..0ce099e 100644 --- a/WebApp/Components/Features/Events/Index.razor +++ b/WebApp/Components/Features/Events/Index.razor @@ -16,7 +16,28 @@ - + + + + + @context.Item.Name + + + + + + + + @@ -34,14 +55,6 @@ - - - - - - diff --git a/WebApp/Components/Features/Students/Details.razor b/WebApp/Components/Features/Students/Details.razor index 5f07b35..85156f7 100644 --- a/WebApp/Components/Features/Students/Details.razor +++ b/WebApp/Components/Features/Students/Details.razor @@ -4,6 +4,7 @@ @using WebApp.Components.Shared.Components @inject AppDbContext context @inject NavigationManager NavigationManager +@inject IJSRuntime JSRuntime @if (student is null) { @@ -16,8 +17,13 @@ ShowBackButton="true" BackButtonUrl="@(ReturnUrl ?? "/students")"> - Edit - Back to List +
+ Print + Edit + Back to List +
@@ -84,4 +90,9 @@ NavigationManager.NavigateTo("notfound"); } } + + private async Task PrintPage() + { + await JSRuntime.InvokeVoidAsync("window.print"); + } } diff --git a/WebApp/Components/Features/Students/Index.razor b/WebApp/Components/Features/Students/Index.razor index 8f40949..ec3881b 100644 --- a/WebApp/Components/Features/Students/Index.razor +++ b/WebApp/Components/Features/Students/Index.razor @@ -19,11 +19,30 @@ - @context.Item.LastNameFirstName - @if (context.Item.OfficerRole != null) - { - @context.Item.OfficerRole - } + + + + @context.Item.LastNameFirstName + + @if (context.Item.OfficerRole != null) + { + @context.Item.OfficerRole + } + + + + + + @@ -31,14 +50,6 @@ @context.Item.Grade (@context.Item.TsaYear) - - - - - - diff --git a/WebApp/Components/Features/Teams/Details.razor b/WebApp/Components/Features/Teams/Details.razor new file mode 100644 index 0000000..f3b09d6 --- /dev/null +++ b/WebApp/Components/Features/Teams/Details.razor @@ -0,0 +1,82 @@ +@page "/teams/details" +@attribute [Authorize] +@using Microsoft.EntityFrameworkCore +@using WebApp.Components.Shared.Components +@using WebApp.Components.Features.Teams.Components +@inject AppDbContext Context +@inject NavigationManager NavigationManager +@inject IJSRuntime JSRuntime + +@if (Team is null) +{ +

Loading...

+ return; +} + + + +
+ Print + Edit + Back to List +
+
+
+ + + + + Event + @Team.Event.Name + + + Event Format + @Team.Event.EventFormat + + + Team Identifier + @(Team.Identifier ?? "N/A") + + + Captain + @(Team.Captain?.FirstNameLastName ?? "N/A") + + + Team Members + + + + + +@code { + [SupplyParameterFromQuery] + private int Id { get; set; } + + private Team? Team { get; set; } + + protected override async Task OnInitializedAsync() + { + Team = await Context.Teams + .Include(t => t.Event) + .Include(t => t.Students) + .Include(t => t.Captain) + .FirstOrDefaultAsync(m => m.Id == Id); + + if (Team is null) + { + NavigationManager.NavigateTo("notfound"); + } + } + + private async Task PrintPage() + { + await JSRuntime.InvokeVoidAsync("window.print"); + } +} diff --git a/WebApp/Components/Features/Teams/Index.razor b/WebApp/Components/Features/Teams/Index.razor index f69c50e..bf9c2e1 100644 --- a/WebApp/Components/Features/Teams/Index.razor +++ b/WebApp/Components/Features/Teams/Index.razor @@ -16,9 +16,26 @@ - + - @context.Item.ToString() + + + @context.Item.ToString() + + + + + + @@ -31,14 +48,6 @@ - - - - - - diff --git a/WebApp/Components/Shared/Components/PageHeader.razor b/WebApp/Components/Shared/Components/PageHeader.razor index 4ac909b..6b19045 100644 --- a/WebApp/Components/Shared/Components/PageHeader.razor +++ b/WebApp/Components/Shared/Components/PageHeader.razor @@ -19,7 +19,8 @@ + Color="Color.Default" + Class="no-print" /> } @* Icon *@