feat: edit print templates on the printer page and store them on presets
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,7 +4,7 @@ using Core.Printing;
|
||||
namespace Core.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Saved page-printer recipe: template note, entity type, and filters. Merged output is not stored.
|
||||
/// Saved page-printer recipe: template markdown, entity type, and filters. Merged output is not stored.
|
||||
/// </summary>
|
||||
public class PrintPreset
|
||||
{
|
||||
@@ -14,9 +14,7 @@ public class PrintPreset
|
||||
[StringLength(100)]
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
public int NoteId { get; set; }
|
||||
|
||||
public Note Note { get; set; } = null!;
|
||||
public string TemplateMarkdown { get; set; } = string.Empty;
|
||||
|
||||
public PrintEntityType EntityType { get; set; }
|
||||
|
||||
|
||||
@@ -43,6 +43,21 @@ public static class PrintFieldCatalog
|
||||
/// </summary>
|
||||
public static readonly string[] StudentRanks = [.. StudentRankTokens.AllNames];
|
||||
|
||||
public static readonly string[] StudentRanks1To6 = [.. RankTokens(1, 6)];
|
||||
|
||||
public static readonly string[] StudentRanks7To10 = [.. RankTokens(7, 10)];
|
||||
|
||||
public static IReadOnlyList<string> RankTokens(int fromRank, int toRank) =>
|
||||
[
|
||||
.. Enumerable.Range(fromRank, toRank - fromRank + 1)
|
||||
.SelectMany(rank => (string[])
|
||||
[
|
||||
StudentRankTokens.NameToken(rank),
|
||||
StudentRankTokens.ShortNameToken(rank),
|
||||
StudentRankTokens.AttributesToken(rank)
|
||||
])
|
||||
];
|
||||
|
||||
public static readonly string[] Team =
|
||||
[
|
||||
"Identifier",
|
||||
@@ -52,6 +67,7 @@ public static class PrintFieldCatalog
|
||||
"EventFormat",
|
||||
"TeamSize",
|
||||
"NationalEligibility",
|
||||
"Eligibility",
|
||||
"RegionalTeamCount",
|
||||
"StateTeamCount",
|
||||
"Description",
|
||||
@@ -66,6 +82,7 @@ public static class PrintFieldCatalog
|
||||
"EventFormat",
|
||||
"TeamSize",
|
||||
"NationalEligibility",
|
||||
"Eligibility",
|
||||
"RegionalTeamCount",
|
||||
"StateTeamCount",
|
||||
"LevelOfEffort",
|
||||
|
||||
Reference in New Issue
Block a user