Files

48 lines
1.3 KiB
Plaintext

@page "/faqs"
@{
// Heading and intro come from the "faqs" page record; fall back to a sensible
// default only if that record is missing, so the page still renders.
var title = _page?.Title ?? "FAQs";
}
<PageTitle>@title</PageTitle>
<h1>@title</h1>
@if (_page is not null && !string.IsNullOrWhiteSpace(_page.Body))
{
<article class="markdown-body">@Body</article>
}
@if (_unavailable)
{
<p>Die Fragen sind gerade nicht erreichbar. Bitte später erneut versuchen.</p>
}
else if (_topics.Count == 0)
{
<p>Zurzeit gibt es keine Fragen.</p>
}
else
{
@foreach (var topic in _topics)
{
<details class="faq-topic disclosure">
<summary>@topic.Title</summary>
@if (!string.IsNullOrWhiteSpace(topic.Intro))
{
<div class="faq-topic-intro markdown-body">@((MarkupString)Markdown.ToHtml(topic.Intro))</div>
}
@foreach (var faq in topic.Faqs)
{
<details class="faq-item">
<summary>@faq.Question</summary>
<div class="faq-answer markdown-body">
@((MarkupString)Markdown.ToHtml(faq.Answer))
</div>
</details>
}
</details>
}
}