Update icons for event attributes

This commit is contained in:
2025-12-25 20:03:50 -05:00
parent 1f5aba7f04
commit aedf168e8a
2 changed files with 34 additions and 13 deletions
@@ -1,21 +1,25 @@
@using WebApp.Models
<span style=""></span>
@if (EventDefinition.LevelOfEffort.HasValue)
@* @if (EventDefinition.LevelOfEffort.HasValue)
{
<span class="numberCircle">@EventDefinition.LevelOfEffort</span>
}
} *@
<MudText Style="font-family: monospace; white-space: pre;">
@{
var loeIcon = AppIcons.LevelOfEffortIcon(EventDefinition.LevelOfEffort);
var loeColor = AppIcons.IconColors.GetValueOrDefault(loeIcon, "inherit");
}
@RenderFixedWidthChar(loeIcon, "1.5em", loeColor)
@foreach (var charStr in _attributes.Select(c => c.ToString()))
{
var color = AppIcons.IconColors.GetValueOrDefault(charStr, "inherit");
if (AppIcons.IconTooltips.TryGetValue(charStr, out var tooltip))
{
<MudTooltip Text="@tooltip">@charStr</MudTooltip>
<MudTooltip Text="@tooltip">@RenderFixedWidthChar(charStr, color: color)</MudTooltip>
}
else
{
@charStr
@RenderFixedWidthChar(charStr, color: color)
}
}
</MudText>
@@ -35,4 +39,9 @@
_attributes += EventDefinition.InterviewOrPresentation ? AppIcons.PresentationEvent : " ";
_attributes += EventDefinition.Presubmission ? AppIcons.PresubmissionEvent : " ";
}
private RenderFragment RenderFixedWidthChar(string character, string width = "1.3em", string color = "inherit") => __builder =>
{
<span style="display: inline-block; width: @width; text-align: center; color: @color;">@character</span>
};
}