87db67f979
Updated the MudPaper component styling in multiple files to use a consistent padding class of "pa-3 pa-md-6" instead of "pa-6". This change enhances the visual consistency of the UI across the Calendar, Events, Students, and Teams components, improving the overall user experience.
86 lines
2.8 KiB
Plaintext
86 lines
2.8 KiB
Plaintext
@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)
|
|
{
|
|
<p><em>Loading...</em></p>
|
|
return;
|
|
}
|
|
|
|
<PageHeader
|
|
Title="Team Details"
|
|
ShowBackButton="true"
|
|
BackButtonUrl="@(ReturnUrl ?? "/teams")">
|
|
<ActionButtons>
|
|
<div class="no-print">
|
|
<MudButton StartIcon="@Icons.Material.Filled.Print"
|
|
OnClick="PrintPage"
|
|
Variant="Variant.Outlined">Print</MudButton>
|
|
<MudButton StartIcon="@Icons.Material.Filled.Edit"
|
|
Href="@($"/teams/edit?id={Team.Id}&returnUrl={ReturnUrl ?? "/teams"}")"
|
|
Variant="Variant.Outlined">Edit</MudButton>
|
|
</div>
|
|
</ActionButtons>
|
|
</PageHeader>
|
|
|
|
<MudPaper Elevation="2" Class="pa-3 pa-md-6">
|
|
<MudText Typo="Typo.h5" Class="mb-4">Team Information</MudText>
|
|
<MudGrid Spacing="3">
|
|
<MudItem xs="12" sm="6">
|
|
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">Event</MudText>
|
|
<MudText Typo="Typo.body1">@Team.Event.Name</MudText>
|
|
</MudItem>
|
|
<MudItem xs="12" sm="6">
|
|
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">Event Format</MudText>
|
|
<MudText Typo="Typo.body1">@Team.Event.EventFormat</MudText>
|
|
</MudItem>
|
|
<MudItem xs="12" sm="6">
|
|
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">Team Identifier</MudText>
|
|
<MudText Typo="Typo.body1">@(Team.Identifier ?? "N/A")</MudText>
|
|
</MudItem>
|
|
<MudItem xs="12" sm="6">
|
|
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">Captain</MudText>
|
|
<MudText Typo="Typo.body1">@(Team.Captain?.FirstNameLastName ?? "N/A")</MudText>
|
|
</MudItem>
|
|
<MudItem xs="12">
|
|
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">Team Members</MudText>
|
|
<TeamStudents Team="@Team" />
|
|
</MudItem>
|
|
</MudGrid>
|
|
</MudPaper>
|
|
|
|
@code {
|
|
[SupplyParameterFromQuery]
|
|
private int Id { get; set; }
|
|
|
|
[SupplyParameterFromQuery]
|
|
private string? ReturnUrl { 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");
|
|
}
|
|
}
|