Vorbereitung Webseitenstruktur HKB & HKW. Ordnerstruktur unt unrterschiedliche Layouts angelegt. Alle Views werden manuell in den Controllern angegeben.

This commit is contained in:
schnulller
2022-07-15 14:08:04 +02:00
parent fbd5a94ca1
commit 410d67ca08
30 changed files with 193774 additions and 298 deletions

View File

@@ -75,7 +75,7 @@ public class Briefecontroller : Controller {
}
// Return
return View(model);
return View("~/Views/HKB/Dynamic/Briefe.cshtml", model);
}
private IActionResult error404() {

View File

@@ -11,26 +11,22 @@ public class EditionController : Controller {
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
public IActionResult Kontakt() {
return View();
return View("~/Views/HKB/Static/Kontakt.cshtml");
}
public IActionResult Mitwirkende() {
return View();
return View("~/Views/HKB/Static/Mitwirkende.cshtml");
}
public IActionResult Richtlinien() {
return View();
return View("~/Views/HKB/Static/Richtlinien.cshtml");
}
public IActionResult Werkausgabe() {
return View();
return View("~/Views/HKB/Static/Werkausgabe.cshtml");
}
public IActionResult Editionsgeschichte() {
return View();
}
public IActionResult Datenschutzerklaerung() {
return View();
return View("~/Views/HKB/Static/Editionsgeschichte.cshtml");
}
}

View File

@@ -68,7 +68,7 @@ public class RegisterController : Controller {
};
// Return
return View("Index", model);
return View("~/Views/HKB/Dynamic/Register.cshtml", model);
}
[HttpGet]
@@ -101,7 +101,7 @@ public class RegisterController : Controller {
};
// Return
return View("Index", model);
return View("~/Views/HKB/Dynamic/Register.cshtml", model);
}
[HttpGet]
@@ -143,7 +143,7 @@ public class RegisterController : Controller {
};
// Return
return View("Index", model);
return View("~/Views/HKB/Dynamic/Register.cshtml", model);
}
[HttpPost]

View File

@@ -175,7 +175,7 @@ public class SucheController : Controller {
zhvolume = zhvolume == null ? "1" : zhvolume;
var model = new SucheViewModel(letters, page, pages, _getAvailablePersons(lib), availablePages.OrderBy(x => x.Volume).ToList(), zhvolume, zhpage, activeSearch, searchResults);
if (person != null) model.ActivePerson = person;
return View("Index", model);
return View("~/Views/HKB/Dynamic/Suche.cshtml", model);
}
private IActionResult _error404() {

View File

@@ -87,13 +87,13 @@ public class UploadController : Controller {
model.HamannFiles = hamannFiles;
model.AvailableFiles = XMLFileHelpers.ToFileModel(_xmlProvider.GetFiles(id), pF, uF);
return View("../Admin/Upload/Index", model);
return View("~/Views/Admin/Dynamic/Upload.cshtml", model);
} else {
var model = new UploadViewModel("Upload & Veröffentlichen", id, roots, usedFiles);
model.ProductionFiles = productionFiles;
model.HamannFiles = hamannFiles;
return View("../Admin/Upload/Index", model);
return View("~/Views/Admin/Dynamic/Upload.cshtml", model);
}
}

View File

@@ -45,6 +45,7 @@ Veränderungenen in der Funktionalität für den Benutzer
- Bibellinks in Bibelkommentaren
- Verbesserte Ladezeiten
- Startseite für die Briefausgebe / Werkausgabe. Unterschiedliche Menüs für die Ausgaben
- URL für die Register hat sich geändert, bleibt aber weiter unter `/Supplementa/` zugängig.
- Anzeige Briefe beim Namen (?)
- GeoCities und Personen-Verweise (?)

View File

@@ -22,6 +22,7 @@ public static class StringHelpers {
bool skipped = false;
foreach (char c in input) {
// TODO: punctuation
if (char.IsWhiteSpace(c)) {
if (!skipped) {
output.Append(normalizeTo);

View File

@@ -0,0 +1,3 @@
@{
Layout = "_LettersLayout";
}

View File

@@ -1,220 +1,220 @@
@model SucheViewModel;
@{
ViewData["Title"] = "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.";
ViewData["showCredits"] = "true";
}
<div class="ha-search">
@if (Model.Letters != null) {
<div class="ha-searchhead">
<h1>Briefauswahl</h1>
<div class="ha-searchnav">
@if (Model.AvailableYears != null && Model.AvailableYears.Any() && Model.AvailableYears.Count > 1) {
@for(var i = 0; i < Model.AvailableYears.Count; i++) {
<a class="@(Model.ActiveYear == i ? "active" : "")" asp-route-person="@Model.ActivePerson" asp-route-search="@Model.ActiveSearch" asp-controller="Suche" 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-searchbody">
<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.Autopsic">
<div class="ha-letterlistentryheader">
<div class="ha-letterlistautopsic">@letter.Meta.Autopsic</div>
<div class="ha-letterlistpills">@await Html.PartialAsync("/Views/Shared/_Pills.cshtml", (letter, true))</div>
</div>
<div class="ha-letterlistletterdata">
@await Html.PartialAsync("/Views/Shared/_LetterHead.cshtml", (letter, true, true))
</div>
</a>
@if (Model.SearchResults != null && Model.SearchResults.ContainsKey(letter.Meta.Index)) {
<div class="ha-letterlistsearchresults">
@foreach (var sr in Model.SearchResults[letter.Meta.Index])
{
<div class="ha-letterlistsearchresult">
<div class="ha-searchresultlocation">
@sr.Page/@sr.Line
</div>
<div class="ha-searchresultpreview">
@sr.Preview
</div>
</div>
}
</div>
}
</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">
<div class="ha-gototext">
Briefnummer
</div>
<input type="text" id="ha-gotoletternumber" class="ha-gotoletternumber" />
<button type="submit" id="ha-gotoformsubmit">Nachschlagen</button>
</form>
</div>
<script>
const ACTIVATEGOTOFILTER = function(filter, button) {
let f = filter.value;
if (f === "") {
button.disabled = true;
return;
}
button.disabled = false;
}
const SUBMITGOTO = function(filter) {
let f = filter.value;
window.location.href = "/Suche/" + f;
}
window.addEventListener("load", () => {
let gotofilter = document.getElementById("ha-gotoletternumber");
let gotosubmitbtn = document.getElementById("ha-gotoformsubmit");
let gotoform = document.getElementById("ha-gotoform");
ACTIVATEGOTOFILTER(gotofilter, gotosubmitbtn);
gotofilter.addEventListener("input", () => ACTIVATEGOTOFILTER(gotofilter, gotosubmitbtn));
gotoform.addEventListener("submit", (ev) => {
ev.preventDefault();
SUBMITGOTO(gotofilter);
});
});
</script>
@* ZH Loopkup *@
@if (Model.AvailablePages != null) {
<div class="ha-zhsearchfilter">
<div class="ha-filtertitle">
Suche in Z&hairsp;H
@if (Model.ActivePage != null) {
<a class="ha-reversefilter" asp-controller="Suche" asp-action="index">← Auswahl aufheben</a>
}
</div>
<form class="ha-zhform" id="ha-zhform">
<span>Z&hairsp;H Band</span>
<select id="ha-zhformvolume">
@foreach (var volume in Model.AvailablePages) {
<option>@volume.Volume</option>
}
</select>
<span>, Seite</span>
<input id="ha-zhformpage" type="text" value="@Model.ActivePage"/>
<button id="ha-zhformsubmit" type="submit">Nachschlagen</button>
</form>
</div>
<script>
const ACTIVATEZHSEARCH = function(volume, page, button) {
let vol = volume.options[volume.selectedIndex].value;
let pg = page.value;
if (pg === "") {
button.disabled = true;
return;
}
button.disabled = false;
}
const SUBMITZHSEARCH = function(volume, page) {
let vol = volume.options[volume.selectedIndex].value;
let pg = page.value;
window.location.href = "/Suche/" + vol + "/" + pg;
}
window.addEventListener("load", () => {
let vol = document.getElementById("ha-zhformvolume");
let pg = document.getElementById("ha-zhformpage");
let zhsubmitbtn = document.getElementById("ha-zhformsubmit");
let zhsearchform = document.getElementById("ha-zhform");
ACTIVATEZHSEARCH(vol, pg, zhsubmitbtn);
vol.addEventListener("change", () => ACTIVATEZHSEARCH(vol, pg, zhsubmitbtn));
pg.addEventListener("input", () => ACTIVATEZHSEARCH(vol, pg, zhsubmitbtn));
zhsearchform.addEventListener("submit", (ev) => {
ev.preventDefault();
SUBMITZHSEARCH(vol, pg);
});
});
</script>
}
@* Full-Text-Search *@
<div class="ha-searchfilter">
<div class="ha-filtertitle">
Volltextsuche
@if (Model.ActiveSearch != null) {
<a class="ha-reversefilter" asp-controller="Suche" asp-action="index">← Auswahl aufheben</a>
}
</div>
<form class="ha-searchform" id="ha-searchform" asp-controller="Suche" asp-action="Index" method="get">
<input id="ha-searchformtext" name="search" type="text" placeholder="Suchbegriff" value="@Model.ActiveSearch"/>
<button id="ha-searchformsubmit" type="submit">Suchen</button>
</form>
</div>
<script>
const ACTIVATESEARCHFILTER = function(filter, button) {
let f = filter.value;
if (f === "") {
button.disabled = true;
return;
}
button.disabled = false;
}
window.addEventListener("load", () => {
let searchfilter = document.getElementById("ha-searchformtext");
let searchsubmitbtn = document.getElementById("ha-searchformsubmit");
let searchform = document.getElementById("ha-searchform");
ACTIVATESEARCHFILTER(searchfilter, searchsubmitbtn);
searchfilter.addEventListener("input", () => ACTIVATESEARCHFILTER(searchfilter, searchsubmitbtn));
});
</script>
@* Person Filter *@
@if(Model.AvailablePersons != null) {
<div class="ha-personfilter">
<div class="ha-filtertitle">
Korrespondenzpartner:innen
@if (Model.ActivePerson != null) {
<a class="ha-reversefilter" asp-controller="Suche" asp-action="index">← Auswahl aufheben</a>
}
</div>
<div class="ha-personlist">
<a class="ha-personlistperson @(Model.ActivePerson == null ? "active" : "")" asp-controller="Suche" asp-action="Index">Alle</a>
@foreach (var person in Model.AvailablePersons) {
<a class="ha-personlistperson @(Model.ActivePerson == person.Key ? "active" : "")" asp-controller="Suche" asp-action="Person" asp-route-person="@person.Key" asp-route-page="@null">
@person.Name
</a>
}
</div>
</div>
}
</div>
</div>
}
@model SucheViewModel;
@{
ViewData["Title"] = "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.";
ViewData["showCredits"] = "true";
}
<div class="ha-search">
@if (Model.Letters != null) {
<div class="ha-searchhead">
<h1>Briefauswahl</h1>
<div class="ha-searchnav">
@if (Model.AvailableYears != null && Model.AvailableYears.Any() && Model.AvailableYears.Count > 1) {
@for(var i = 0; i < Model.AvailableYears.Count; i++) {
<a class="@(Model.ActiveYear == i ? "active" : "")" asp-route-person="@Model.ActivePerson" asp-route-search="@Model.ActiveSearch" asp-controller="Suche" 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-searchbody">
<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.Autopsic">
<div class="ha-letterlistentryheader">
<div class="ha-letterlistautopsic">@letter.Meta.Autopsic</div>
<div class="ha-letterlistpills">@await Html.PartialAsync("/Views/Shared/_Pills.cshtml", (letter, true))</div>
</div>
<div class="ha-letterlistletterdata">
@await Html.PartialAsync("/Views/Shared/_LetterHead.cshtml", (letter, true, true))
</div>
</a>
@if (Model.SearchResults != null && Model.SearchResults.ContainsKey(letter.Meta.Index)) {
<div class="ha-letterlistsearchresults">
@foreach (var sr in Model.SearchResults[letter.Meta.Index])
{
<div class="ha-letterlistsearchresult">
<div class="ha-searchresultlocation">
@sr.Page/@sr.Line
</div>
<div class="ha-searchresultpreview">
@sr.Preview
</div>
</div>
}
</div>
}
</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">
<div class="ha-gototext">
Briefnummer
</div>
<input type="text" id="ha-gotoletternumber" class="ha-gotoletternumber" />
<button type="submit" id="ha-gotoformsubmit">Nachschlagen</button>
</form>
</div>
<script>
const ACTIVATEGOTOFILTER = function(filter, button) {
let f = filter.value;
if (f === "") {
button.disabled = true;
return;
}
button.disabled = false;
}
const SUBMITGOTO = function(filter) {
let f = filter.value;
window.location.href = "/Suche/" + f;
}
window.addEventListener("load", () => {
let gotofilter = document.getElementById("ha-gotoletternumber");
let gotosubmitbtn = document.getElementById("ha-gotoformsubmit");
let gotoform = document.getElementById("ha-gotoform");
ACTIVATEGOTOFILTER(gotofilter, gotosubmitbtn);
gotofilter.addEventListener("input", () => ACTIVATEGOTOFILTER(gotofilter, gotosubmitbtn));
gotoform.addEventListener("submit", (ev) => {
ev.preventDefault();
SUBMITGOTO(gotofilter);
});
});
</script>
@* ZH Loopkup *@
@if (Model.AvailablePages != null) {
<div class="ha-zhsearchfilter">
<div class="ha-filtertitle">
Suche in Z&hairsp;H
@if (Model.ActivePage != null) {
<a class="ha-reversefilter" asp-controller="Suche" asp-action="index">← Auswahl aufheben</a>
}
</div>
<form class="ha-zhform" id="ha-zhform">
<span>Z&hairsp;H Band</span>
<select id="ha-zhformvolume">
@foreach (var volume in Model.AvailablePages) {
<option>@volume.Volume</option>
}
</select>
<span>, Seite</span>
<input id="ha-zhformpage" type="text" value="@Model.ActivePage"/>
<button id="ha-zhformsubmit" type="submit">Nachschlagen</button>
</form>
</div>
<script>
const ACTIVATEZHSEARCH = function(volume, page, button) {
let vol = volume.options[volume.selectedIndex].value;
let pg = page.value;
if (pg === "") {
button.disabled = true;
return;
}
button.disabled = false;
}
const SUBMITZHSEARCH = function(volume, page) {
let vol = volume.options[volume.selectedIndex].value;
let pg = page.value;
window.location.href = "/Suche/" + vol + "/" + pg;
}
window.addEventListener("load", () => {
let vol = document.getElementById("ha-zhformvolume");
let pg = document.getElementById("ha-zhformpage");
let zhsubmitbtn = document.getElementById("ha-zhformsubmit");
let zhsearchform = document.getElementById("ha-zhform");
ACTIVATEZHSEARCH(vol, pg, zhsubmitbtn);
vol.addEventListener("change", () => ACTIVATEZHSEARCH(vol, pg, zhsubmitbtn));
pg.addEventListener("input", () => ACTIVATEZHSEARCH(vol, pg, zhsubmitbtn));
zhsearchform.addEventListener("submit", (ev) => {
ev.preventDefault();
SUBMITZHSEARCH(vol, pg);
});
});
</script>
}
@* Full-Text-Search *@
<div class="ha-searchfilter">
<div class="ha-filtertitle">
Volltextsuche
@if (Model.ActiveSearch != null) {
<a class="ha-reversefilter" asp-controller="Suche" asp-action="index">← Auswahl aufheben</a>
}
</div>
<form class="ha-searchform" id="ha-searchform" asp-controller="Suche" asp-action="Index" method="get">
<input id="ha-searchformtext" name="search" type="text" placeholder="Suchbegriff" value="@Model.ActiveSearch"/>
<button id="ha-searchformsubmit" type="submit">Suchen</button>
</form>
</div>
<script>
const ACTIVATESEARCHFILTER = function(filter, button) {
let f = filter.value;
if (f === "") {
button.disabled = true;
return;
}
button.disabled = false;
}
window.addEventListener("load", () => {
let searchfilter = document.getElementById("ha-searchformtext");
let searchsubmitbtn = document.getElementById("ha-searchformsubmit");
let searchform = document.getElementById("ha-searchform");
ACTIVATESEARCHFILTER(searchfilter, searchsubmitbtn);
searchfilter.addEventListener("input", () => ACTIVATESEARCHFILTER(searchfilter, searchsubmitbtn));
});
</script>
@* Person Filter *@
@if(Model.AvailablePersons != null) {
<div class="ha-personfilter">
<div class="ha-filtertitle">
Korrespondenzpartner:innen
@if (Model.ActivePerson != null) {
<a class="ha-reversefilter" asp-controller="Suche" asp-action="index">← Auswahl aufheben</a>
}
</div>
<div class="ha-personlist">
<a class="ha-personlistperson @(Model.ActivePerson == null ? "active" : "")" asp-controller="Suche" asp-action="Index">Alle</a>
@foreach (var person in Model.AvailablePersons) {
<a class="ha-personlistperson @(Model.ActivePerson == person.Key ? "active" : "")" asp-controller="Suche" asp-action="Person" asp-route-person="@person.Key" asp-route-page="@null">
@person.Name
</a>
}
</div>
</div>
}
</div>
</div>
}
</div>

View File

@@ -0,0 +1,3 @@
@{
Layout = "_LettersLayout";
}

View File

@@ -0,0 +1,3 @@
@{
Layout = "_HKWLayout";
}

View File

@@ -1,59 +1,59 @@
<!DOCTYPE html>
<html lang="de" id="top">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="@ViewData["SEODescription"]">
<title>HKB: @ViewData["Title"]</title>
<!-- crossorigin is a workaround to prevent double downloading bugs in chrome -->
<!-- also, the graphite versions of the font are available for use:
<link rel="preload" href="/fonts/LinLibertine_R_G.ttf" as="font" crossorigin/>
<link rel="preload" href="/fonts/LinBiolinum_R_G.ttf" as="font" crossorigin/>
-->
<link rel="preload" href="/css/output.css" as="style" asp-append-version="true"/>
<link rel="preload" href="/img/subtlenet2.png" as="image" />
<link rel="preload" href="/fonts/LinBiolinum_R.woff" as="font" crossorigin/>
<link rel="preload" href="/fonts/LinLibertine_R.woff" as="font" crossorigin/>
<link rel="preload" href="/fonts/LinLibertine_RI.woff" as="font" crossorigin/>
<link rel="preload" href="/fonts/LinLibertine_RB.woff" as="font" crossorigin/>
<link rel="stylesheet" href="/css/output.css" asp-append-version="true" />
<environment include="Development">
<script src="~/js/site.js" asp-append-version="true"></script>
</environment>
</head>
<body class="w-full ">
<div class="relative min-h-screen">
<div class="pb-24">
@await Html.PartialAsync("/Views/Shared/_Menu.cshtml")
<main role="main" class="pb-3 w-full desktop:max-w-screen-desktop mx-auto h-full">
@RenderBody()
</main>
</div>
<div class="absolute bottom-0 w-full">
@await Html.PartialAsync("/Views/Shared/_Footer.cshtml")
</div>
</div>
<environment exclude="Development">
@await Html.PartialAsync("/Views/Shared/_Javascript.cshtml")
</environment>
<a class="ha-scrollbutton" id="ha-scrollbutton">
<svg class="ha-scrollbuttonarrow" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path strokeLinecap="round" strokeLinejoin="round" stroke-width="2" d="M5 11l7-7 7 7M5 19l7-7 7 7" />
</svg>
</div>
@RenderSection("Scripts", required: false)
</body>
</html>
<!DOCTYPE html>
<html lang="de" id="top">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="@ViewData["SEODescription"]">
<title>HKB: @ViewData["Title"]</title>
<!-- crossorigin is a workaround to prevent double downloading bugs in chrome -->
<!-- also, the graphite versions of the font are available for use:
<link rel="preload" href="/fonts/LinLibertine_R_G.ttf" as="font" crossorigin/>
<link rel="preload" href="/fonts/LinBiolinum_R_G.ttf" as="font" crossorigin/>
-->
<link rel="preload" href="/css/output.css" as="style" asp-append-version="true"/>
<link rel="preload" href="/img/subtlenet2.png" as="image" />
<link rel="preload" href="/fonts/LinBiolinum_R.woff" as="font" crossorigin/>
<link rel="preload" href="/fonts/LinLibertine_R.woff" as="font" crossorigin/>
<link rel="preload" href="/fonts/LinLibertine_RI.woff" as="font" crossorigin/>
<link rel="preload" href="/fonts/LinLibertine_RB.woff" as="font" crossorigin/>
<link rel="stylesheet" href="/css/output.css" asp-append-version="true" />
<environment include="Development">
<script src="~/js/site.js" asp-append-version="true"></script>
</environment>
</head>
<body class="w-full ">
<div class="relative min-h-screen">
<div class="pb-24">
@await Html.PartialAsync("/Views/Shared/_Menu.cshtml")
<main role="main" class="pb-3 w-full desktop:max-w-screen-desktop mx-auto h-full">
@RenderBody()
</main>
</div>
<div class="absolute bottom-0 w-full">
@await Html.PartialAsync("/Views/Shared/_Footer.cshtml")
</div>
</div>
<environment exclude="Development">
@await Html.PartialAsync("/Views/Shared/_Javascript.cshtml")
</environment>
<a class="ha-scrollbutton" id="ha-scrollbutton">
<svg class="ha-scrollbuttonarrow" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path strokeLinecap="round" strokeLinejoin="round" stroke-width="2" d="M5 11l7-7 7 7M5 19l7-7 7 7" />
</svg>
</div>
@RenderSection("Scripts", required: false)
</body>
</html>

View File

@@ -1,3 +1 @@
@{
Layout = "_Layout";
}


File diff suppressed because one or more lines are too long