Let editors define FAQ topics freely instead of a hard-coded map
This commit is contained in:
1 parent
01d25eb04b
commit
c7c55c0c6c
8 files changed
+26
-32
No files matched your search
@@ -17,7 +17,7 @@ else
|
||||
@foreach (var group in _groups)
|
||||
{
|
||||
<section class="faq-topic">
|
||||
<h2>@TopicLabel(group.Key)</h2>
|
||||
<h2>@group.Key</h2>
|
||||
@foreach (var faq in group)
|
||||
{
|
||||
<details class="faq-item">
|
||||
|
||||
@@ -14,17 +14,6 @@ public partial class FaqList
|
||||
ILogger logger,
|
||||
Exception exception);
|
||||
|
||||
// German heading per topic. Unknown topics fall back to the raw key so a new
|
||||
// topic in PocketBase still shows up rather than being silently dropped.
|
||||
private static readonly Dictionary<string, string> TopicLabels =
|
||||
new(StringComparer.Ordinal)
|
||||
{
|
||||
["mensa"] = "Mensa und Mittagessen",
|
||||
["schliessfach"] = "Schließfächer",
|
||||
["elterneuro"] = "Eltern-Euro",
|
||||
["elternarbeit"] = "Elternarbeit und Mitmachen",
|
||||
};
|
||||
|
||||
[Inject]
|
||||
private PocketBaseClient PocketBase { get; set; } = null!;
|
||||
|
||||
@@ -57,7 +46,4 @@ public partial class FaqList
|
||||
SourceUnavailable.SetStatus(HttpContext);
|
||||
}
|
||||
}
|
||||
|
||||
private static string TopicLabel(string topic)
|
||||
=> TopicLabels.GetValueOrDefault(topic, topic);
|
||||
}
|
||||
Reference in new issue
Block a user