Use PageHeader throughout the system
This commit is contained in:
@@ -1,16 +1,21 @@
|
|||||||
@page "/events/create"
|
@page "/events/create"
|
||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
|
@using WebApp.Components.Shared.Components
|
||||||
@inject AppDbContext context
|
@inject AppDbContext context
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
|
|
||||||
<PageTitle>Create Event - TSA Chapter Organizer</PageTitle>
|
<PageHeader
|
||||||
|
Title="Create"
|
||||||
|
Subtitle="Event"
|
||||||
|
ShowBackButton="true"
|
||||||
|
BackButtonUrl="/events">
|
||||||
|
<ActionButtons>
|
||||||
|
<MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" Color="Color.Primary" Form="create-event-form">Create</MudButton>
|
||||||
|
<MudButton Href="/events" Variant="Variant.Text">Cancel</MudButton>
|
||||||
|
</ActionButtons>
|
||||||
|
</PageHeader>
|
||||||
|
|
||||||
<MudText Typo="Typo.h3">Create</MudText>
|
<EditForm id="create-event-form" Model="EventDefinition" OnValidSubmit="OnValidSubmit" Enhance>
|
||||||
<MudText Typo="Typo.h4">Event</MudText>
|
|
||||||
<MudDivider />
|
|
||||||
|
|
||||||
|
|
||||||
<EditForm Model="EventDefinition" OnValidSubmit="OnValidSubmit" Enhance>
|
|
||||||
<AntiforgeryToken />
|
<AntiforgeryToken />
|
||||||
<DataAnnotationsValidator />
|
<DataAnnotationsValidator />
|
||||||
<MudGrid>
|
<MudGrid>
|
||||||
@@ -44,8 +49,6 @@
|
|||||||
</MudPaper>
|
</MudPaper>
|
||||||
</MudItem>
|
</MudItem>
|
||||||
</MudGrid>
|
</MudGrid>
|
||||||
<MudButton StartIcon="@Icons.Material.Filled.ArrowBack" Href="events">Back</MudButton>
|
|
||||||
<MudButton ButtonType="ButtonType.Submit" StartIcon="@Icons.Material.Filled.Save">Save</MudButton>
|
|
||||||
</EditForm>
|
</EditForm>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,28 @@
|
|||||||
@page "/events/details"
|
@page "/events/details"
|
||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
|
@using WebApp.Components.Shared.Components
|
||||||
@inject AppDbContext context
|
@inject AppDbContext context
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
|
|
||||||
<PageTitle>Event Details - TSA Chapter Organizer</PageTitle>
|
|
||||||
|
|
||||||
<MudText Typo="Typo.h3">Details</MudText>
|
|
||||||
<MudText Typo="Typo.h4">Event Definition</MudText>
|
|
||||||
<MudDivider />
|
|
||||||
|
|
||||||
@if (eventdefinition is null)
|
@if (eventdefinition is null)
|
||||||
{
|
{
|
||||||
<MudText><em>Loading...</em></MudText>
|
<MudText><em>Loading...</em></MudText>
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
<PageHeader
|
||||||
<MudPaper Class="pa-4 mt-4">
|
Title="Details"
|
||||||
|
Subtitle="Event Definition"
|
||||||
|
ShowBackButton="true"
|
||||||
|
BackButtonUrl="/events">
|
||||||
|
<ActionButtons>
|
||||||
|
<MudButton StartIcon="@Icons.Material.Filled.Edit" Href="@($"/events/edit?id={eventdefinition.Id}")" Variant="Variant.Outlined">Edit</MudButton>
|
||||||
|
<MudButton Href="/events" Variant="Variant.Text">Back to List</MudButton>
|
||||||
|
</ActionButtons>
|
||||||
|
</PageHeader>
|
||||||
|
|
||||||
|
<MudPaper Class="pa-4 mt-4">
|
||||||
<MudGrid>
|
<MudGrid>
|
||||||
<MudItem xs="12" sm="6" md="4">
|
<MudItem xs="12" sm="6" md="4">
|
||||||
<MudText Typo="Typo.subtitle2">Name</MudText>
|
<MudText Typo="Typo.subtitle2">Name</MudText>
|
||||||
@@ -79,13 +85,7 @@ else
|
|||||||
<MudText>@eventdefinition.Description</MudText>
|
<MudText>@eventdefinition.Description</MudText>
|
||||||
</MudItem>
|
</MudItem>
|
||||||
</MudGrid>
|
</MudGrid>
|
||||||
</MudPaper>
|
</MudPaper>
|
||||||
|
|
||||||
<div class="mt-4">
|
|
||||||
<MudButton StartIcon="@Icons.Material.Filled.Edit" Href="@($"/events/edit?id={eventdefinition.Id}")" Variant="Variant.Filled" Color="Color.Primary">Edit</MudButton>
|
|
||||||
<MudButton StartIcon="@Icons.Material.Filled.ArrowBack" Href="/events" Variant="Variant.Text">Back to List</MudButton>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private EventDefinition? eventdefinition;
|
private EventDefinition? eventdefinition;
|
||||||
|
|||||||
@@ -1,17 +1,28 @@
|
|||||||
@page "/events/edit"
|
@page "/events/edit"
|
||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
|
@using WebApp.Components.Shared.Components
|
||||||
@inject AppDbContext context
|
@inject AppDbContext context
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
|
|
||||||
<PageTitle>Edit Event - TSA Chapter Organizer</PageTitle>
|
@if (EventDefinition is null)
|
||||||
|
{
|
||||||
|
<p><em>Loading...</em></p>
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
<MudText Typo="Typo.h3">Edit</MudText>
|
<PageHeader
|
||||||
<MudText Typo="Typo.h4">Event</MudText>
|
Title="Edit"
|
||||||
<MudDivider />
|
Subtitle="Event"
|
||||||
|
ShowBackButton="true"
|
||||||
|
BackButtonUrl="/events">
|
||||||
|
<ActionButtons>
|
||||||
|
<MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" Color="Color.Primary" Form="edit-event-form">Save</MudButton>
|
||||||
|
<MudButton Href="/events" Variant="Variant.Text">Cancel</MudButton>
|
||||||
|
</ActionButtons>
|
||||||
|
</PageHeader>
|
||||||
|
|
||||||
|
<EditForm id="edit-event-form" Model="EventDefinition" OnValidSubmit="OnValidSubmit" Enhance>
|
||||||
<EditForm Model="EventDefinition" OnValidSubmit="OnValidSubmit" Enhance>
|
|
||||||
<AntiforgeryToken />
|
<AntiforgeryToken />
|
||||||
<DataAnnotationsValidator />
|
<DataAnnotationsValidator />
|
||||||
<MudGrid>
|
<MudGrid>
|
||||||
@@ -45,11 +56,8 @@
|
|||||||
</MudPaper>
|
</MudPaper>
|
||||||
</MudItem>
|
</MudItem>
|
||||||
</MudGrid>
|
</MudGrid>
|
||||||
<MudButton StartIcon="@Icons.Material.Filled.ArrowBack" Href="events">Back</MudButton>
|
|
||||||
<MudButton ButtonType="ButtonType.Submit" StartIcon="@Icons.Material.Filled.Save">Save</MudButton>
|
|
||||||
</EditForm>
|
</EditForm>
|
||||||
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
[SupplyParameterFromQuery]
|
[SupplyParameterFromQuery]
|
||||||
private int Id { get; set; }
|
private int Id { get; set; }
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
|
@using WebApp.Components.Shared.Components
|
||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
@page "/events/printout"
|
@page "/events/printout"
|
||||||
@inject IConfiguration Configuration
|
@inject IConfiguration Configuration
|
||||||
@inject AppDbContext Context
|
@inject AppDbContext Context
|
||||||
|
|
||||||
<PageTitle>TSA Events @Configuration["ChapterSettings:CompetitionYear"]</PageTitle>
|
<PageHeader
|
||||||
|
Title="@($"TSA Events {Configuration["ChapterSettings:CompetitionYear"]}")"
|
||||||
<MudText Typo="Typo.h3">TSA Events @Configuration["ChapterSettings:CompetitionYear"]</MudText>
|
Description="Yearly theme: Unity Through Community" />
|
||||||
<MudText Typo="Typo.h5" Class="mb-4">Yearly theme: Unity Through Community</MudText>
|
|
||||||
|
|
||||||
@if (_events == null)
|
@if (_events == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,14 +3,13 @@
|
|||||||
@using System.Text
|
@using System.Text
|
||||||
@using Core.Calculation
|
@using Core.Calculation
|
||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
|
@using WebApp.Components.Shared.Components
|
||||||
@inject IConfiguration Configuration
|
@inject IConfiguration Configuration
|
||||||
@inject AppDbContext Context
|
@inject AppDbContext Context
|
||||||
@inject ClipboardService ClipboardService
|
@inject ClipboardService ClipboardService
|
||||||
@inject LocalStorageService LocalStorage
|
@inject LocalStorageService LocalStorage
|
||||||
|
|
||||||
<PageTitle>@Configuration["ChapterSettings:Shortname"] TSA Schedule @Configuration["ChapterSettings:CompetitionYear"]</PageTitle>
|
<PageHeader Title="@($"{Configuration["ChapterSettings:Shortname"]} TSA Schedule {Configuration["ChapterSettings:CompetitionYear"]}")" />
|
||||||
|
|
||||||
<MudText Typo="Typo.h3">@Configuration["ChapterSettings:Shortname"] TSA Schedule @Configuration["ChapterSettings:CompetitionYear"]</MudText>
|
|
||||||
|
|
||||||
<MudPaper Class="pa-4 mt-5">
|
<MudPaper Class="pa-4 mt-5">
|
||||||
<MudGrid>
|
<MudGrid>
|
||||||
|
|||||||
@@ -1,16 +1,21 @@
|
|||||||
@page "/students/create"
|
@page "/students/create"
|
||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
|
@using WebApp.Components.Shared.Components
|
||||||
@inject AppDbContext Context
|
@inject AppDbContext Context
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
|
|
||||||
<PageTitle>Create Student - TSA Chapter Organizer</PageTitle>
|
<PageHeader
|
||||||
|
Title="Create"
|
||||||
|
Subtitle="Student"
|
||||||
|
ShowBackButton="true"
|
||||||
|
BackButtonUrl="/students">
|
||||||
|
<ActionButtons>
|
||||||
|
<MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" Color="Color.Primary" Form="create-student-form">Create</MudButton>
|
||||||
|
<MudButton Href="/students" Variant="Variant.Text">Cancel</MudButton>
|
||||||
|
</ActionButtons>
|
||||||
|
</PageHeader>
|
||||||
|
|
||||||
<MudText Typo="Typo.h3">Create</MudText>
|
<EditForm id="create-student-form" Model="Student" OnValidSubmit="OnValidSubmit" Enhance>
|
||||||
<MudText Typo="Typo.h4">Student</MudText>
|
|
||||||
<MudDivider />
|
|
||||||
|
|
||||||
|
|
||||||
<EditForm Model="Student" OnValidSubmit="OnValidSubmit" Enhance>
|
|
||||||
<AntiforgeryToken />
|
<AntiforgeryToken />
|
||||||
<DataAnnotationsValidator />
|
<DataAnnotationsValidator />
|
||||||
<MudGrid>
|
<MudGrid>
|
||||||
@@ -25,8 +30,6 @@
|
|||||||
</MudPaper>
|
</MudPaper>
|
||||||
</MudItem>
|
</MudItem>
|
||||||
</MudGrid>
|
</MudGrid>
|
||||||
<MudButton StartIcon="@Icons.Material.Filled.ArrowBack" Href="students">Back</MudButton>
|
|
||||||
<MudButton ButtonType="ButtonType.Submit" StartIcon="@Icons.Material.Filled.Save">Save</MudButton>
|
|
||||||
</EditForm>
|
</EditForm>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|||||||
@@ -1,24 +1,27 @@
|
|||||||
@page "/students/details"
|
@page "/students/details"
|
||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
@using Core.Entities
|
@using WebApp.Components.Shared.Components
|
||||||
@using Data
|
|
||||||
@inject AppDbContext context
|
@inject AppDbContext context
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
|
|
||||||
<PageTitle>Student Details - TSA Chapter Organizer</PageTitle>
|
|
||||||
|
|
||||||
<MudText Typo="Typo.h3">Details</MudText>
|
|
||||||
<MudText Typo="Typo.h4">Student</MudText>
|
|
||||||
<MudDivider />
|
|
||||||
|
|
||||||
@if (student is null)
|
@if (student is null)
|
||||||
{
|
{
|
||||||
<MudText><em>Loading...</em></MudText>
|
<MudText><em>Loading...</em></MudText>
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
<PageHeader
|
||||||
<MudPaper Class="pa-4 mt-4">
|
Title="Student Details"
|
||||||
|
ShowBackButton="true"
|
||||||
|
BackButtonUrl="@(ReturnUrl ?? "/students")">
|
||||||
|
<ActionButtons>
|
||||||
|
<MudButton StartIcon="@Icons.Material.Filled.Edit" Href="@($"/students/edit?id={student.Id}&returnUrl={ReturnUrl ?? "/students"}")" Variant="Variant.Outlined">Edit</MudButton>
|
||||||
|
<MudButton Href="@(ReturnUrl ?? "/students")" Variant="Variant.Text">Back to List</MudButton>
|
||||||
|
</ActionButtons>
|
||||||
|
</PageHeader>
|
||||||
|
|
||||||
|
<MudPaper Class="pa-4 mt-4">
|
||||||
<MudGrid>
|
<MudGrid>
|
||||||
<MudItem xs="12" sm="6" md="4">
|
<MudItem xs="12" sm="6" md="4">
|
||||||
<MudText Typo="Typo.subtitle2">First Name</MudText>
|
<MudText Typo="Typo.subtitle2">First Name</MudText>
|
||||||
@@ -61,13 +64,7 @@ else
|
|||||||
<MudText>@student.OfficerRole</MudText>
|
<MudText>@student.OfficerRole</MudText>
|
||||||
</MudItem>
|
</MudItem>
|
||||||
</MudGrid>
|
</MudGrid>
|
||||||
</MudPaper>
|
</MudPaper>
|
||||||
|
|
||||||
<div class="mt-4">
|
|
||||||
<MudButton StartIcon="@Icons.Material.Filled.Edit" Href="@($"/students/edit?id={student.Id}&returnUrl={ReturnUrl ?? "/students"}")" Variant="Variant.Filled" Color="Color.Primary">Edit</MudButton>
|
|
||||||
<MudButton StartIcon="@Icons.Material.Filled.ArrowBack" Href="@(ReturnUrl ?? "/students")" Variant="Variant.Text">Back to List</MudButton>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private Student? student;
|
private Student? student;
|
||||||
|
|||||||
@@ -1,25 +1,30 @@
|
|||||||
@page "/students/edit"
|
@page "/students/edit"
|
||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
|
@using WebApp.Components.Shared.Components
|
||||||
@inject AppDbContext Context
|
@inject AppDbContext Context
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
|
|
||||||
<PageTitle>Edit Student - TSA Chapter Organizer</PageTitle>
|
|
||||||
|
|
||||||
<MudText Typo="Typo.h3">Edit</MudText>
|
|
||||||
<MudText Typo="Typo.h4">Student@(@Student == null ? "" : $" ({Student.Name})")</MudText>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@if (Student is null)
|
@if (Student is null)
|
||||||
{
|
{
|
||||||
<p><em>Loading...</em></p>
|
<p><em>Loading...</em></p>
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
<PageHeader
|
||||||
/* https://www.mudblazor.com/components/form */
|
Title="Edit Student"
|
||||||
/* https://medium.com/@husainalbar/applying-mudblazor-for-crud-operations-in-our-blazor-project-a343037a52ef */
|
Subtitle="@($"{Student.FirstNameLastName}")"
|
||||||
<EditForm method="post" Model="Student" OnValidSubmit="UpdateStudent" FormName="edit" Enhance>
|
ShowBackButton="true"
|
||||||
|
BackButtonUrl="@(ReturnUrl ?? "/students")">
|
||||||
|
<ActionButtons>
|
||||||
|
<MudButton OnClick="UpdateStudent" Variant="Variant.Filled" Color="Color.Primary">Save</MudButton>
|
||||||
|
<MudButton Href="@(ReturnUrl ?? "/students")" Variant="Variant.Text">Cancel</MudButton>
|
||||||
|
</ActionButtons>
|
||||||
|
</PageHeader>
|
||||||
|
|
||||||
|
@* https://www.mudblazor.com/components/form *@
|
||||||
|
@* https://medium.com/@husainalbar/applying-mudblazor-for-crud-operations-in-our-blazor-project-a343037a52ef *@
|
||||||
|
<EditForm method="post" Model="Student" OnValidSubmit="UpdateStudent" FormName="edit" Enhance>
|
||||||
<AntiforgeryToken />
|
<AntiforgeryToken />
|
||||||
<DataAnnotationsValidator/>
|
<DataAnnotationsValidator/>
|
||||||
<MudGrid>
|
<MudGrid>
|
||||||
@@ -45,10 +50,7 @@ else
|
|||||||
</MudPaper>
|
</MudPaper>
|
||||||
</MudItem>
|
</MudItem>
|
||||||
</MudGrid>
|
</MudGrid>
|
||||||
<MudButton StartIcon="@Icons.Material.Filled.ArrowBack" Href="@(ReturnUrl ?? "/students")">Back</MudButton>
|
</EditForm>
|
||||||
<MudButton StartIcon="@Icons.Material.Filled.Save" OnClick="UpdateStudent">Save</MudButton>
|
|
||||||
</EditForm>
|
|
||||||
}
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
[SupplyParameterFromQuery]
|
[SupplyParameterFromQuery]
|
||||||
@@ -74,7 +76,7 @@ else
|
|||||||
// For more information, see https://learn.microsoft.com/aspnet/core/blazor/forms/#mitigate-overposting-attacks.
|
// For more information, see https://learn.microsoft.com/aspnet/core/blazor/forms/#mitigate-overposting-attacks.
|
||||||
private async Task UpdateStudent()
|
private async Task UpdateStudent()
|
||||||
{
|
{
|
||||||
if (Student.OfficerRole == 0)
|
if (Student?.OfficerRole == 0)
|
||||||
Student.OfficerRole = null;
|
Student.OfficerRole = null;
|
||||||
|
|
||||||
Context.Attach(Student!).State = EntityState.Modified;
|
Context.Attach(Student!).State = EntityState.Modified;
|
||||||
|
|||||||
@@ -2,14 +2,15 @@
|
|||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
@using WebApp.Models
|
@using WebApp.Models
|
||||||
|
@using WebApp.Components.Shared.Components
|
||||||
@using Core.Validation
|
@using Core.Validation
|
||||||
@inject AppDbContext Context
|
@inject AppDbContext Context
|
||||||
@inject ValidationService ValidationService
|
@inject ValidationService ValidationService
|
||||||
@rendermode InteractiveServer
|
@rendermode InteractiveServer
|
||||||
|
|
||||||
<PageTitle>Student Event Ranks - TSA Chapter Organizer</PageTitle>
|
<PageHeader
|
||||||
|
Title="Student Event Ranks"
|
||||||
<MudText Typo="Typo.h3"><MudIcon Icon="@AppIcons.EventRank"></MudIcon> Student Event Ranks</MudText>
|
Icon="@AppIcons.EventRank" />
|
||||||
|
|
||||||
@if (_students == null)
|
@if (_students == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,23 +2,22 @@
|
|||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
@using WebApp.Models
|
@using WebApp.Models
|
||||||
|
@using WebApp.Components.Shared.Components
|
||||||
@using Core.Validation
|
@using Core.Validation
|
||||||
@inject AppDbContext Context
|
@inject AppDbContext Context
|
||||||
@inject WebApp.LocalStorageService LocalStorage
|
@inject WebApp.LocalStorageService LocalStorage
|
||||||
@inject ValidationService ValidationService
|
@inject ValidationService ValidationService
|
||||||
|
|
||||||
<PageTitle>Registration - TSA Chapter Organizer</PageTitle>
|
<PageHeader Title="Registration">
|
||||||
|
<ActionButtons>
|
||||||
<MudText Typo="Typo.h3">Registration</MudText>
|
<MudButton StartIcon="@Icons.Material.Filled.FilterAlt"
|
||||||
|
Variant="@(_showRegionalOnly ? Variant.Filled : Variant.Outlined)"
|
||||||
<MudButtonGroup>
|
Color="Color.Primary"
|
||||||
<MudButton StartIcon="@Icons.Material.Filled.FilterAlt"
|
OnClick="ToggleRegionalFilter">
|
||||||
Variant="@(_showRegionalOnly ? Variant.Filled : Variant.Outlined)"
|
@(_showRegionalOnly ? "Showing Regional Only" : "Show Regional Only")
|
||||||
Color="Color.Primary"
|
</MudButton>
|
||||||
OnClick="ToggleRegionalFilter">
|
</ActionButtons>
|
||||||
@(_showRegionalOnly ? "Showing Regional Only" : "Show Regional Only")
|
</PageHeader>
|
||||||
</MudButton>
|
|
||||||
</MudButtonGroup>
|
|
||||||
|
|
||||||
<MudText Typo="Typo.body2" Style="margin-top: 8px; margin-bottom: 4px;">
|
<MudText Typo="Typo.body2" Style="margin-top: 8px; margin-bottom: 4px;">
|
||||||
<MudIcon Icon="@AppIcons.Captain" Size="Size.Small" /> = Team Captain
|
<MudIcon Icon="@AppIcons.Captain" Size="Size.Small" /> = Team Captain
|
||||||
|
|||||||
@@ -4,20 +4,22 @@
|
|||||||
@using Core.Validation
|
@using Core.Validation
|
||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
@using WebApp.Models
|
@using WebApp.Models
|
||||||
|
@using WebApp.Components.Shared.Components
|
||||||
@using EventAssignment = Core.Calculation.EventAssignment
|
@using EventAssignment = Core.Calculation.EventAssignment
|
||||||
@inject AppDbContext Context
|
@inject AppDbContext Context
|
||||||
@inject IDialogService DialogService
|
@inject IDialogService DialogService
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
@inject ValidationService ValidationService
|
@inject ValidationService ValidationService
|
||||||
|
|
||||||
<PageTitle>Event Assignment - TSA Chapter Organizer</PageTitle>
|
<PageHeader
|
||||||
|
Title="Assignment"
|
||||||
<MudText Typo="Typo.h3">Assignment</MudText>
|
Description="Optimized team assignments based on the student event rankings">
|
||||||
|
<ActionButtons>
|
||||||
<MudGrid>
|
<MudButton StartIcon="@Icons.Material.Filled.Edit" Href="students/event-ranking" Variant="Variant.Outlined">
|
||||||
<MudItem><MudText>Optimized team assignments based on the student event rankings</MudText></MudItem>
|
Edit Student Event Rankings
|
||||||
<MudItem><MudButton StartIcon="@Icons.Material.Filled.Edit" Href="students/event-ranking">Edit Student Event Rankings</MudButton></MudItem>
|
</MudButton>
|
||||||
</MudGrid>
|
</ActionButtons>
|
||||||
|
</PageHeader>
|
||||||
|
|
||||||
<MudPaper Class="pa-4 mt-5">
|
<MudPaper Class="pa-4 mt-5">
|
||||||
<MudGrid>
|
<MudGrid>
|
||||||
|
|||||||
@@ -1,14 +1,26 @@
|
|||||||
@page "/teams/create"
|
@page "/teams/create"
|
||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
|
@using WebApp.Components.Shared.Components
|
||||||
@inject AppDbContext Context
|
@inject AppDbContext Context
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
|
|
||||||
<PageTitle>Create Team - TSA Chapter Organizer</PageTitle>
|
@if (_events is null)
|
||||||
|
{
|
||||||
|
<p><em>Loading...</em></p>
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
<MudText Typo="Typo.h3">Create</MudText>
|
<PageHeader
|
||||||
<MudText Typo="Typo.h4">Team</MudText>
|
Title="Create"
|
||||||
<MudDivider />
|
Subtitle="Team"
|
||||||
|
ShowBackButton="true"
|
||||||
|
BackButtonUrl="/teams">
|
||||||
|
<ActionButtons>
|
||||||
|
<MudButton OnClick="AddTeam" Variant="Variant.Filled" Color="Color.Primary">Add</MudButton>
|
||||||
|
<MudButton Href="/teams" Variant="Variant.Text">Cancel</MudButton>
|
||||||
|
</ActionButtons>
|
||||||
|
</PageHeader>
|
||||||
|
|
||||||
<EditForm method="post" Model="Team" OnValidSubmit="AddTeam" FormName="create" Enhance>
|
<EditForm method="post" Model="Team" OnValidSubmit="AddTeam" FormName="create" Enhance>
|
||||||
<AntiforgeryToken />
|
<AntiforgeryToken />
|
||||||
@@ -23,17 +35,18 @@
|
|||||||
<MudSelectItem T="EventDefinition" Value="@(evt)"></MudSelectItem>
|
<MudSelectItem T="EventDefinition" Value="@(evt)"></MudSelectItem>
|
||||||
}
|
}
|
||||||
</MudSelect>
|
</MudSelect>
|
||||||
@if (_existingTeams?.Count == 1)
|
@switch (_existingTeams?.Count)
|
||||||
{
|
{
|
||||||
<MudAlert Severity="Severity.Info" Class="my-2">
|
case 1:
|
||||||
A team for @Team.Event.Name already exists. This will be team 2, and the existing team will become team 1.
|
<MudAlert Severity="Severity.Info" Class="my-2">
|
||||||
</MudAlert>
|
A team for @Team.Event.Name already exists. This will be team 2, and the existing team will become team 1.
|
||||||
}
|
</MudAlert>
|
||||||
else if (_existingTeams?.Count >= 2)
|
break;
|
||||||
{
|
case >= 2:
|
||||||
<MudAlert Severity="Severity.Error" Class="my-2">
|
<MudAlert Severity="Severity.Error" Class="my-2">
|
||||||
Two teams for @Team.Event.Name already exist. Cannot create a third team.
|
Two teams for @Team.Event.Name already exist. Cannot create a third team.
|
||||||
</MudAlert>
|
</MudAlert>
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
<MudDivider Class="my-4" />
|
<MudDivider Class="my-4" />
|
||||||
@@ -55,8 +68,6 @@
|
|||||||
{
|
{
|
||||||
<MudAlert Severity="Severity.Error" Class="mt-3">@_errorMessage</MudAlert>
|
<MudAlert Severity="Severity.Error" Class="mt-3">@_errorMessage</MudAlert>
|
||||||
}
|
}
|
||||||
<MudButton StartIcon="@Icons.Material.Filled.ArrowBack" Href="students">Back</MudButton>
|
|
||||||
<MudButton StartIcon="@Icons.Material.Filled.Add" OnClick="AddTeam">Add</MudButton>
|
|
||||||
</EditForm>
|
</EditForm>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|||||||
@@ -1,21 +1,27 @@
|
|||||||
@page "/teams/edit"
|
@page "/teams/edit"
|
||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
|
@using WebApp.Components.Shared.Components
|
||||||
@inject AppDbContext Context
|
@inject AppDbContext Context
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
|
|
||||||
<PageTitle>Edit Team - TSA Chapter Organizer</PageTitle>
|
|
||||||
|
|
||||||
<MudText Typo="Typo.h3">Edit</MudText>
|
|
||||||
<MudText Typo="Typo.h4">Team @(Team.ToString())</MudText>
|
|
||||||
|
|
||||||
@if (Team is null)
|
@if (Team is null)
|
||||||
{
|
{
|
||||||
<p><em>Loading...</em></p>
|
<p><em>Loading...</em></p>
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
<PageHeader Title="Edit Team"
|
||||||
<EditForm method="post" Model="Team" OnValidSubmit="UpdateTeam" FormName="edit" Enhance>
|
Subtitle=@Team.ToString()
|
||||||
|
ShowBackButton="true"
|
||||||
|
BackButtonUrl="/teams">
|
||||||
|
<ActionButtons>
|
||||||
|
<MudButton OnClick="UpdateTeam" Variant="Variant.Filled" Color="Color.Primary">Save</MudButton>
|
||||||
|
<MudButton Href="/teams" Variant="Variant.Text">Cancel</MudButton>
|
||||||
|
</ActionButtons>
|
||||||
|
</PageHeader>
|
||||||
|
|
||||||
|
<EditForm method="post" Model="Team" OnValidSubmit="UpdateTeam" FormName="edit" Enhance>
|
||||||
<AntiforgeryToken />
|
<AntiforgeryToken />
|
||||||
<DataAnnotationsValidator/>
|
<DataAnnotationsValidator/>
|
||||||
<MudGrid>
|
<MudGrid>
|
||||||
@@ -33,10 +39,7 @@ else
|
|||||||
</MudPaper>
|
</MudPaper>
|
||||||
</MudItem>
|
</MudItem>
|
||||||
</MudGrid>
|
</MudGrid>
|
||||||
<MudButton StartIcon="@Icons.Material.Filled.ArrowBack" Href="teams">Back</MudButton>
|
</EditForm>
|
||||||
<MudButton StartIcon="@Icons.Material.Filled.Save" OnClick="UpdateTeam">Save</MudButton>
|
|
||||||
</EditForm>
|
|
||||||
}
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
[SupplyParameterFromQuery]
|
[SupplyParameterFromQuery]
|
||||||
@@ -45,7 +48,7 @@ else
|
|||||||
[SupplyParameterFromForm]
|
[SupplyParameterFromForm]
|
||||||
private Team? Team { get; set; }
|
private Team? Team { get; set; }
|
||||||
|
|
||||||
private IEnumerable<Student> _selectedStudents = [];
|
private IEnumerable<Student>? _selectedStudents = [];
|
||||||
private List<Student> _students = [];
|
private List<Student> _students = [];
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
@@ -55,7 +58,7 @@ else
|
|||||||
.Include(e => e.Students)
|
.Include(e => e.Students)
|
||||||
.FirstOrDefaultAsync(m => m.Id == Id);
|
.FirstOrDefaultAsync(m => m.Id == Id);
|
||||||
_students = await Context.Students.ToListAsync();
|
_students = await Context.Students.ToListAsync();
|
||||||
_selectedStudents = Team.Students.ToList();
|
_selectedStudents = Team?.Students.ToList();
|
||||||
|
|
||||||
if (Team is null)
|
if (Team is null)
|
||||||
{
|
{
|
||||||
@@ -68,6 +71,10 @@ else
|
|||||||
Team.Captain ??= Team.Students[0];
|
Team.Captain ??= Team.Students[0];
|
||||||
Team.Identifier ??= Team.Captain.FirstName;
|
Team.Identifier ??= Team.Captain.FirstName;
|
||||||
break;
|
break;
|
||||||
|
case EventFormat.Team:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new ArgumentOutOfRangeException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,14 +83,15 @@ else
|
|||||||
private async Task UpdateTeam()
|
private async Task UpdateTeam()
|
||||||
{
|
{
|
||||||
//Context.Attach(Team!).Entity = EntityState.Modified;
|
//Context.Attach(Team!).Entity = EntityState.Modified;
|
||||||
Team.Students.Clear();
|
Team?.Students.Clear();
|
||||||
foreach (var s in _selectedStudents)
|
if (_selectedStudents != null)
|
||||||
{
|
foreach (var s in _selectedStudents)
|
||||||
Team.Students.Add(s);
|
{
|
||||||
}
|
Team?.Students.Add(s);
|
||||||
|
}
|
||||||
|
|
||||||
// Update identifier for individual events
|
// Update identifier for individual events
|
||||||
if (Team.Event.EventFormat == EventFormat.Individual && Team.Students.Count == 1)
|
if (Team is { Event.EventFormat: EventFormat.Individual, Students.Count: 1 })
|
||||||
{
|
{
|
||||||
Team.Captain ??= Team.Students[0];
|
Team.Captain ??= Team.Students[0];
|
||||||
Team.Identifier = Team.Captain.FirstName;
|
Team.Identifier = Team.Captain.FirstName;
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
@using WebApp.Models
|
@using WebApp.Models
|
||||||
|
@using WebApp.Components.Shared.Components
|
||||||
@inject IConfiguration Configuration
|
@inject IConfiguration Configuration
|
||||||
@inject AppDbContext Context
|
@inject AppDbContext Context
|
||||||
|
|
||||||
<PageTitle>@Configuration["ChapterSettings:Shortname"] TSA Student Goals @Configuration["ChapterSettings:CompetitionYear"]</PageTitle>
|
<PageHeader
|
||||||
|
Title="@($"{Configuration["ChapterSettings:Shortname"]} TSA Student Goals {Configuration["ChapterSettings:CompetitionYear"]}")"
|
||||||
<MudText Typo="Typo.h3">@Configuration["ChapterSettings:Shortname"] TSA Student Goals @Configuration["ChapterSettings:CompetitionYear"]</MudText>
|
Description="Set Your Goals for Success" />
|
||||||
<MudText Typo="Typo.h5" Class="mb-4">Set Your Goals for Success</MudText>
|
|
||||||
|
|
||||||
@if (_students == null)
|
@if (_students == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
@using WebApp.Models
|
@using WebApp.Models
|
||||||
|
@using WebApp.Components.Shared.Components
|
||||||
@inject IConfiguration Configuration
|
@inject IConfiguration Configuration
|
||||||
@inject AppDbContext Context
|
@inject AppDbContext Context
|
||||||
|
|
||||||
<PageTitle>@Configuration["ChapterSettings:Shortname"] TSA Teams @Configuration["ChapterSettings:CompetitionYear"]</PageTitle>
|
<PageHeader
|
||||||
|
Title="@($"{Configuration["ChapterSettings:Shortname"]} TSA Teams {Configuration["ChapterSettings:CompetitionYear"]}")"
|
||||||
|
Description="Yearly theme: Unity Through Community" />
|
||||||
|
|
||||||
<MudText Typo="Typo.h3">@Configuration["ChapterSettings:Shortname"] TSA Teams @Configuration["ChapterSettings:CompetitionYear"]</MudText>
|
@if (_teams == null || _students == null)
|
||||||
<MudText Typo="Typo.h5" Class="mb-4">Yearly theme: Unity Through Community</MudText>
|
|
||||||
|
|
||||||
@if (_teams == null)
|
|
||||||
{
|
{
|
||||||
<p><em>Loading...</em></p>
|
<p><em>Loading...</em></p>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
@using WebApp.Models
|
@using WebApp.Models
|
||||||
|
@using WebApp.Components.Shared.Components
|
||||||
@inject IConfiguration Configuration
|
@inject IConfiguration Configuration
|
||||||
@inject AppDbContext Context
|
@inject AppDbContext Context
|
||||||
|
|
||||||
<PageTitle>@Configuration["ChapterSettings:Shortname"] TSA Teams @Configuration["ChapterSettings:CompetitionYear"]</PageTitle>
|
<PageHeader
|
||||||
|
Title="@($"{Configuration["ChapterSettings:Shortname"]} TSA Teams {Configuration["ChapterSettings:CompetitionYear"]}")"
|
||||||
<MudText Typo="Typo.h3">@Configuration["ChapterSettings:Shortname"] TSA Teams @Configuration["ChapterSettings:CompetitionYear"]</MudText>
|
Description="Yearly theme: Unity Through Community" />
|
||||||
<MudText Typo="Typo.h5" Class="mb-4">Yearly theme: Unity Through Community</MudText>
|
|
||||||
|
|
||||||
<Legend></Legend>
|
<Legend></Legend>
|
||||||
@if (_teams == null)
|
@if (_teams == null)
|
||||||
|
|||||||
@@ -2,17 +2,18 @@
|
|||||||
@attribute [Authorize(Roles = AuthRoles.Administrator)]
|
@attribute [Authorize(Roles = AuthRoles.Administrator)]
|
||||||
@using WebApp.Authentication
|
@using WebApp.Authentication
|
||||||
@using WebApp.Models
|
@using WebApp.Models
|
||||||
|
@using WebApp.Components.Shared.Components
|
||||||
@using System.Text.Json
|
@using System.Text.Json
|
||||||
@inject IWebHostEnvironment Environment
|
@inject IWebHostEnvironment Environment
|
||||||
@inject IConfiguration Configuration
|
@inject IConfiguration Configuration
|
||||||
|
|
||||||
@rendermode InteractiveServer
|
@rendermode InteractiveServer
|
||||||
|
|
||||||
<PageTitle>Chapter Settings</PageTitle>
|
<PageHeader
|
||||||
|
Title="Chapter Settings"
|
||||||
|
Description="Configure chapter information. Changes take effect on next application restart." />
|
||||||
|
|
||||||
<MudContainer MaxWidth="MaxWidth.Large" Class="mt-4">
|
<MudContainer MaxWidth="MaxWidth.Large" Class="mt-4">
|
||||||
<MudText Typo="Typo.h3" Class="mb-4">Chapter Settings</MudText>
|
|
||||||
<MudText Typo="Typo.body1" Class="mb-6">Configure chapter information. Changes take effect on next application restart.</MudText>
|
|
||||||
|
|
||||||
@if (_settings != null)
|
@if (_settings != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,17 +2,18 @@
|
|||||||
@attribute [Authorize(Roles = AuthRoles.Administrator)]
|
@attribute [Authorize(Roles = AuthRoles.Administrator)]
|
||||||
@using Core.Validation
|
@using Core.Validation
|
||||||
@using WebApp.Authentication
|
@using WebApp.Authentication
|
||||||
|
@using WebApp.Components.Shared.Components
|
||||||
@using System.Text.Json
|
@using System.Text.Json
|
||||||
@inject IWebHostEnvironment Environment
|
@inject IWebHostEnvironment Environment
|
||||||
@inject IConfiguration Configuration
|
@inject IConfiguration Configuration
|
||||||
|
|
||||||
@rendermode InteractiveServer
|
@rendermode InteractiveServer
|
||||||
|
|
||||||
<PageTitle>Validation Settings</PageTitle>
|
<PageHeader
|
||||||
|
Title="Validation Settings"
|
||||||
|
Description="Configure validation rules and thresholds. Changes take effect on next application restart." />
|
||||||
|
|
||||||
<MudContainer MaxWidth="MaxWidth.Large" Class="mt-4">
|
<MudContainer MaxWidth="MaxWidth.Large" Class="mt-4">
|
||||||
<MudText Typo="Typo.h3" Class="mb-4">Validation Settings</MudText>
|
|
||||||
<MudText Typo="Typo.body1" Class="mb-6">Configure validation rules and thresholds. Changes take effect on next application restart.</MudText>
|
|
||||||
|
|
||||||
@if (_config != null)
|
@if (_config != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
@* Description *@
|
@* Description *@
|
||||||
@if (!string.IsNullOrEmpty(Description))
|
@if (!string.IsNullOrEmpty(Description))
|
||||||
{
|
{
|
||||||
<MudText Typo="Typo.body2" Color="Color.Secondary">@Description</MudText>
|
<MudText Typo="Typo.body2">@Description</MudText>
|
||||||
}
|
}
|
||||||
|
|
||||||
@* Custom Header Content *@
|
@* Custom Header Content *@
|
||||||
|
|||||||
Reference in New Issue
Block a user