Add Team functions
This commit is contained in:
+71
-22
@@ -5,34 +5,62 @@ namespace WebApp.Models
|
||||
{
|
||||
public static class AppIcons
|
||||
{
|
||||
private const string Prefix = "@Icons.Material.Filled.";
|
||||
|
||||
public static string LevelOfEffortIcon(int loe)
|
||||
public static string EventRank = Icons.Material.Filled.AddChart;
|
||||
public static string Teams = Icons.Material.Filled.Group;
|
||||
public static string Student = Icons.Material.Filled.Person;
|
||||
public static string TeamAssignment = Icons.Material.Filled.GroupAdd;
|
||||
public static string Events = Icons.Material.Filled.Dashboard;
|
||||
public static string LevelOfEffortIcon(int? loe)
|
||||
{
|
||||
|
||||
return loe switch
|
||||
{
|
||||
1 => MudBlazor.Icons.Material.Filled.StarBorder,
|
||||
2 => MudBlazor.Icons.Material.Filled.StarHalf,
|
||||
3 => MudBlazor.Icons.Material.Filled.Star,
|
||||
_ => MudBlazor.Icons.Material.Filled.QuestionMark
|
||||
1 => "①",
|
||||
2 => "②",
|
||||
3 => "③",
|
||||
_ => Icons.Material.Filled.QuestionMark
|
||||
};
|
||||
}
|
||||
|
||||
public static string OnSiteActivity = "ⓐ";
|
||||
public static string RegionalEvent = "ⓡ";
|
||||
public static string IndividualEvent = "ⓘ";
|
||||
public static string QuestionMark = "❔";
|
||||
|
||||
public static string EventEffort(EventDefinition eventDefinition)
|
||||
{
|
||||
return LevelOfEffortIcon(eventDefinition.LevelOfEffort);
|
||||
}
|
||||
|
||||
public static string EventAttributes(EventDefinition eventDefinition)
|
||||
{
|
||||
var v = new List<string>();
|
||||
|
||||
if (eventDefinition.EventFormat == EventFormat.Individual)
|
||||
v.Add(IndividualEvent);
|
||||
if (eventDefinition.OnSiteActivity)
|
||||
v.Add(OnSiteActivity);
|
||||
if (eventDefinition.RegionalEvent)
|
||||
v.Add(RegionalEvent);
|
||||
|
||||
return string.Join(" ", v);
|
||||
}
|
||||
|
||||
public static string OfficerRoleIcon(OfficerRole officerRole)
|
||||
{
|
||||
return officerRole switch
|
||||
{
|
||||
OfficerRole.President => MudBlazor.Icons.Material.Filled.Gavel,
|
||||
OfficerRole.VicePresident => MudBlazor.Icons.Material.Filled.StarBorderPurple500,
|
||||
OfficerRole.Secretary => MudBlazor.Icons.Material.Filled.Draw,
|
||||
OfficerRole.Treasurer => MudBlazor.Icons.Material.Filled.Key,
|
||||
OfficerRole.Reporter => MudBlazor.Icons.Material.Filled.Mic,
|
||||
OfficerRole.SergeantAtArms => MudBlazor.Icons.Material.Filled.Handshake,
|
||||
OfficerRole.President => Icons.Material.Filled.Gavel,
|
||||
OfficerRole.VicePresident => Icons.Material.Filled.StarBorderPurple500,
|
||||
OfficerRole.Secretary => Icons.Material.Filled.Draw,
|
||||
OfficerRole.Treasurer => Icons.Material.Filled.Key,
|
||||
OfficerRole.Reporter => Icons.Material.Filled.Mic,
|
||||
OfficerRole.SergeantAtArms => Icons.Material.Filled.Handshake,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(officerRole), officerRole, null)
|
||||
};
|
||||
}
|
||||
|
||||
public static string RankedEvent(int rank)
|
||||
public static string RankedEventColor(int rank)
|
||||
{
|
||||
return rank switch
|
||||
{
|
||||
@@ -42,16 +70,37 @@ namespace WebApp.Models
|
||||
4 => "#ffe599",
|
||||
5 => "#fff2cc",
|
||||
6 => "#fffaea",
|
||||
7 => "#fffefa",
|
||||
8 => "#fffefc",
|
||||
9 => "#fffffd",
|
||||
10 => "#fffffe",
|
||||
_ => "#ddd"
|
||||
};
|
||||
}
|
||||
/*
|
||||
* #dd7e6b;
|
||||
#ea9999;
|
||||
#f9cb9c;
|
||||
#ffe599;
|
||||
#fff2cc;
|
||||
#fffaea;
|
||||
*/
|
||||
|
||||
public static string GetOrdinal(int num)
|
||||
{
|
||||
if (num <= 0) return num.ToString();
|
||||
|
||||
switch (num % 100)
|
||||
{
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
return num + "th";
|
||||
}
|
||||
|
||||
switch (num % 10)
|
||||
{
|
||||
case 1:
|
||||
return num + "st";
|
||||
case 2:
|
||||
return num + "nd";
|
||||
case 3:
|
||||
return num + "rd";
|
||||
default:
|
||||
return num + "th";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user