b4c11cd0a6
This commit adds MudTooltip components to action buttons in the Calendar, Events, Students, and Teams features, improving user experience by providing contextual information on button actions. The changes ensure that users receive helpful hints when hovering over buttons, enhancing accessibility and usability throughout the application.
109 lines
3.9 KiB
Plaintext
109 lines
3.9 KiB
Plaintext
@page "/students/details"
|
|
@attribute [Authorize]
|
|
@using Microsoft.EntityFrameworkCore
|
|
@using WebApp.Components.Shared.Components
|
|
@inject AppDbContext context
|
|
@inject NavigationManager NavigationManager
|
|
@inject IJSRuntime JSRuntime
|
|
|
|
@if (student is null)
|
|
{
|
|
<MudText><em>Loading...</em></MudText>
|
|
return;
|
|
}
|
|
|
|
<PageHeader
|
|
Title="Student Details"
|
|
ShowBackButton="true"
|
|
BackButtonUrl="@(ReturnUrl ?? "/students")">
|
|
<ActionButtons>
|
|
<div class="no-print">
|
|
<MudTooltip Text="Print">
|
|
<MudButton StartIcon="@Icons.Material.Filled.Print"
|
|
OnClick="PrintPage"
|
|
Variant="Variant.Outlined">Print</MudButton>
|
|
</MudTooltip>
|
|
<MudTooltip Text="Edit">
|
|
<MudButton StartIcon="@Icons.Material.Filled.Edit" Href="@($"/students/edit?id={student.Id}&returnUrl={ReturnUrl ?? "/students"}")" Variant="Variant.Outlined">Edit</MudButton>
|
|
</MudTooltip>
|
|
</div>
|
|
</ActionButtons>
|
|
</PageHeader>
|
|
|
|
<MudPaper Elevation="2" Class="pa-3 pa-md-6">
|
|
<MudText Typo="Typo.h5" Class="mb-4">Student Information</MudText>
|
|
<MudGrid Spacing="3">
|
|
<MudItem xs="12" sm="6" md="4">
|
|
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">First Name</MudText>
|
|
<MudText Typo="Typo.body1">@student.FirstName</MudText>
|
|
</MudItem>
|
|
<MudItem xs="12" sm="6" md="4">
|
|
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">Last Name</MudText>
|
|
<MudText Typo="Typo.body1">@student.LastName</MudText>
|
|
</MudItem>
|
|
<MudItem xs="12" sm="6" md="4">
|
|
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">Grade</MudText>
|
|
<MudText Typo="Typo.body1">@student.Grade</MudText>
|
|
</MudItem>
|
|
<MudItem xs="12" sm="6" md="4">
|
|
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">Email</MudText>
|
|
<MudText Typo="Typo.body1">@student.Email</MudText>
|
|
</MudItem>
|
|
<MudItem xs="12" sm="6" md="4">
|
|
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">Phone Number</MudText>
|
|
<MudText Typo="Typo.body1">@student.PhoneNumber</MudText>
|
|
</MudItem>
|
|
<MudItem xs="12" sm="6" md="4">
|
|
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">TSA Year</MudText>
|
|
<MudText Typo="Typo.body1">@student.TsaYear</MudText>
|
|
</MudItem>
|
|
</MudGrid>
|
|
|
|
<MudDivider Class="my-6" />
|
|
|
|
<MudText Typo="Typo.h5" Class="mb-4">TSA IDs</MudText>
|
|
<MudGrid Spacing="3">
|
|
<MudItem xs="12" sm="6" md="4">
|
|
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">State ID</MudText>
|
|
<MudText Typo="Typo.body1">@student.StateId</MudText>
|
|
</MudItem>
|
|
<MudItem xs="12" sm="6" md="4">
|
|
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">Regional ID</MudText>
|
|
<MudText Typo="Typo.body1">@student.RegionalId</MudText>
|
|
</MudItem>
|
|
<MudItem xs="12" sm="6" md="4">
|
|
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">National ID</MudText>
|
|
<MudText Typo="Typo.body1">@student.NationalId</MudText>
|
|
</MudItem>
|
|
<MudItem xs="12" sm="6" md="4">
|
|
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">Officer Role</MudText>
|
|
<MudText Typo="Typo.body1">@student.OfficerRole</MudText>
|
|
</MudItem>
|
|
</MudGrid>
|
|
</MudPaper>
|
|
|
|
@code {
|
|
private Student? student;
|
|
|
|
[SupplyParameterFromQuery]
|
|
private int Id { get; set; }
|
|
|
|
[SupplyParameterFromQuery]
|
|
private string? ReturnUrl { get; set; }
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
student = await context.Students.FirstOrDefaultAsync(m => m.Id == Id);
|
|
|
|
if (student is null)
|
|
{
|
|
NavigationManager.NavigateTo("notfound");
|
|
}
|
|
}
|
|
|
|
private async Task PrintPage()
|
|
{
|
|
await JSRuntime.InvokeVoidAsync("window.print");
|
|
}
|
|
}
|