docs/redaktion.md (Abschnitt „Häufige Fragen“) beschreibt faqs.topic als freien Text, aus dem die Gruppen entstehen. Schema (pb/pb_migrations/collections_schema.json) und Live-Daten haben aber eine eigene Collection faq_topics (title, slug, intro, order, public) und faqs.topic als Relation. Die Doku ist damit veraltet und führt Redakteure in die Irre.
Aufgaben
docs/redaktion.md: FAQ-Abschnitt auf faq_topics + Relation umschreiben (inkl. Tabelle der Collections, embed-Werte prüfen)
Verworfener Entwurf FaqTopicsEmbed (nie committet, nutzte eine nicht vorhandene EmbedCard)
usingElternbeirat.Contracts;usingElternbeirat.PocketBase;usingMicrosoft.AspNetCore.Components;namespaceElternbeirat.Web.Features.Embeds;publicpartialclassFaqTopicsEmbed{ [LoggerMessage(
Level = LogLevel.Warning,
Message = "Could not load FAQ topics for an embed from PocketBase; the block is omitted.")]privatestaticpartialvoidLogSourceUnavailable(ILoggerlogger,Exceptionexception); [Inject]privatePocketBaseClientPocketBase{get;set;}=null!; [Inject]privateILogger<FaqTopicsEmbed>Logger{get;set;}=null!; [CascadingParameter]privateHttpContext?HttpContext{get;set;}// The route FaqTopicPage (@page "/faqs/{Slug}") serves. Kept as one named// constant so the link the embed builds and the page's own route stay in step.privateconststringTopicRoutePrefix="/faqs/";privateIReadOnlyList<FaqTopic>_topics=[];/// <summary>The link to a topic's own page, e.g. <c>/faqs/lunch</c>.</summary>/// <param name="topic">The topic to link to; its <see cref="FaqTopic.Slug"/> forms the last path segment.</param>/// <returns>The relative URL of the topic's page.</returns>privatestaticstringTopicHref(FaqTopictopic)=>TopicRoutePrefix+topic.Slug;protectedoverrideasyncTaskOnInitializedAsync(){try{// GetFaqTopicsAsync returns the topics ordered, so the list can be// rendered verbatim. Unlike a teaser, all topics are shown._topics=awaitPocketBase.GetFaqTopicsAsync(HttpContext?.RequestAborted??CancellationToken.None);}catch(PocketBaseUnavailableExceptionexception){// Only part of the page fails: omit the block, keep the page (and its// 200) intact. A missing block is degraded, not broken.LogSourceUnavailable(Logger,exception);}}}
Blockiert den Start von „Design auffrischen“ (#37), damit sich die Arbeiten nicht überschneiden.
`docs/redaktion.md` (Abschnitt „Häufige Fragen“) beschreibt `faqs.topic` als **freien Text**, aus dem die Gruppen entstehen. Schema (`pb/pb_migrations/collections_schema.json`) und Live-Daten haben aber eine eigene Collection **`faq_topics`** (title, slug, intro, order, public) und `faqs.topic` als **Relation**. Die Doku ist damit veraltet und führt Redakteure in die Irre.
## Aufgaben
- [x] `docs/redaktion.md`: FAQ-Abschnitt auf `faq_topics` + Relation umschreiben (inkl. Tabelle der Collections, `embed`-Werte prüfen)
<details>
<summary>Verworfener Entwurf <code>FaqTopicsEmbed</code> (nie committet, nutzte eine nicht vorhandene <code>EmbedCard</code>)</summary>
```razor
@if (_topics.Count > 0)
{
<section class="embed embed-faq-topics">
<h2>Häufige Fragen</h2>
<ul class="embed-cards">
@foreach (var topic in _topics)
{
<EmbedCard Title="@topic.Title" Href="@TopicHref(topic)" />
}
</ul>
</section>
}
```
```csharp
using Elternbeirat.Contracts;
using Elternbeirat.PocketBase;
using Microsoft.AspNetCore.Components;
namespace Elternbeirat.Web.Features.Embeds;
public partial class FaqTopicsEmbed
{
[LoggerMessage(
Level = LogLevel.Warning,
Message = "Could not load FAQ topics for an embed from PocketBase; the block is omitted.")]
private static partial void LogSourceUnavailable(
ILogger logger,
Exception exception);
[Inject]
private PocketBaseClient PocketBase { get; set; } = null!;
[Inject]
private ILogger<FaqTopicsEmbed> Logger { get; set; } = null!;
[CascadingParameter]
private HttpContext? HttpContext { get; set; }
// The route FaqTopicPage (@page "/faqs/{Slug}") serves. Kept as one named
// constant so the link the embed builds and the page's own route stay in step.
private const string TopicRoutePrefix = "/faqs/";
private IReadOnlyList<FaqTopic> _topics = [];
/// <summary>The link to a topic's own page, e.g. <c>/faqs/lunch</c>.</summary>
/// <param name="topic">The topic to link to; its <see cref="FaqTopic.Slug"/> forms the last path segment.</param>
/// <returns>The relative URL of the topic's page.</returns>
private static string TopicHref(FaqTopic topic) => TopicRoutePrefix + topic.Slug;
protected override async Task OnInitializedAsync()
{
try
{
// GetFaqTopicsAsync returns the topics ordered, so the list can be
// rendered verbatim. Unlike a teaser, all topics are shown.
_topics = await PocketBase.GetFaqTopicsAsync(HttpContext?.RequestAborted ?? CancellationToken.None);
}
catch (PocketBaseUnavailableException exception)
{
// Only part of the page fails: omit the block, keep the page (and its
// 200) intact. A missing block is degraded, not broken.
LogSourceUnavailable(Logger, exception);
}
}
}
```
</details>
Blockiert den Start von „Design auffrischen“ (#37), damit sich die Arbeiten nicht überschneiden.
Gehört zu #6.
Tom
added this to the Elternbeirat-Website milestone 2026-10-01 11:06:48 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
docs/redaktion.md(Abschnitt „Häufige Fragen“) beschreibtfaqs.topicals freien Text, aus dem die Gruppen entstehen. Schema (pb/pb_migrations/collections_schema.json) und Live-Daten haben aber eine eigene Collectionfaq_topics(title, slug, intro, order, public) undfaqs.topicals Relation. Die Doku ist damit veraltet und führt Redakteure in die Irre.Aufgaben
docs/redaktion.md: FAQ-Abschnitt auffaq_topics+ Relation umschreiben (inkl. Tabelle der Collections,embed-Werte prüfen)Verworfener Entwurf
FaqTopicsEmbed(nie committet, nutzte eine nicht vorhandeneEmbedCard)Blockiert den Start von „Design auffrischen“ (#37), damit sich die Arbeiten nicht überschneiden.
Gehört zu #6.
FAQ: Doku an faq_topics angleichen, FaqTopicsEmbed klärento FAQ: Doku an faq_topics angleichen