diff --git a/WebApp/Components/Features/Events/Components/EventAttributes.razor b/WebApp/Components/Features/Events/Components/EventAttributes.razor index 0ba1f1c..c2ff455 100644 --- a/WebApp/Components/Features/Events/Components/EventAttributes.razor +++ b/WebApp/Components/Features/Events/Components/EventAttributes.razor @@ -4,7 +4,7 @@ { @EventDefinition.LevelOfEffort } *@ - + @{ var loeIcon = AppIcons.LevelOfEffortIcon(EventDefinition.LevelOfEffort); var loeColor = AppIcons.IconColors.GetValueOrDefault(loeIcon, "inherit"); diff --git a/WebApp/Components/Features/MeetingSchedule/ScheduledTeamsList.razor b/WebApp/Components/Features/MeetingSchedule/ScheduledTeamsList.razor index 49d3d22..38a25d5 100644 --- a/WebApp/Components/Features/MeetingSchedule/ScheduledTeamsList.razor +++ b/WebApp/Components/Features/MeetingSchedule/ScheduledTeamsList.razor @@ -29,7 +29,8 @@
+ Color="Color.Default" + Variant="@AppIcons.TeamChipVariant()"> @team
@@ -59,7 +60,7 @@ { @formattedName @@ -79,7 +80,7 @@ @formattedName diff --git a/WebApp/Components/Features/MeetingSchedule/UnscheduledStudentsList.razor b/WebApp/Components/Features/MeetingSchedule/UnscheduledStudentsList.razor index 04b6f19..fbd7e68 100644 --- a/WebApp/Components/Features/MeetingSchedule/UnscheduledStudentsList.razor +++ b/WebApp/Components/Features/MeetingSchedule/UnscheduledStudentsList.razor @@ -1,5 +1,6 @@ @using Core.Calculation @using Core.Utility +@using WebApp.Models @if (UnscheduledStudents.Any()) { @@ -18,7 +19,7 @@ } - + @formattedName @@ -40,7 +41,8 @@
+ Color="@chipColor" + Variant="@AppIcons.TeamChipVariant()"> @if (isScheduled) { diff --git a/WebApp/Components/Features/Students/Registration.razor b/WebApp/Components/Features/Students/Registration.razor index af22628..eeb466b 100644 --- a/WebApp/Components/Features/Students/Registration.razor +++ b/WebApp/Components/Features/Students/Registration.razor @@ -94,6 +94,7 @@ @team diff --git a/WebApp/Components/Features/Teams/Assignment.razor b/WebApp/Components/Features/Teams/Assignment.razor index add1779..ed64720 100644 --- a/WebApp/Components/Features/Teams/Assignment.razor +++ b/WebApp/Components/Features/Teams/Assignment.razor @@ -153,85 +153,87 @@ .Concat(context.Events) .Distinct(); } - @foreach (var e in - allStudentEvents - .OrderBy(e => - context.Student.EventRankings - .Find(ser => ser.EventDefinition == e)?.Rank ?? 10)) - { - var eventRank = context.Student.EventRankings.Find(er => er.EventDefinition == e)?.Rank; - var isAssigned = context.Events.Contains(e); - - var color = AppIcons.RankedEventColor(eventRank ?? 0); - var style = "border-style: solid;"; - - if (isAssigned) + + @foreach (var e in + allStudentEvents + .OrderBy(e => + context.Student.EventRankings + .Find(ser => ser.EventDefinition == e)?.Rank ?? 10)) { - style += "border-color:black; border-width:thin;"; - if (eventRank.HasValue) + var eventRank = context.Student.EventRankings.Find(er => er.EventDefinition == e)?.Rank; + var isAssigned = context.Events.Contains(e); + + var color = AppIcons.RankedEventColor(eventRank ?? 0); + var style = "border-style: solid;"; + + if (isAssigned) { - style += $"background:{color};"; - if (eventRank == 1) - style += $"color:black"; + style += "border-color:black; border-width:thin;"; + if (eventRank.HasValue) + { + style += $"background:{color};"; + if (eventRank == 1) + style += $"color:black"; + } + else + style += $"background:{Colors.Gray.Lighten3};"; } else - style += $"background:{Colors.Gray.Lighten3};"; + { + if (eventRank.HasValue) + style += $"border-color:{color}; border-width:medium; color:{Colors.Gray.Lighten1};"; + } + + var isIncluded = _assignmentRequirements + .Find(ar => + ar.EventDefinition == e + && ar.Student == context.Student + && ar.Requirement == Requirement.Include) == null; + var isExcluded = _assignmentRequirements + .Find(ar => + ar.EventDefinition == e + && ar.Student == context.Student + && ar.Requirement == Requirement.Exclude) == null; + + + + @e.ShortName  + @AppIcons.EventAttributes(e) + + + @if (isIncluded) + { + + + + } + else + { + + + + } + + @if (isExcluded) + { + + + + } + else + { + + + + } + + } - else - { - if (eventRank.HasValue) - style += $"border-color:{color}; border-width:medium; color:{Colors.Gray.Lighten1};"; - } - - var isIncluded = _assignmentRequirements - .Find(ar => - ar.EventDefinition == e - && ar.Student == context.Student - && ar.Requirement == Requirement.Include) == null; - var isExcluded = _assignmentRequirements - .Find(ar => - ar.EventDefinition == e - && ar.Student == context.Student - && ar.Requirement == Requirement.Exclude) == null; - - - - @e.ShortName  - @AppIcons.EventAttributes(e) - - - @if (isIncluded) - { - - - - } - else - { - - - - } - - @if (isExcluded) - { - - - - } - else - { - - - - } - - - } + diff --git a/WebApp/Components/Features/Teams/Components/TeamStudents.razor b/WebApp/Components/Features/Teams/Components/TeamStudents.razor index 51c9f0f..70936d7 100644 --- a/WebApp/Components/Features/Teams/Components/TeamStudents.razor +++ b/WebApp/Components/Features/Teams/Components/TeamStudents.razor @@ -17,7 +17,7 @@ @if (eventRank.HasValue) { diff --git a/WebApp/Models/AppIcons.cs b/WebApp/Models/AppIcons.cs index 1a1afe6..b889659 100644 --- a/WebApp/Models/AppIcons.cs +++ b/WebApp/Models/AppIcons.cs @@ -154,5 +154,20 @@ namespace WebApp.Models }; return $"{number}{suffix}"; } + + /// + /// Returns the standard chip variant for student chips (Outlined). + /// + public static Variant StudentChipVariant() => Variant.Outlined; + + /// + /// Returns the standard chip variant for event chips (Filled). + /// + public static Variant EventChipVariant() => Variant.Filled; + + /// + /// Returns the standard chip variant for team chips (Filled). + /// + public static Variant TeamChipVariant() => Variant.Filled; } }