Files
hamann-ausgabe-core/HaWeb/Views/HKB/Dynamic/Index.cshtml
Simon Martens 050784025c HTMX add
2024-01-25 18:20:18 +01:00

163 lines
8.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@model IndexViewModel;
@{
ViewData["Title"] = "HKB Briefauswahl & Suche";
ViewData["SEODescription"] = "Johann Georg Hamann: Kommentierte Briefausgabe, Hg. v. Leonard Keidel und Janina Reibold. Durchsuchbare Online-Ausgabe der Briefe von und an Johann Georg Hamann. Briefauswahl und -Suche.";
ViewData["showCredits"] = "true";
}
<div class="ha-index">
@if (Model.Letters != null) {
<div class="ha-indexhead">
@if (Model.PersonComment == null) {
<h1>Briefauswahl</h1>
}
@if(Model.PersonComment != null) {
<div class="ha-comment">
<div class="ha-headcomment">
<div class="ha-commentmetatext">
Briefwechsel mit &emsp;
<a class="ha-reversefilter dark:bg-black" asp-controller="Index" asp-action="Index">←&nbsp;Alle&nbsp;Briefe</a>
</div>
@Html.Raw(Model.PersonComment.ParsedComment)
@if (Model.PersonComment.ParsedSubComments != null && Model.PersonComment.ParsedSubComments.Any()) {
<div class="">
<a asp-controller="Register" asp-action="Allgemein" asp-route-id="@Model.PersonComment.ID[0]" asp-fragment="@Model.PersonComment.ID">Werke & Referenzstellen im Registereintrag&nbsp;→</a>
</div>
}
</div>
</div>
}
@if (Model.AvailableYears != null && Model.AvailableYears.Any() && Model.AvailableYears.Count > 1) {
<div class="ha-indexnav">
@for(var i = 0; i < Model.AvailableYears.Count; i++) {
<a class="@(Model.ActiveYear == i ? "active" : "")" asp-route-person="@Model.ActivePerson" asp-controller="Index" asp-route-page="@i">
@if (Model.AvailableYears[i].StartYear != Model.AvailableYears[i].EndYear) {
<span>
@Model.AvailableYears[i].StartYear@Model.AvailableYears[i].EndYear
</span>
}
else {
<span>
@Model.AvailableYears[i].StartYear
</span>
}
</a>
}
</div>
}
</div>
<div class="ha-indexbody">
<div class="ha-letterlist">
@* Letter Loop *@
@foreach (var year in Model.Letters) {
foreach (var letter in year.LetterList) {
<div class="ha-letterlistentry">
<a asp-controller="Briefe" asp-action="Index" asp-route-id="@letter.Meta.ID">
@await Html.PartialAsync("/Views/Shared/_LetterHead.cshtml", (letter, true, false))
</a>
</div>
}
}
</div>
<div class="ha-filterlist">
@* Go To Letter *@
<div class="ha-gotofilter">
<div class="ha-filtertitle">H&hairsp;K&hairsp;B</div>
<form class="ha-gotoform" id="ha-gotoform" asp-controller="Briefe" asp-action="Index" method="get">
<div class="ha-gototext">
Briefnummer
</div>
<input name="id" type="text" id="ha-gotoletternumber" class="ha-gotoletternumber" />
<button type="submit" id="ha-gotoformsubmit">Nachschlagen</button>
</form>
<div class="mr-2 leading-snug text-base px-1 text-red-700 bg-red-50 text-left h-5 whitespace-nowrap overflow-hidden opacity-0" id="ha-gotoinfo"></div>
</div>
@* ZH Loopkup *@
@if (Model.AvailablePages != null) {
<div class="ha-zhsearchfilter">
<div class="ha-filtertitle">
Suche in Z&hairsp;H
@if (Model.ActivePage != null) {
<div class="ha-activefilterinfo">
Briefe auf ZH <span class="caps-allpeteite">@Model.ActiveVolume / @Model.ActivePage</span>&emsp;
<a class="ha-reversefilter" asp-controller="Index" asp-action="Index">← Auswahl aufheben</a>
</div>
}
</div>
<div class="mr-2 leading-snug px-1 bg-slate-200 dark:bg-black rounded text-sm">
Derzeit kritisch geprüft, ediert und hochgeladen sind Briefe bis einschließlich @Model.EndYear (= @Model.EndPageString).
</div>
<form class="ha-zhform font-sans" id="ha-zhform">
<span>Z&hairsp;H</span>
<select class="text-base" name="zhvolume" id="ha-zhformvolume">
@foreach (var volume in Model.AvailablePages.OrderBy(x => x.Key)) {
<option value="@volume.Key">@HaWeb.HTMLHelpers.ConversionHelpers.ToRomanSafe(volume.Key)</option>
}
</select>
<span>/ </span>
<input name="zhpage" id="ha-zhformpage" type="text" value="@Model.ActivePage" placeholder="Seite"/>
<button id="ha-zhformsubmit" type="submit">Nachschlagen</button>
</form>
<div class="mr-2 leading-snug text-base px-1 text-red-700 bg-red-50 text-left h-5 whitespace-nowrap overflow-hidden opacity-0" id="ha-zhsearchinfo"></div>
</div>
}
@* Full-Text-Search *@
<div class="ha-searchfilter">
<div class="ha-filtertitle">
Volltextsuche
</div>
<form class="ha-searchform" id="ha-searchform" asp-controller="Suche" asp-action="Briefe" asp-route-comments="true" method="get">
<input id="ha-searchformtext" name="search" type="text" placeholder="Suchbegriff"/>
<input type="hidden" name="comments" value="true"/>
<button id="ha-searchformsubmit" type="submit">Suchen</button>
</form>
</div>
@* Person Filter *@
@if(Model.AvailablePersons != null) {
<div class="ha-personfilter">
<div class="ha-filtertitle">
<div>
Korrespondenzpartner:innen
</div>
@if (Model.ActivePerson != null && Model.AvailablePersons.Where(x => x.Key == Model.ActivePerson).Any()) {
<div class="ha-activefilterinfo">
Briefwechsel mit @Model.AvailablePersons.Where(x => x.Key == Model.ActivePerson).First().Name.&emsp;
<a class="ha-reversefilter" asp-controller="Index" asp-action="Index">←&nbsp;Auswahl&nbsp;aufheben</a>
</div>
}
</div>
<div class="ha-personlist">
<a class="ha-personlistperson @(Model.ActivePerson == null ? "active" : "")" asp-controller="Index" asp-action="Index">Alle</a>
@foreach (var person in Model.AvailablePersons) {
<a class="ha-personlistperson @(Model.ActivePerson == person.Key ? "active" : "")" asp-controller="Index" asp-action="Person" asp-route-person="@person.Key" asp-route-page="@null">
@person.Name
</a>
}
</div>
</div>
}
</div>
</div>
}
</div>
<script type="module">
import { startup_index } from "/dist/scripts.js";
startup_index(
new Set(@Html.Raw(Json.Serialize(Model.AvailableLetters))),
@Html.Raw(Json.Serialize(Model.AvailablePages))
);
</script>