Add Team functions
This commit is contained in:
@@ -1,87 +0,0 @@
|
||||
@using Core.Entities
|
||||
@using Data
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@page "/events/descriptions"
|
||||
@inject IConfiguration Configuration
|
||||
@inject AppDbContext Context
|
||||
@rendermode InteractiveServer
|
||||
|
||||
<PageTitle>TSA Events @Configuration["ChapterSettings:CompetitionYear"]</PageTitle>
|
||||
|
||||
<h1>TSA Events @Configuration["ChapterSettings:CompetitionYear"]</h1>
|
||||
|
||||
@if (_events == null)
|
||||
{
|
||||
<p><em>Loading...</em></p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div>
|
||||
@foreach (var evt in _events)
|
||||
{
|
||||
<div class="container nobrk">
|
||||
@if (evt.RegionalEvent)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<i>Regional Event</i>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div div class="row">
|
||||
<div class="col-4">
|
||||
<h5>@evt.Name</h5>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
@if (evt.EventFormat is EventFormat.Team)
|
||||
{
|
||||
<html><strong>@evt.EventFormat</strong><br/>Size: <strong>@evt.TeamSize</strong></html>
|
||||
}
|
||||
else
|
||||
{
|
||||
<html>
|
||||
<strong>@evt.EventFormat</strong>
|
||||
</html>
|
||||
}
|
||||
|
||||
</div>
|
||||
<div class="col">
|
||||
Eligibility: @evt.Eligibility
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<strong> Effort</strong>: @evt.LevelOfEffort
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<strong>Activity</strong>: @evt.SemifinalistActivity
|
||||
</div>
|
||||
</div>
|
||||
<div div class="row mt-3">
|
||||
<div class="col">@evt.Description</div></div>
|
||||
@if (!string.IsNullOrEmpty(evt.Theme))
|
||||
{
|
||||
<div div class="row mt-2">
|
||||
<div class="col-3 text-center"><i>Theme for 2025-26:</i></div>
|
||||
<div class="col" style="white-space:pre-wrap;">@evt.Theme</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrEmpty(evt.Documentation))
|
||||
{
|
||||
<div div class="row mt-2">
|
||||
<div class="col-3 text-center"><i>Materials:</i></div>
|
||||
<div class="col">@evt.Documentation</div>
|
||||
</div>
|
||||
}
|
||||
<hr/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@code {
|
||||
private EventDefinition[]? _events = null;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_events = await Context.Events.OrderBy(e => e.Name).Where(e => e.Name != "Chapter Team").ToArrayAsync();
|
||||
}
|
||||
}
|
||||
@@ -2,27 +2,25 @@
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@inject AppDbContext Context
|
||||
|
||||
|
||||
<PageTitle>Events - TSA Chapter Organizer</PageTitle>
|
||||
|
||||
<MudText Typo="Typo.h3">Events</MudText>
|
||||
|
||||
<MudButton StartIcon="@Icons.Material.Filled.Create" Href="events/create">Create New</MudButton>
|
||||
<MudButton StartIcon="@Icons.Material.Filled.Print" Href="events/printout">Printable Descriptions</MudButton>
|
||||
|
||||
|
||||
<MudDataGrid T="EventDefinition" ServerData="ServerReload" @ref="_dataGrid" Filterable="true" RowsPerPage="50">
|
||||
<MudDataGrid T="EventDefinition" ServerData="ServerReload" @ref="_dataGrid" Filterable="true" RowsPerPage="50" >
|
||||
<Columns>
|
||||
<PropertyColumn Property="@(e => e.Name)" Title="Event Name" Sortable="true" />
|
||||
<PropertyColumn Property="@(e => e.EventFormat)" Title="Event Format" />
|
||||
<PropertyColumn Property="@(e => e.LevelOfEffort)" Title="Level of Effort" />
|
||||
<PropertyColumn Property="@(e => e.SemifinalistActivity)" Title="On-site Activity" />
|
||||
<PropertyColumn Property="@(e => e.RegionalEvent)" Title="Regional Event" />
|
||||
<PropertyColumn Property="@(e => e.Eligibility)" Title="Eligibility" />
|
||||
<TemplateColumn Title="Team Size" CellStyle="white-space:nowrap">
|
||||
<CellTemplate>
|
||||
[@context.Item.MinTeamSize - @context.Item.MaxTeamSize]
|
||||
</CellTemplate>
|
||||
</TemplateColumn>
|
||||
<TemplateColumn Title="Teams State #">
|
||||
<TemplateColumn Title="TimeSlots State #">
|
||||
<CellTemplate>
|
||||
@context.Item.MaxTeamCountState
|
||||
</CellTemplate>
|
||||
@@ -50,27 +48,6 @@
|
||||
</PagerContent>
|
||||
</MudDataGrid>
|
||||
|
||||
@*
|
||||
<QuickGrid Class="table" Items="context.Events">
|
||||
<PropertyColumn Property="eventdefinition => eventdefinition.Name" />
|
||||
<PropertyColumn Property="eventdefinition => eventdefinition.EventFormat" />
|
||||
@* <PropertyColumn Property="eventdefinition => eventdefinition.MinTeamSize" />
|
||||
<PropertyColumn Property="eventdefinition => eventdefinition.MaxTeamSize" />
|
||||
<PropertyColumn Property="eventdefinition => eventdefinition.SemifinalistActivity" />
|
||||
<PropertyColumn Property="eventdefinition => eventdefinition.Notes" />
|
||||
<PropertyColumn Property="eventdefinition => eventdefinition.MaxTeamCountState" />
|
||||
<PropertyColumn Property="eventdefinition => eventdefinition.RegionalEvent" />
|
||||
<PropertyColumn Property="eventdefinition => eventdefinition.RegionalPresubmit" />
|
||||
<PropertyColumn Property="eventdefinition => eventdefinition.StatePresubmission" />
|
||||
<PropertyColumn Property="eventdefinition => eventdefinition.StatePretesting" />
|
||||
<PropertyColumn Property="eventdefinition => eventdefinition.StatePreliminaryRound" />
|
||||
<PropertyColumn Property="eventdefinition => eventdefinition.Documentation" />
|
||||
<PropertyColumn Property="eventdefinition => eventdefinition.Eligibility" />
|
||||
<PropertyColumn Property="eventdefinition => eventdefinition.Theme" />
|
||||
<PropertyColumn Property="eventdefinition => eventdefinition.Description" />
|
||||
<PropertyColumn Property="eventdefinition => eventdefinition.LevelOfEffort" />
|
||||
*@
|
||||
|
||||
@code {
|
||||
MudDataGrid<EventDefinition> _dataGrid = null!;
|
||||
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@page "/events/printout"
|
||||
@inject IConfiguration Configuration
|
||||
@inject AppDbContext Context
|
||||
|
||||
<PageTitle>TSA Events @Configuration["ChapterSettings:CompetitionYear"]</PageTitle>
|
||||
|
||||
<MudText Typo="Typo.h3">TSA Events @Configuration["ChapterSettings:CompetitionYear"]</MudText>
|
||||
<MudText Typo="Typo.h5" Class="mb-4">Yearly theme: Unity Through Community</MudText>
|
||||
|
||||
@if (_events == null)
|
||||
{
|
||||
<p><em>Loading...</em></p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudContainer>
|
||||
@foreach (var evt in _events)
|
||||
{
|
||||
<MudContainer Class="mt-3 mb-1 nobrk">
|
||||
<MudGrid>
|
||||
<MudItem xs="4">
|
||||
<MudStack>
|
||||
<MudItem>
|
||||
<MudText Class="d-flex py-1" Typo="Typo.h5">@evt.Name</MudText>
|
||||
</MudItem>
|
||||
@if (evt.RegionalEvent)
|
||||
{
|
||||
<MudItem>
|
||||
<MudText Class="d-flex" Typo="Typo.caption"><i>Regional Event</i></MudText>
|
||||
</MudItem>
|
||||
}
|
||||
</MudStack>
|
||||
</MudItem>
|
||||
<MudItem xs="2">
|
||||
|
||||
<MudText>
|
||||
@if (evt.EventFormat is EventFormat.Team)
|
||||
{
|
||||
<strong>@evt.EventFormat</strong>
|
||||
<br/>
|
||||
<p>Size: <strong>@evt.TeamSize</strong></p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<strong>@evt.EventFormat</strong>
|
||||
}
|
||||
</MudText>
|
||||
|
||||
</MudItem>
|
||||
<MudItem xs="3">
|
||||
Eligibility: @evt.Eligibility
|
||||
</MudItem>
|
||||
<MudItem xs="1">
|
||||
<strong> Effort</strong>: @evt.LevelOfEffort
|
||||
</MudItem>
|
||||
<MudItem xs="2">
|
||||
<strong>Activity</strong>: @evt.SemifinalistActivity
|
||||
</MudItem>
|
||||
|
||||
<MudItem xs="12">
|
||||
<MudText Class="d-flex py-1" Style="white-space:pre-wrap;">@evt.Description</MudText>
|
||||
</MudItem>
|
||||
@if (!string.IsNullOrEmpty(evt.Theme))
|
||||
{
|
||||
<MudItem xs="3">
|
||||
<MudText Class="d-flex py-1">
|
||||
<i>Theme for 2025-26:</i>
|
||||
</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="8">
|
||||
<MudText Class="d-flex py-1" Style="white-space:pre-wrap;">@evt.Theme</MudText>
|
||||
</MudItem>
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrEmpty(evt.Documentation))
|
||||
{
|
||||
<MudItem xs="3">
|
||||
<MudText Class="d-flex py-1">
|
||||
<i>Materials:</i>
|
||||
</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="8">
|
||||
<MudText Class="d-flex py-1" Style="white-space:pre-wrap;">@evt.Documentation</MudText>
|
||||
</MudItem>
|
||||
}
|
||||
|
||||
</MudGrid>
|
||||
</MudContainer>
|
||||
<MudDivider />
|
||||
}
|
||||
</MudContainer>
|
||||
|
||||
<MudContainer>
|
||||
@foreach (var evt in _events)
|
||||
{
|
||||
<MudContainer Class="mt-3 mb-1 nobrk">
|
||||
<MudGrid>
|
||||
<MudItem xs="4">
|
||||
<MudStack>
|
||||
<MudItem>
|
||||
<MudText Class="d-flex py-1" Typo="Typo.h5">@evt.Name</MudText>
|
||||
</MudItem>
|
||||
@if (evt.RegionalEvent)
|
||||
{
|
||||
<MudItem>
|
||||
<MudText Class="d-flex" Typo="Typo.caption"><i>Regional Event</i></MudText>
|
||||
</MudItem>
|
||||
}
|
||||
</MudStack>
|
||||
</MudItem>
|
||||
<MudItem xs="2">
|
||||
|
||||
<MudText>
|
||||
@if (evt.EventFormat is EventFormat.Team)
|
||||
{
|
||||
<strong>@evt.EventFormat</strong>
|
||||
<br />
|
||||
<p>Size: <strong>@evt.TeamSize</strong></p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<strong>@evt.EventFormat</strong>
|
||||
}
|
||||
</MudText>
|
||||
|
||||
</MudItem>
|
||||
<MudItem xs="3">
|
||||
Eligibility: @evt.Eligibility
|
||||
</MudItem>
|
||||
<MudItem xs="1">
|
||||
<strong> Effort</strong>: @evt.LevelOfEffort
|
||||
</MudItem>
|
||||
<MudItem xs="2">
|
||||
<strong>Activity</strong>: @evt.SemifinalistActivity
|
||||
</MudItem>
|
||||
|
||||
<MudItem xs="12">
|
||||
<MudText Class="d-flex py-1" Style="white-space:pre-wrap;">@evt.Description</MudText>
|
||||
</MudItem>
|
||||
@if (!string.IsNullOrEmpty(evt.Theme))
|
||||
{
|
||||
<MudItem xs="3">
|
||||
<MudText Class="d-flex py-1">
|
||||
<i>Theme for 2025-26:</i>
|
||||
</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="8">
|
||||
<MudText Class="d-flex py-1" Style="white-space:pre-wrap;">@evt.Theme</MudText>
|
||||
</MudItem>
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrEmpty(evt.Documentation))
|
||||
{
|
||||
<MudItem xs="3">
|
||||
<MudText Class="d-flex py-1">
|
||||
<i>Materials:</i>
|
||||
</MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="8">
|
||||
<MudText Class="d-flex py-1" Style="white-space:pre-wrap;">@evt.Documentation</MudText>
|
||||
</MudItem>
|
||||
}
|
||||
|
||||
</MudGrid>
|
||||
</MudContainer>
|
||||
<MudDivider />
|
||||
}
|
||||
</MudContainer>
|
||||
}
|
||||
@code {
|
||||
private EventDefinition[]? _events;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_events = await Context.Events.OrderBy(e => e.Name).ToArrayAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user