Improvements for home page and formatting
This commit is contained in:
@@ -1,49 +1,34 @@
|
||||
@using WebApp.Models
|
||||
@*
|
||||
<MudTooltip Text="Level of Effort">@AppIcons.LevelOfEffortIcon(EventDefinition.LevelOfEffort)</MudTooltip>
|
||||
|
||||
@if(EventDefinition.EventFormat == EventFormat.Individual) {
|
||||
<MudTooltip Text="Individual">@AppIcons.IndividualEvent</MudTooltip>
|
||||
}
|
||||
@if (EventDefinition.OnSiteActivity)
|
||||
{
|
||||
<MudTooltip Text="On-site Activity"> @AppIcons.OnSiteActivity</MudTooltip>
|
||||
}
|
||||
|
||||
@if (EventDefinition.RegionalEvent)
|
||||
{
|
||||
<MudTooltip Text="Regional Event">@AppIcons.RegionalEvent</MudTooltip>
|
||||
}
|
||||
|
||||
@if (EventDefinition.Presubmission)
|
||||
{
|
||||
<MudTooltip Text="Presubmission Event">@AppIcons.PresubmissionEvent</MudTooltip>
|
||||
} *@
|
||||
|
||||
|
||||
@AppIcons.LevelOfEffortIcon(EventDefinition.LevelOfEffort)
|
||||
|
||||
@if (EventDefinition.EventFormat == EventFormat.Individual)
|
||||
{
|
||||
@AppIcons.IndividualEvent
|
||||
}
|
||||
@if (EventDefinition.OnSiteActivity)
|
||||
{
|
||||
@AppIcons.OnSiteActivity
|
||||
}
|
||||
|
||||
@if (EventDefinition.RegionalEvent)
|
||||
{
|
||||
@AppIcons.RegionalEvent
|
||||
}
|
||||
|
||||
@if (EventDefinition.Presubmission)
|
||||
{
|
||||
@AppIcons.PresubmissionEvent
|
||||
}
|
||||
<MudText Style="font-family: monospace; white-space: pre;">
|
||||
@foreach (var charStr in _attributes.Select(c => c.ToString()))
|
||||
{
|
||||
if (AppIcons.IconTooltips.TryGetValue(charStr, out var tooltip))
|
||||
{
|
||||
<MudTooltip Text="@tooltip">@charStr</MudTooltip>
|
||||
}
|
||||
else
|
||||
{
|
||||
@charStr
|
||||
}
|
||||
}
|
||||
</MudText>
|
||||
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public EventDefinition EventDefinition { get; set; }
|
||||
|
||||
private string _attributes;
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
_attributes = AppIcons.LevelOfEffortIcon(EventDefinition.LevelOfEffort);
|
||||
_attributes += " ";
|
||||
_attributes += EventDefinition.EventFormat == EventFormat.Individual ? AppIcons.IndividualEvent : " ";
|
||||
_attributes += EventDefinition.OnSiteActivity ? AppIcons.OnSiteActivity : " ";
|
||||
_attributes += EventDefinition.RegionalEvent ? AppIcons.RegionalEvent : " ";
|
||||
_attributes += EventDefinition.InterviewOrPresentation ? AppIcons.PresentationEvent : " ";
|
||||
_attributes += EventDefinition.Presubmission ? AppIcons.PresubmissionEvent : " ";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,10 +9,17 @@
|
||||
|
||||
<MudPaper Elevation="0" Class="mb-6">
|
||||
<div class="d-flex flex-column align-center text-center mb-4">
|
||||
<MudImage Fluid="true" Src="TCO_Title.png" Alt="TSA Chapter Organizer" Class="mb-4" Style="max-width: 600px;" />
|
||||
<MudText Typo="Typo.h3" Class="mb-2">
|
||||
<strong>@Configuration["ChapterSettings:Name"]</strong>
|
||||
</MudText>
|
||||
<MudImage Fluid="true" Src="TCO_Title.png" Alt="TSA Chapter Organizer" Class="mb-4" Style="width: 100%; max-width: 600px; height: auto;" />
|
||||
<MudHidden Breakpoint="Breakpoint.SmAndDown">
|
||||
<MudText Typo="Typo.h3" Class="mb-2">
|
||||
<strong>@Configuration["ChapterSettings:Name"]</strong>
|
||||
</MudText>
|
||||
</MudHidden>
|
||||
<MudHidden Breakpoint="Breakpoint.MdAndUp">
|
||||
<MudText Typo="Typo.h5" Class="mb-2">
|
||||
<strong>@Configuration["ChapterSettings:Name"]</strong>
|
||||
</MudText>
|
||||
</MudHidden>
|
||||
<MudText Typo="Typo.h6" Color="Color.Secondary">
|
||||
@Configuration["ChapterSettings:CompetitionYear"] Competition Year
|
||||
</MudText>
|
||||
@@ -25,7 +32,7 @@
|
||||
Title="Events"
|
||||
Count="@_eventCount"
|
||||
Subtitle="Total Events"
|
||||
Caption="@($"{_individualEventsCount} Individual | {_teamEventsCount} Team")"
|
||||
Caption="@($"{_teamEventsCount} Team | {_individualEventsCount} Individual")"
|
||||
NavigateUrl="/events" />
|
||||
|
||||
<!-- Students Card -->
|
||||
@@ -51,6 +58,7 @@
|
||||
Title="Teams"
|
||||
Count="@_teamCount"
|
||||
Subtitle="Total Teams"
|
||||
Caption="@($"{_groupTeamsCount} Team | {_individualTeamsCount} Individual")"
|
||||
NavigateUrl="/teams" />
|
||||
|
||||
<!-- Meeting Schedule Card -->
|
||||
@@ -67,6 +75,8 @@
|
||||
private int _studentCount;
|
||||
private string _gradeDistribution = "";
|
||||
private int _teamCount;
|
||||
private int _individualTeamsCount;
|
||||
private int _groupTeamsCount;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
@@ -102,6 +112,9 @@
|
||||
}
|
||||
|
||||
// Teams statistics
|
||||
_teamCount = await Context.Teams.CountAsync();
|
||||
var contextTeams = await Context.Teams.ToListAsync();
|
||||
_teamCount = contextTeams.Count;
|
||||
_individualTeamsCount = contextTeams.Count(e => e.Event.EventFormat == EventFormat.Individual);
|
||||
_groupTeamsCount = contextTeams.Count(e => e.Event.EventFormat == EventFormat.Team);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user