using System.Globalization; using System.Net; namespace Febe.SitoDiProva; /// The HTML of the site: plain pages, no branding, no login form. Data is filled in by sito.js. internal static class Pages { public static string Home() => Layout("Inizio", "inizio", string.Empty, """

Inizio

"""); public static string Profile(string username, ProfileTab tab) { var u = Encode(username); var tabName = tab switch { ProfileTab.Reels => "reel", ProfileTab.Tagged => "taggati", _ => "post" }; string Tab(string label, string path, ProfileTab which) => $"""{label}"""; return Layout($"Profilo di {username}", "profilo", $"""data-utente="{Html(username)}" data-scheda="{tabName}" """, $"""
"""); } public static string ProfileNotFound(string username) => Layout("Profilo non trovato", "nessuna", string.Empty, $"""

Profilo non trovato

Il profilo «{Html(username)}» non esiste o non è più disponibile.

Torna all'inizio

"""); public static string Following(string username) => Layout($"Profili seguiti da {username}", "seguiti", $"""data-utente="{Html(username)}" """, """

Profili seguiti

"""); public static string Post(string code) => Layout("Post", "post", $"""data-sigla="{Html(code)}" """, """
"""); public static string Viewer(string kind, TimeSpan storyDuration) => $""" {(kind == "storie" ? "Storie" : "Raccolta")}
"""; public static string Challenge() => Layout("Verifica", "nessuna", string.Empty, """

Verifica richiesta

Il sito di prova chiede una verifica. Febe deve fermarsi e avvisare: qui non c'è niente da compilare.

"""); public static string SessionEnded() => Layout("Sessione scaduta", "nessuna", string.Empty, """

Sessione scaduta

La sessione del sito di prova è terminata. Febe deve fermarsi e non tentare di rientrare.

"""); public static string NotFound() => Layout("Pagina non trovata", "nessuna", string.Empty, "

Pagina non trovata

"); private static string Layout(string title, string page, string attributes, string main) => $""" {Html(title)} · Sito di prova
Sito di prova di FebeInizioSeguiti
{main}
"""; private static string Html(string text) => WebUtility.HtmlEncode(text); private static string Encode(string text) => Uri.EscapeDataString(text); }