5fdda08627
This commit updates various components within the Events and MeetingSchedule features to utilize standardized chip variants defined in the AppIcons class. The changes include replacing hardcoded chip variants with calls to the new methods for event, team, and student chips, enhancing consistency across the UI. Additionally, the UnscheduledStudentsList component has been updated to include necessary using directives, improving code clarity. These modifications contribute to a more uniform and maintainable user interface.
40 lines
1.5 KiB
Plaintext
40 lines
1.5 KiB
Plaintext
@using WebApp.Models
|
|
<MudStack Row="true" Spacing="1" Wrap="Wrap.Wrap">
|
|
@foreach (var student in
|
|
Team.Students
|
|
.OrderBy(e =>
|
|
e.EventRankings
|
|
.Find(er => er.EventDefinition == Team.Event)?.Rank ?? 10)
|
|
.ThenBy(s => s.Grade + s.TsaYear))
|
|
{
|
|
var eventRank =
|
|
student.EventRankings
|
|
.Find(e => e.EventDefinition == Team.Event)?.Rank;
|
|
var color = AppIcons.RankedEventColor(eventRank ?? 0);
|
|
var captain = Team.Captain != null && Team.Captain.Equals(student);
|
|
var rankLabel = eventRank.HasValue ? $"Rank {eventRank}" : "Unranked";
|
|
|
|
<MudTooltip Text="@rankLabel">
|
|
<MudChip T="string"
|
|
Size="Size.Medium"
|
|
Variant="@AppIcons.StudentChipVariant()"
|
|
Class="mx-1 my-1">
|
|
@if (eventRank.HasValue)
|
|
{
|
|
<span style="@($"display: inline-block; width: 12px; height: 12px; border-radius: 50%; background-color: {color}; margin-right: 6px;")")"></span>
|
|
}
|
|
@student.FirstName
|
|
@if (captain && Team.Event.EventFormat != EventFormat.Individual)
|
|
{
|
|
<MudIcon Icon="@AppIcons.Captain" Size="Size.Small" Style="margin-left: 4px;" />
|
|
}
|
|
</MudChip>
|
|
</MudTooltip>
|
|
}
|
|
</MudStack>
|
|
|
|
@code {
|
|
[Parameter]
|
|
public required Team Team { get; set; }
|
|
}
|