PDF + Bereit für Upload

This commit is contained in:
Simon Martens
2023-02-21 19:14:52 +01:00
parent 99693b0c1d
commit 5093951f7a
259 changed files with 145 additions and 84 deletions

View File

@@ -112,6 +112,14 @@ public class Briefecontroller : Controller {
model.Texts = texts; model.Texts = texts;
if (System.IO.File.Exists("./wwwroot/pdf/HKB_" + id + ".pdf")) {
model.PDFFilePath = "/pdf/HKB_" + id + ".pdf";
}
if (System.IO.File.Exists("./wwwroot/pdf/HKB_" + model.MetaData.Meta.Sort.Year + ".pdf")) {
model.YearPDFFilePath = "/pdf/HKB_" + model.MetaData.Meta.Sort.Year + ".pdf";
}
// Return // Return
return View("~/Views/HKB/Dynamic/Briefe.cshtml", model); return View("~/Views/HKB/Dynamic/Briefe.cshtml", model);
} }

View File

@@ -7,6 +7,10 @@ public class BriefeViewModel {
public BriefeMetaViewModel MetaData { get; private set; } public BriefeMetaViewModel MetaData { get; private set; }
public string? DefaultCategory { get; set; } public string? DefaultCategory { get; set; }
public string? PDFFilePath { get; set; }
public string? YearPDFFilePath { get; set; }
private List<(string, string, string, string, string, string)>? _ParsedEdits; private List<(string, string, string, string, string, string)>? _ParsedEdits;
private List<(string, string, string, string, string)>? _ParsedHands; private List<(string, string, string, string, string)>? _ParsedHands;
private List<(string Category, List<Text>)>? _Texts; private List<(string Category, List<Text>)>? _Texts;

View File

@@ -15,46 +15,79 @@
<div class="ha-letterheadernav"> <div class="ha-letterheadernav">
<div class="md:hidden grow"> <div class="md:hidden grow">
<select id="ha-switchlettercategory"> <select id="ha-switchlettercategory">
@foreach (var app in Model.Texts) { @foreach (var app in Model.Texts)
@if (app.Category != Model.DefaultCategory) { <option class="ha-tabbtn" autocomplete="off">@app.Category</option> } {
@if (app.Category != Model.DefaultCategory)
{
<option class="ha-tabbtn" autocomplete="off">@app.Category</option>
}
} }
@if (Model.Texts != null && Model.Texts.Where(x => x.Category == Model.DefaultCategory).Any()) { @if (Model.Texts != null && Model.Texts.Where(x => x.Category == Model.DefaultCategory).Any())
<option class="ha-tabbtn" autocomplete="off">@Model.DefaultCategory</option> {
<option class="ha-tabbtn" autocomplete="off">@Model.DefaultCategory</option>
} }
</select> </select>
</div> </div>
<div class="ha-lettertabs !hidden md:!block"> <div class="ha-lettertabs !hidden md:!block">
@foreach (var app in Model.Texts) @foreach (var app in Model.Texts)
{ {
@if (app.Category != Model.DefaultCategory) { <a class="ha-tabbtn hidden md:inline-block">@app.Category</a> } @if (app.Category != Model.DefaultCategory)
{
<a class="ha-tabbtn hidden md:inline-block">@app.Category</a>
}
} }
@if (Model.Texts != null && Model.Texts.Where(x => x.Category == Model.DefaultCategory).Any()) { @if (Model.Texts != null && Model.Texts.Where(x => x.Category == Model.DefaultCategory).Any())
<a class="ha-tabbtn hidden md:inline-block">@Model.DefaultCategory</a> {
<a class="ha-tabbtn hidden md:inline-block">@Model.DefaultCategory</a>
} }
<a >PDF</a>
</div> </div>
@if (Model.PDFFilePath != null || Model.YearPDFFilePath != null)
{
<div class="self-end mr-4 hidden md:block mb-1 text-base">
<span class="caps-petite">PDF:</span>
@if (Model.PDFFilePath != null)
{
<a class="ml-1" href="@Model.PDFFilePath">
<div class="inline-block bg-slate-100 hover:bg-slate-200 border px-1.5 rounded">Brief @Model.MetaData.Meta.Autopsic</div>
</a>
}
@if (Model.YearPDFFilePath != null)
{
<a class="ml-1 mr-2" href="@Model.YearPDFFilePath">
<div class="inline-block bg-slate-100 hover:bg-slate-200 border px-1.5 rounded">Jahr @Model.MetaData.Meta.Sort.Year</div>
</a>
}
</div>
}
@if (Model.MetaData.Next != null || Model.MetaData.Prev != null) @if (Model.MetaData.Next != null || Model.MetaData.Prev != null)
{ {
<div class="ha-lettermetalinks"> <div class="ha-lettermetalinks">
@if (Model.MetaData.Prev != null) @if (Model.MetaData.Prev != null)
{ {
<a href="@Model.MetaData.Prev.Value.Item2"> <a href="@Model.MetaData.Prev.Value.Item2">
@Model.MetaData.Prev.Value.Model.Meta.Autopsic ◀ @Model.MetaData.Prev.Value.Model.Meta.Autopsic ◀
</a> </a>
} }
<div class="ha-hkb"> <div class="ha-hkb">
HKB HKB
</div> </div>
@if (Model.MetaData.Next != null) @if (Model.MetaData.Next != null)
{ {
<a href="@Model.MetaData.Next.Value.Item2"> <a href="@Model.MetaData.Next.Value.Item2">
▶ @Model.MetaData.Next.Value.Model.Meta.Autopsic ▶ @Model.MetaData.Next.Value.Model.Meta.Autopsic
</a> </a>
} }
</div> </div>
} }
</div> </div>
</div> </div>
@@ -62,93 +95,109 @@
<div class="ha-letterbody" id="ha-letterbody"> <div class="ha-letterbody" id="ha-letterbody">
@foreach (var app in Model.Texts) @foreach (var app in Model.Texts)
{ {
@if (app.Category != Model.DefaultCategory) { @if (app.Category != Model.DefaultCategory)
<div class="ha-tab"> {
@foreach (var text in app.Item2) <div class="ha-tab">
{ @foreach (var text in app.Item2)
var mw = (text.MinWidth) ? "ha-minwidth" : ""; {
<div class="ha-appcontainer ha-appcontainer-@text.Number @mw"> var mw = (text.MinWidth) ? "ha-minwidth" : "";
@if (app.Item2.Count > 1 && !String.IsNullOrWhiteSpace(text.ParsedText) && !String.IsNullOrWhiteSpace(text.Title) ) { <div class="ha-appcontainer ha-appcontainer-@text.Number @mw">
<h3>@text.Title</h3> @if (app.Item2.Count > 1 && !String.IsNullOrWhiteSpace(text.ParsedText) && !String.IsNullOrWhiteSpace(text.Title))
{
<h3>@text.Title</h3>
}
@if (!String.IsNullOrWhiteSpace(text.ParsedText))
{
@Html.Raw(text.ParsedText)
}
</div>
} }
@if (!String.IsNullOrWhiteSpace(text.ParsedText)) { @Html.Raw(text.ParsedText) } </div>
</div>
}
</div>
} }
} }
@if (Model.Texts != null && Model.Texts.Where(x => x.Category == Model.DefaultCategory).Any()) { @if (Model.Texts != null && Model.Texts.Where(x => x.Category == Model.DefaultCategory).Any())
<div class="ha-tab ha-defaulttab"> {
<div class="ha-tab ha-defaulttab">
@foreach (var text in Model.Texts.Where(x => x.Category == Model.DefaultCategory).First().Item2) @foreach (var text in Model.Texts.Where(x => x.Category == Model.DefaultCategory).First().Item2)
{ {
var mw = (text.MinWidth) ? "ha-minwidth" : ""; var mw = (text.MinWidth) ? "ha-minwidth" : "";
<div class="ha-appcontainer ha-appcontainer-@text.Number @mw"> <div class="ha-appcontainer ha-appcontainer-@text.Number @mw">
@if (!String.IsNullOrWhiteSpace(text.ParsedText) && !String.IsNullOrWhiteSpace(text.Title) ) { @if (!String.IsNullOrWhiteSpace(text.ParsedText) && !String.IsNullOrWhiteSpace(text.Title))
<h3>@text.Title</h3> {
} <h3>@text.Title</h3>
@if (!String.IsNullOrWhiteSpace(text.ParsedText)) { @Html.Raw(text.ParsedText) } }
</div> @if (!String.IsNullOrWhiteSpace(text.ParsedText))
{
@Html.Raw(text.ParsedText)
}
</div>
} }
@if (Model.ParsedHands != null && Model.ParsedHands.Any()) @if (Model.ParsedHands != null && Model.ParsedHands.Any())
{ {
<div class="ha-hands ha-appcontainer"> <div class="ha-hands ha-appcontainer">
<h3>Zusätze fremder Hand</h3> <h3>Zusätze fremder Hand</h3>
<div class="ha-app"> <div class="ha-app">
<div class="ha-handentries"> <div class="ha-handentries">
<table> <table>
@foreach (var hand in Model.ParsedHands) @foreach (var hand in Model.ParsedHands)
{ {
<tr class="ha-handentry"> <tr class="ha-handentry">
<td> <td>
<div class="ha-handfrom">@hand.ParsedStart</div>@if(!String.IsNullOrEmpty(hand.ParsedEnd)){<div class="ha-handto">@hand.ParsedEnd</div>} <div class="ha-handfrom">@hand.ParsedStart</div>@if (!String.IsNullOrEmpty(hand.ParsedEnd))
</td> {
<td class="ha-handperson">@Html.Raw(@hand.Person)</td> <div class="ha-handto">@hand.ParsedEnd</div>
</tr> }
} </td>
</table> <td class="ha-handperson">@Html.Raw(@hand.Person)</td>
</div> </tr>
}
</table>
</div>
</div> </div>
</div> </div>
} }
@if (Model.ParsedEdits != null) @if (Model.ParsedEdits != null)
{ {
<div class="ha-edits ha-appcontainer"> <div class="ha-edits ha-appcontainer">
<h3>Textkritische Anmerkungen</h3> <h3>Textkritische Anmerkungen</h3>
<div class="ha-editsinfo">Der Brieftext wurde anhand der überlieferten Quellen (vgl. Provenienz) kritisch <div class="ha-editsinfo">Der Brieftext wurde anhand der überlieferten Quellen (vgl. Provenienz) kritisch
geprüft. Notwendige Korrekturen gegenüber dem in ZH gedruckten Text wurden vorgenommen und sind geprüft. Notwendige Korrekturen gegenüber dem in ZH gedruckten Text wurden vorgenommen und sind
vollständig annotiert. Die in den beiden Auflagen von ZH angehängten Korrekturvorschläge werden vollständig annotiert. Die in den beiden Auflagen von ZH angehängten Korrekturvorschläge werden
vollständig aufgelistet, werden aber nur dann im Text realisiert, sofern diese anhand überlieferter vollständig aufgelistet, werden aber nur dann im Text realisiert, sofern diese anhand überlieferter
Quellen verifiziert werden konnten.</div> Quellen verifiziert werden konnten.</div>
<div class="ha-app"> <div class="ha-app">
<div class="ha-editentries"> <div class="ha-editentries">
<table> <table>
@foreach (var edit in Model.ParsedEdits) @foreach (var edit in Model.ParsedEdits)
{ {
<tr> <tr>
<td class="ha-editfromto"> <td class="ha-editfromto">
<div class="ha-editfrom">@edit.ParsedStart</div>@if(!String.IsNullOrEmpty(edit.ParsedEnd)){<div class="ha-editto">@edit.ParsedEnd</div>} <div class="ha-editfrom">@edit.ParsedStart</div>@if (!String.IsNullOrEmpty(edit.ParsedEnd))
</td> {
<td class="ha-editreference"> <div class="ha-editto">@edit.ParsedEnd</div>
@if (!String.IsNullOrWhiteSpace(edit.Text) && !String.IsNullOrWhiteSpace(edit.Preview)) }
{ </td>
<span> <td class="ha-editreference">
@Html.Raw(@edit.Preview)] @if (!String.IsNullOrWhiteSpace(edit.Text) && !String.IsNullOrWhiteSpace(edit.Preview))
</span> {
} <span>
</td> @Html.Raw(@edit.Preview)]
<td class="ha-editreas"> </span>
@Html.Raw(@edit.Text) }
</td> </td>
</tr> <td class="ha-editreas">
} @Html.Raw(@edit.Text)
</table> </td>
</div> </tr>
}
</table>
</div>
</div> </div>
</div> </div>
} }
</div> </div>
} }
</div> </div>

View File

@@ -16,7 +16,7 @@
Hirschgasse 2 <br> Hirschgasse 2 <br>
69120 Heidelberg <br> 69120 Heidelberg <br>
Telefon: 06221 7259277 <br> Telefon: 06221 7259277 <br>
E-Mail: <a class="Emailhref" href="mailto:post@hamann-ausgabe">post@hamann-ausgabe</a> E-Mail: <a class="Emailhref" href="mailto:post@hamann-ausgabe.de">post@hamann-ausgabe.de</a>
</div> </div>
<div class="grow shrink-0"> <div class="grow shrink-0">
Germanistisches Seminar der Universität Heidelberg <br> Germanistisches Seminar der Universität Heidelberg <br>

File diff suppressed because one or more lines are too long

BIN
HaWeb/wwwroot/pdf/HKB_1.pdf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More