feat: merge event rankings and attribute badges into the page printer
Interview notes can print each student's ranked events and a shared attribute legend from the same catalog as the ranking index, without leftover table markup or collapsed answer space. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
using Core.Entities;
|
||||
|
||||
namespace Core.Printing;
|
||||
|
||||
public sealed record EventMark(
|
||||
string Symbol,
|
||||
string Label,
|
||||
string Color,
|
||||
Func<EventDefinition, bool> Applies);
|
||||
|
||||
/// <summary>
|
||||
/// Compact event-attribute marks used on the event-ranking index chip,
|
||||
/// print badges, and the shared legend.
|
||||
/// </summary>
|
||||
public static class EventAttributeMarks
|
||||
{
|
||||
public const string LevelOfEffort1 = "○";
|
||||
public const string LevelOfEffort2 = "◐";
|
||||
public const string LevelOfEffort3 = "⬤";
|
||||
public const string Individual = "ⓘ";
|
||||
public const string OnSite = "ⓐ";
|
||||
public const string Regional = "ⓡ";
|
||||
public const string Presubmission = "ⓟ";
|
||||
|
||||
public static readonly IReadOnlyList<EventMark> LegendItems =
|
||||
[
|
||||
new(LevelOfEffort1, "Level of Effort: 1", "#757575", e => e.LevelOfEffort == 1),
|
||||
new(LevelOfEffort2, "Level of Effort: 2", "#616161", e => e.LevelOfEffort == 2),
|
||||
new(LevelOfEffort3, "Level of Effort: 3", "#424242", e => e.LevelOfEffort == 3),
|
||||
new(Individual, "Individual Event", "#9c27b0", e => e.EventFormat == EventFormat.Individual),
|
||||
new(OnSite, "On-Site Activity", "#ff9800", e => e.OnSiteActivity),
|
||||
new(Regional, "Regional Event", "#2196f3", e => e.RegionalEvent),
|
||||
new(Presubmission, "Presubmission", "#4caf50", e => e.Presubmission)
|
||||
];
|
||||
|
||||
public static string For(EventDefinition? evt)
|
||||
{
|
||||
if (evt is null)
|
||||
return string.Empty;
|
||||
|
||||
return string.Join(
|
||||
" ",
|
||||
LegendItems.Where(m => m.Applies(evt)).Select(m => m.Symbol));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user