diff --git a/WebApp/Components/Features/Teams/Goals.razor b/WebApp/Components/Features/Teams/Goals.razor new file mode 100644 index 0000000..12a9193 --- /dev/null +++ b/WebApp/Components/Features/Teams/Goals.razor @@ -0,0 +1,72 @@ +@page "/teams/goals" +@attribute [Authorize] +@using Microsoft.EntityFrameworkCore +@using WebApp.Models +@inject IConfiguration Configuration +@inject AppDbContext Context + +@Configuration["ChapterSettings:Shortname"] TSA Student Goals @Configuration["ChapterSettings:CompetitionYear"] + +@Configuration["ChapterSettings:Shortname"] TSA Student Goals @Configuration["ChapterSettings:CompetitionYear"] +Set Your Goals for Success + +@if (_students == null) +{ +

Loading...

+} +else +{ + + @foreach (var student in _students) + { + + @student.Name + + For each of your events, write down your goals for this competition year. + + + @foreach (var team in student.Teams.OrderBy(t => t.Event.Name)) + { + + + + + @team.Event.Name + @if (team.Event.EventFormat == EventFormat.Team) + { + + (Team: @string.Join(", ", team.Students.OrderByDescending(e => e.Grade + e.TsaYear).Select(e => e.FirstName))) + + } + + + + + Goal: + +
+
+
+
+
+ } +
+ } +
+} + +@code { + private Student[]? _students; + + protected override async Task OnInitializedAsync() + { + _students = + await Context.Students + .Include(e => e.Teams) + .ThenInclude(e => e.Event) + .Include(e => e.Teams) + .ThenInclude(e => e.Students) + .OrderBy(e => e.FirstName) + .ToArrayAsync(); + } +}