Integrated Person View

This commit is contained in:
Simon Martens
2023-07-04 08:36:25 +02:00
parent cf0bc3cddf
commit 04ebd5d90d
10 changed files with 40 additions and 33 deletions

View File

@@ -177,7 +177,7 @@ public class IndexController : Controller {
parsedSubComments.Add(HTMLHelpers.CommentHelpers.CreateHTML(lib, _readerService, subcomm.Value, "neuzeit", Settings.ParsingState.CommentType.Subcomment, true)); parsedSubComments.Add(HTMLHelpers.CommentHelpers.CreateHTML(lib, _readerService, subcomm.Value, "neuzeit", Settings.ParsingState.CommentType.Subcomment, true));
} }
} }
return new CommentModel(parsedComment, parsedSubComments); return new CommentModel(parsedComment, parsedSubComments, comment);
} }
private IActionResult _error404() { private IActionResult _error404() {

View File

@@ -159,7 +159,7 @@ public class RegisterController : Controller {
parsedSubComments.Add(HTMLHelpers.CommentHelpers.CreateHTML(lib, _readerService, subcomm.Value, category, Settings.ParsingState.CommentType.Subcomment, generateBacklinks)); parsedSubComments.Add(HTMLHelpers.CommentHelpers.CreateHTML(lib, _readerService, subcomm.Value, category, Settings.ParsingState.CommentType.Subcomment, generateBacklinks));
} }
} }
res.Add(new CommentModel(parsedComment, parsedSubComments)); res.Add(new CommentModel(parsedComment, parsedSubComments, comm.Index));
} }
return res; return res;
} }
@@ -177,7 +177,7 @@ public class RegisterController : Controller {
parsedSubComments.Add(HTMLHelpers.CommentHelpers.CreateHTML(lib, _readerService, subcomm.Value, category, Settings.ParsingState.CommentType.Subcomment)); parsedSubComments.Add(HTMLHelpers.CommentHelpers.CreateHTML(lib, _readerService, subcomm.Value, category, Settings.ParsingState.CommentType.Subcomment));
} }
} }
res.Add(new CommentModel(parsedComment, parsedSubComments)); res.Add(new CommentModel(parsedComment, parsedSubComments, comm.Index));
} }
return res; return res;
} }

View File

@@ -137,7 +137,7 @@ public class SucheController : Controller {
letters = metasbyyear letters = metasbyyear
.Where(x => x.Key >= pages[page].StartYear && x.Key <= pages[page].EndYear) .Where(x => x.Key >= pages[page].StartYear && x.Key <= pages[page].EndYear)
.Select(x => (x.Key, x .Select(x => (x.Key, x
.Select(y => Briefecontroller.GenerateMetaViewModel(lib, y, true)) .Select(y => Briefecontroller.GenerateMetaViewModel(lib, y, false))
.OrderBy(x => x.Meta.Sort) .OrderBy(x => x.Meta.Sort)
.ThenBy(x => x.Meta.Order) .ThenBy(x => x.Meta.Order)
.ToList())) .ToList()))
@@ -237,7 +237,7 @@ public class SucheController : Controller {
parsedSubComments.Add(HTMLHelpers.CommentHelpers.CreateHTML(lib, _readerService, subcommobj, category, Settings.ParsingState.CommentType.Subcomment)); parsedSubComments.Add(HTMLHelpers.CommentHelpers.CreateHTML(lib, _readerService, subcommobj, category, Settings.ParsingState.CommentType.Subcomment));
} }
} }
res.Add(new CommentModel(parsedComment, parsedSubComments)); res.Add(new CommentModel(parsedComment, parsedSubComments, comm.Item1));
} }
return res; return res;
} }

View File

@@ -6,10 +6,12 @@ using HaXMLReader.Interfaces;
using HaXMLReader.EvArgs; using HaXMLReader.EvArgs;
public class CommentModel { public class CommentModel {
public string ID { get; private set; }
public string ParsedComment { get; private set; } public string ParsedComment { get; private set; }
public List<string>? ParsedSubComments { get; private set; } public List<string>? ParsedSubComments { get; private set; }
public CommentModel(string parsedComment, List<string>? parsedSubComments) { public CommentModel(string parsedComment, List<string>? parsedSubComments, string id) {
this.ID = id;
this.ParsedComment = parsedComment; this.ParsedComment = parsedComment;
this.ParsedSubComments = parsedSubComments; this.ParsedSubComments = parsedSubComments;
} }

View File

@@ -22,6 +22,11 @@
<a class="ha-reversefilter" asp-controller="Index" asp-action="Index">←&nbsp;Alle&nbsp;Briefe</a> <a class="ha-reversefilter" asp-controller="Index" asp-action="Index">←&nbsp;Alle&nbsp;Briefe</a>
</div> </div>
@Html.Raw(Model.PersonComment.ParsedComment) @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>
</div> </div>
} }

View File

@@ -85,7 +85,7 @@
foreach (var letter in year.LetterList) { foreach (var letter in year.LetterList) {
<div class="ha-letterlistentry"> <div class="ha-letterlistentry">
<a asp-controller="Briefe" asp-action="Index" asp-route-id="@letter.Meta.Autopsic"> <a asp-controller="Briefe" asp-action="Index" asp-route-id="@letter.Meta.Autopsic">
@await Html.PartialAsync("/Views/Shared/_LetterHead.cshtml", (letter, true, false)) @Html.Partial("/Views/Shared/_LetterHead.cshtml", (letter, true, false))
</a> </a>
@if (Model.SearchResults != null && Model.SearchResults.ContainsKey(letter.Meta.Index)) { @if (Model.SearchResults != null && Model.SearchResults.ContainsKey(letter.Meta.Index)) {

View File

@@ -2,14 +2,14 @@
<div class="ha-letterhead"> <div class="ha-letterhead">
@if (!Model.Compact) { @if (!Model.Compact) {
<div class="ha-letternumber"> <div class="ha-letternumber">
<div class="ha-letternumberinline"> <div class="ha-letternumberinline">
@Model.Letter.Meta.Autopsic @Model.Letter.Meta.Autopsic
</div>
</div> </div>
</div>
} }
@if (Model.Letter.HasText) { @if (Model.Letter.HasText) {
<div class="ha-metadata"> <div class="ha-metadata">
<div class="ha-metadataupperrow"> <div class="ha-metadataupperrow">
<div class="ha-metadatadate"> <div class="ha-metadatadate">
@Model.Letter.Meta.Date @Model.Letter.Meta.Date
@@ -39,23 +39,23 @@
} }
else { else {
<div class="ha-metadatastrike"> <div class="ha-metadatastrike">
<span>[Fälschlich in ZH aufgenommen]</span> <span>[Fälschlich in ZH aufgenommen]</span>
@if (!Model.Compact && Model.ShowZHData) { @if (!Model.Compact && Model.ShowZHData) {
@if (Model.Letter.ParsedZHString != null && Model.ShowZHData) { @if (Model.Letter.ParsedZHString != null && Model.ShowZHData) {
<div class="ha-tooltip"> <div class="ha-tooltip">
<div class="ha-pill"> <div class="ha-pill">
<span>@Html.Raw(Model.Letter.ParsedZHString)</span> <span>@Html.Raw(Model.Letter.ParsedZHString)</span>
</div> </div>
</div> </div>
} }
else if (Model.Letter.ParsedZHString == null) { else if (Model.Letter.ParsedZHString == null) {
<div class="ha-tooltip"> <div class="ha-tooltip">
<div class="ha-pill ha-newpill"> <div class="ha-pill ha-newpill">
<span>Neu</span> <span>Neu</span>
</div> </div>
</div> </div>
} }
} }
</div> </div>
} }
</div> </div>

View File

@@ -19,6 +19,6 @@
"StoredPDFPathLinux": "", "StoredPDFPathLinux": "",
"FileSizeLimit": 52428800, "FileSizeLimit": 52428800,
"AvailableStartYear": 1700, "AvailableStartYear": 1700,
"AvailableEndYear": 1784, "AvailableEndYear": 1800,
"LettersOnPage": 80 "LettersOnPage": 80
} }

View File

@@ -78,7 +78,7 @@
@apply w-full h-0 absolute right-0 top-1/2 @apply w-full h-0 absolute right-0 top-1/2
} }
.ha-letterhead .ha-metadata .ha-metadatarows .hametadatapersons { .ha-letterhead .ha-metadata .ha-metadatapersons a {
@apply flex leading-snug @apply hover:decoration-solid rounded decoration-dotted underline decoration-slate-400 hover:decoration-gray-600
} }
} }

File diff suppressed because one or more lines are too long