Added pills, but not for ZH

This commit is contained in:
schnulller
2022-05-22 06:40:55 +02:00
parent 8179ea6e68
commit 45b5999981
9 changed files with 328 additions and 21 deletions

View File

@@ -53,9 +53,11 @@ public class Briefecontroller : Controller
ViewData["Filename"] = "HKB_" + meta.Autopsic + ".pdf"; ViewData["Filename"] = "HKB_" + meta.Autopsic + ".pdf";
// Model creation // Model creation
var model = new BriefeViewModel(this.id, index, generateMetaViewModel(meta)); var hasMarginals = false;
if (nextmeta != null) model.MetaData.Next = (generateMetaViewModel(nextmeta), url + nextmeta.Autopsic); if (marginals != null && marginals.Any()) hasMarginals = true;
if (prevmeta != null) model.MetaData.Prev = (generateMetaViewModel(prevmeta), url + prevmeta.Autopsic); var model = new BriefeViewModel(this.id, index, generateMetaViewModel(meta, hasMarginals));
if (nextmeta != null) model.MetaData.Next = (generateMetaViewModel(nextmeta, false), url + nextmeta.Autopsic);
if (prevmeta != null) model.MetaData.Prev = (generateMetaViewModel(prevmeta, false), url + prevmeta.Autopsic);
if (hands != null && hands.Any()) model.ParsedHands = HaWeb.HTMLHelpers.BriefeHelpers.CreateHands(_lib, hands); if (hands != null && hands.Any()) model.ParsedHands = HaWeb.HTMLHelpers.BriefeHelpers.CreateHands(_lib, hands);
if (editreasons != null && editreasons.Any()) model.ParsedEdits = HaWeb.HTMLHelpers.BriefeHelpers.CreateEdits(_lib, _readerService, editreasons); if (editreasons != null && editreasons.Any()) model.ParsedEdits = HaWeb.HTMLHelpers.BriefeHelpers.CreateEdits(_lib, _readerService, editreasons);
if (tradition != null && !String.IsNullOrWhiteSpace(tradition.Element)) model.ParsedTradition = HaWeb.HTMLHelpers.BriefeHelpers.CreateTraditions(_lib, _readerService, marginals, tradition); if (tradition != null && !String.IsNullOrWhiteSpace(tradition.Element)) model.ParsedTradition = HaWeb.HTMLHelpers.BriefeHelpers.CreateTraditions(_lib, _readerService, marginals, tradition);
@@ -71,11 +73,11 @@ public class Briefecontroller : Controller
return Redirect("/Error404"); return Redirect("/Error404");
} }
private BriefeMetaViewModel generateMetaViewModel(Meta meta) private BriefeMetaViewModel generateMetaViewModel(Meta meta, bool hasMarginals)
{ {
var senders = meta.Senders.Select(x => _lib.Persons[x].Name) ?? new List<string>(); var senders = meta.Senders.Select(x => _lib.Persons[x].Name) ?? new List<string>();
var recivers = meta.Receivers.Select(x => _lib.Persons[x].Name) ?? new List<string>(); var recivers = meta.Receivers.Select(x => _lib.Persons[x].Name) ?? new List<string>();
return new BriefeMetaViewModel(meta) return new BriefeMetaViewModel(meta, hasMarginals)
{ {
ParsedSenders = HTMLHelpers.StringHelpers.GetEnumerationString(senders), ParsedSenders = HTMLHelpers.StringHelpers.GetEnumerationString(senders),
ParsedReceivers = HTMLHelpers.StringHelpers.GetEnumerationString(recivers) ParsedReceivers = HTMLHelpers.StringHelpers.GetEnumerationString(recivers)

View File

@@ -4,18 +4,19 @@ using HaDocument.Models;
public class BriefeMetaViewModel public class BriefeMetaViewModel
{ {
public Meta Meta { get; private set; } public Meta Meta { get; private set; }
public bool ShowSurroundingLetterLinks { get; private set; } public bool HasMarginals { get; private set; }
public bool ShowPDFButton { get; private set; }
public string? ParsedSenders { get; set; } public string? ParsedSenders { get; set; }
public string? ParsedReceivers { get; set; } public string? ParsedReceivers { get; set; }
public string? ParsedZHString { get; set; }
public (BriefeMetaViewModel, string)? Next { get; set; } public (BriefeMetaViewModel, string)? Next { get; set; }
public (BriefeMetaViewModel, string)? Prev { get; set; } public (BriefeMetaViewModel, string)? Prev { get; set; }
public BriefeMetaViewModel(Meta meta) public BriefeMetaViewModel(Meta meta, bool hasMarginals)
{ {
Meta = meta; Meta = meta;
HasMarginals = hasMarginals;
} }
} }

View File

@@ -8,6 +8,7 @@ Veränderungenen in der Funktionalität für den Benutzer
- Suche im Brieftext wird gefixt - Suche im Brieftext wird gefixt
- Seite wird zugänglich für Menschen mit eingeschränktem Sehvermögen / Screenreadern - Seite wird zugänglich für Menschen mit eingeschränktem Sehvermögen / Screenreadern
- Bibellinks in Bibelkommentaren
Veränderungen in der Funktionalität für die Forscher Veränderungen in der Funktionalität für die Forscher
- Online-Syntaxcheck für XML-Dateien - Online-Syntaxcheck für XML-Dateien
@@ -23,4 +24,7 @@ Veränderungen im Code
- Auslagerungen einzelner Einstellungen in Einstellungsdateien - Auslagerungen einzelner Einstellungen in Einstellungsdateien
- Code open source zugänglich machen? - Code open source zugänglich machen?
Für diese Anpassungen sind in etwa 3-4 Monate eingeplant. Für diese Anpassungen sind in etwa 3-4 Monate eingeplant.
- Ladezeiten (???)
- PDF-Parser

View File

@@ -4,8 +4,8 @@
@await Html.PartialAsync("/Views/Shared/_LetterHead.cshtml", Model.MetaData) @await Html.PartialAsync("/Views/Shared/_LetterHead.cshtml", Model.MetaData)
<div class="ha-letterheadernav"> <div class="ha-letterheadernav">
<div class="ha-lettertabs"> <div class="ha-lettertabs">
<a class="active">Brieftext</a> <a class="active" id="ha-lettertextbtn">Brieftext</a>
<a class="">Überlieferung & Textkritik</a> <a class="" id="ha-additionsbtn">Überlieferung & Textkritik</a>
<a class="">PDF</a> <a class="">PDF</a>
</div> </div>
@@ -23,18 +23,28 @@
<a href="@Model.MetaData.Next.Value.Item2"> <a href="@Model.MetaData.Next.Value.Item2">
▶ @Model.MetaData.Next.Value.Item1.Meta.Autopsic ▶ @Model.MetaData.Next.Value.Item1.Meta.Autopsic
</a> </a>
} }
</div> </div>
} }
</div> </div>
</div> </div>
<div class="ha-letterbody"> <div class="ha-letterbody">
<div class="ha-lettertext"> <div class="ha-lettertext" id="ha-lettertext">
@if (Model.ParsedText != null) { @if (Model.ParsedText != null) {
@Html.Raw(@Model.ParsedText) @Html.Raw(@Model.ParsedText)
} }
</div> </div>
<div class="ha-additions" id="ha-additions">
@if (Model.ParsedTradition != null) {
@Html.Raw(Model.ParsedTradition)
}
@if (Model.ParsedEdits != null) {
@foreach (var edit in Model.ParsedEdits) {
@Html.Raw(edit)
}
}
</div>
</div> </div>

View File

@@ -8,11 +8,77 @@
</div> </div>
<div class="ha-metadata"> <div class="ha-metadata">
<div class="ha-metadatarows"> <div class="ha-metadatarows">
<div class="ha-metadatadate"> <div class="ha-metadataupperrow">
@Model.Meta.Date <div class="ha-metadatadate">
@Model.Meta.Date
</div>
@if (Model.Meta.hasOriginal != HaDocument.Models.OptionalBool.True) {
<div class="ha-tooltip">
<div class="ha-pill">
<span class="ha-cross">Orig</span>
</div>
<div class="ha-tooltiptext">
Original verschollen
</div>
</div>
}
else {
<div class="ha-tooltip">
<div class="ha-pill">
Orig
</div>
<div class="ha-tooltiptext">
Original vorhanden
</div>
</div>
}
@if (Model.Meta.isProofread != HaDocument.Models.OptionalBool.True) {
<div class="ha-tooltip">
<div class="ha-pill">
<span class="ha-cross">geprüft</span>
</div>
<div class="ha-tooltiptext">
Nicht textkritisch geprüft
</div>
</div>
}
else {
<div class="ha-tooltip">
<div class="ha-pill">
geprüft
</div>
<div class="ha-tooltiptext">
Textkritisch geprüft
</div>
</div>
}
@if (Model.HasMarginals) {
<div class="ha-tooltip">
<div class="ha-pill">
Komm
</div>
<div class="ha-tooltiptext">
Mit Stellenkommentar
</div>
</div>
}
</div> </div>
<div class="ha-metadatapersons"> <div class="ha-metadatapersons">
@Model.ParsedSenders → @Model.ParsedReceivers @if (Model.Meta.isDraft == HaDocument.Models.OptionalBool.True) {
<span>@Model.ParsedSenders</span>
<div class="ha-tooltip">
<div class="ha-tooltiptext">
Entwurf
</div>
</div>
<span>@Model.ParsedReceivers</span>
}
else {
<span>@Model.ParsedSenders → @Model.ParsedReceivers</span>
}
</div> </div>
</div> </div>
</div> </div>

View File

@@ -1,4 +1,5 @@
@using HaWeb @using HaWeb
@using HaWeb.Models @using HaWeb.Models
@using HaWeb.Settings @using HaWeb.Settings
@using HaDocument.Models
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

View File

@@ -1068,13 +1068,84 @@ body {
flex-direction: column; flex-direction: column;
} }
.ha-letterhead .ha-metadata .ha-metadatarows .ha-metadatadate { .ha-letterhead .ha-metadata .ha-metadataupperrow {
display: flex; display: flex;
flex-direction: row;
line-height: 1.375; line-height: 1.375;
}
.ha-letterhead .ha-metadata .ha-metadatarows .ha-metadataupperrow .ha-metadatadate {
display: flex;
font-variant-numeric: oldstyle-nums; font-variant-numeric: oldstyle-nums;
font-variant-caps: petite-caps; font-variant-caps: petite-caps;
} }
.ha-letterhead .ha-metadata .ha-tooltip {
position: relative;
display: inline-block;
cursor: default;
align-self: center;
}
.ha-letterhead .ha-metadata .ha-tooltiptext {
position: absolute;
z-index: 10;
border-radius: 0.25rem;
--tw-bg-opacity: 1;
background-color: rgb(241 245 249 / var(--tw-bg-opacity));
padding-left: 0.25rem;
padding-right: 0.25rem;
padding-top: 0.125rem;
padding-bottom: 0.125rem;
text-align: center;
font-size: 0.875rem;
line-height: 1.25rem;
--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.ha-letterhead .ha-metadata .ha-tooltiptext::after {
position: absolute;
top: 100%;
left: 50%;
}
.ha-letterhead .ha-metadata .ha-metadataupperrow .ha-pill {
margin-left: 0.5rem;
border-radius: 0.25rem;
--tw-bg-opacity: 1;
background-color: rgb(241 245 249 / var(--tw-bg-opacity));
padding-left: 0.5rem;
padding-right: 0.5rem;
padding-top: 0.1rem;
padding-bottom: 0.1rem;
font-size: 0.75rem;
line-height: 1rem;
--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.ha-letterhead .ha-metadata .ha-metadataupperrow .ha-pill .ha-cross {
position: relative;
display: inline-block;
}
.ha-letterhead .ha-metadata .ha-metadataupperrow .ha-pill .ha-cross::before {
border-bottom-width: 2px;
--tw-border-opacity: 1;
border-color: rgb(75 85 99 / var(--tw-border-opacity));
}
.ha-letterhead .ha-metadata .ha-metadataupperrow .ha-pill .ha-cross::before, .ha-letterhead .ha-metadata .ha-metadataupperrow .ha-pill .ha-cross::after {
position: absolute;
right: 0px;
top: 50%;
height: 0px;
width: 100%;
}
.ha-letterhead .ha-metadata .ha-metadatarows .hametadatapersons { .ha-letterhead .ha-metadata .ha-metadatarows .hametadatapersons {
display: flex; display: flex;
line-height: 1.375; line-height: 1.375;
@@ -1115,6 +1186,7 @@ body {
.ha-letterheader .ha-lettertabs a { .ha-letterheader .ha-lettertabs a {
margin-right: 0.25rem; margin-right: 0.25rem;
display: inline-block; display: inline-block;
cursor: pointer;
padding-left: 0.25rem; padding-left: 0.25rem;
padding-right: 0.25rem; padding-right: 0.25rem;
--tw-text-opacity: 1; --tw-text-opacity: 1;
@@ -1133,6 +1205,7 @@ body {
} }
.ha-letterheader .ha-lettertabs a.active { .ha-letterheader .ha-lettertabs a.active {
pointer-events: none;
border-bottom-width: 2px; border-bottom-width: 2px;
--tw-border-opacity: 1; --tw-border-opacity: 1;
border-color: rgb(226 232 240 / var(--tw-border-opacity)); border-color: rgb(226 232 240 / var(--tw-border-opacity));
@@ -1191,6 +1264,10 @@ body {
line-height: 1.48; line-height: 1.48;
} }
.hide {
display: none;
}
.ha-lettertext div { .ha-lettertext div {
display: inline; display: inline;
} }
@@ -2081,6 +2158,32 @@ body {
color:#000000; color:#000000;
} }
.ha-tooltip .ha-tooltiptext {
visibility: hidden;
width: 160px;
bottom: 155%;
left: 50%;
margin-left: -80px;
opacity: 0;
transition: opacity 0.3s;
}
.ha-tooltip .ha-tooltiptext::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: rgb(226 232 240 / var(--tw-bg-opacity)) transparent transparent transparent;
}
.ha-tooltip:hover .ha-tooltiptext {
visibility: visible;
opacity: 1;
}
.ha-open-btn-collapsed-box::before { .ha-open-btn-collapsed-box::before {
content: '\200E+'; content: '\200E+';
font-weight: 900; font-weight: 900;
@@ -2664,6 +2767,15 @@ body {
min-width: 8.333%; min-width: 8.333%;
} }
.ha-cross::before, .ha-cross::after {
content: '';
top: 50%;
}
.ha-cross::before {
transform: skewY(-27deg);
}
/* Not possible otherwise, overwrites javascript set style values, which cant be defined before render */ /* Not possible otherwise, overwrites javascript set style values, which cant be defined before render */
/* @media (max-width: 1190px) { /* @media (max-width: 1190px) {

View File

@@ -327,14 +327,52 @@
@apply flex flex-col @apply flex flex-col
} }
.ha-letterhead .ha-metadata .ha-metadatarows .ha-metadatadate { .ha-letterhead .ha-metadata .ha-metadataupperrow {
@apply flex caps-petite leading-snug numeric-mediaeval @apply flex flex-row leading-snug
}
.strikethrough {
@apply line-through
}
.ha-letterhead .ha-metadata .ha-metadatarows .ha-metadataupperrow .ha-metadatadate {
@apply flex caps-petite numeric-mediaeval
}
.ha-letterhead .ha-metadata .ha-tooltip {
@apply self-center cursor-default inline-block relative
}
.ha-letterhead .ha-metadata .ha-tooltiptext {
@apply bg-slate-100 rounded text-sm px-1 py-0.5 absolute z-10 text-center shadow
}
.ha-letterhead .ha-metadata .ha-tooltiptext::after {
@apply absolute top-full left-1/2
}
.ha-letterhead .ha-metadata .ha-metadataupperrow .ha-pill {
@apply text-xs bg-slate-100 rounded px-2 ml-2 py-[0.1rem] shadow
}
.ha-letterhead .ha-metadata .ha-metadataupperrow .ha-pill .ha-cross {
@apply relative inline-block
}
.ha-letterhead .ha-metadata .ha-metadataupperrow .ha-pill .ha-cross::before {
@apply border-b-2 border-gray-600
}
.ha-letterhead .ha-metadata .ha-metadataupperrow .ha-pill .ha-cross::before,
.ha-letterhead .ha-metadata .ha-metadataupperrow .ha-pill .ha-cross::after {
@apply w-full h-0 absolute right-0 top-1/2
} }
.ha-letterhead .ha-metadata .ha-metadatarows .hametadatapersons { .ha-letterhead .ha-metadata .ha-metadatarows .hametadatapersons {
@apply flex leading-snug @apply flex leading-snug
} }
/* Classes for Letter View */ /* Classes for Letter View */
.ha-letterheader { .ha-letterheader {
@@ -350,11 +388,11 @@
} }
.ha-letterheader .ha-lettertabs a { .ha-letterheader .ha-lettertabs a {
@apply inline-block px-1 mr-1 md:mr-3 text-slate-700 hover:text-slate-900 @apply inline-block px-1 mr-1 md:mr-3 text-slate-700 hover:text-slate-900 cursor-pointer
} }
.ha-letterheader .ha-lettertabs a.active { .ha-letterheader .ha-lettertabs a.active {
@apply border-b-2 border-slate-200 text-hamannHighlight @apply pointer-events-none border-b-2 border-slate-200 text-hamannHighlight
} }
.ha-letterheader .ha-lettertabs a:first { .ha-letterheader .ha-lettertabs a:first {
@@ -381,6 +419,10 @@
@apply shrink-0 border-l-2 ml-12 px-4 pt-4 relative font-serif leading-[1.48] pb-7 bg-slate-50 @apply shrink-0 border-l-2 ml-12 px-4 pt-4 relative font-serif leading-[1.48] pb-7 bg-slate-50
} }
.hide {
@apply hidden
}
.ha-rightsidebar { .ha-rightsidebar {
@apply shrink-0 grow basis-1/3 @apply shrink-0 grow basis-1/3
} }
@@ -764,6 +806,33 @@ body {
color:#000000; color:#000000;
} }
.ha-tooltip .ha-tooltiptext {
visibility: hidden;
width: 160px;
bottom: 155%;
left: 50%;
margin-left: -80px;
opacity: 0;
transition: opacity 0.3s;
}
.ha-tooltip .ha-tooltiptext::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: rgb(226 232 240 / var(--tw-bg-opacity)) transparent transparent transparent;
}
.ha-tooltip:hover .ha-tooltiptext {
visibility: visible;
opacity: 1;
}
.ha-open-btn-collapsed-box::before { .ha-open-btn-collapsed-box::before {
content: '\200E+'; content: '\200E+';
@@ -1348,6 +1417,15 @@ body {
} }
.ha-cross::before, .ha-cross::after {
content: '';
}
.ha-cross::before {
-webkit-transform: skewY(-27deg);
transform: skewY(-27deg);
}
/* Not possible otherwise, overwrites javascript set style values, which cant be defined before render */ /* Not possible otherwise, overwrites javascript set style values, which cant be defined before render */
/* @media (max-width: 1190px) { /* @media (max-width: 1190px) {

View File

@@ -155,6 +155,37 @@ const overlappingcollapsebox = function (selector, hoverfunction) {
} }
}; };
const showhidebutton = function (buttonid, prevbuttonid, hideid, showid, starthidden) {
let button = document.getElementById(buttonid);
let prevbtn = document.getElementById(prevbuttonid);
if (starthidden) {
let hiddenelement = document.getElementById(hideid);
let shownelement = document.getElementById(showid);
if (hiddenelement !== null) {
hiddenelement.classList.add("hide");
}
if (shownelement !== null) {
shownelement.classList.remove("hide");
}
prevbtn.classList.remove("active");
button.classList.add("active");
}
if(button !== null) {
button.addEventListener("click", function() {
let hiddenelement = document.getElementById(hideid);
let shownelement = document.getElementById(showid);
if (hiddenelement !== null) {
hiddenelement.classList.add("hide");
}
if (shownelement !== null) {
shownelement.classList.remove("hide");
}
prevbtn.classList.remove("active");
button.classList.add("active");
})
}
}
window.addEventListener("load", function () { window.addEventListener("load", function () {
if ( if (
document.getElementById("openmenubutton") != null && document.getElementById("openmenubutton") != null &&
@@ -174,4 +205,6 @@ window.addEventListener("load", function () {
overlappingcollapsebox(".ha-neuzeit .ha-letlinks", true); overlappingcollapsebox(".ha-neuzeit .ha-letlinks", true);
overlappingcollapsebox(".ha-forschung .ha-letlinks", true); overlappingcollapsebox(".ha-forschung .ha-letlinks", true);
overlappingcollapsebox(".ha-lettertext .ha-marginalbox", true); overlappingcollapsebox(".ha-lettertext .ha-marginalbox", true);
showhidebutton("ha-lettertextbtn", "ha-additionsbtn", "ha-additions", "ha-lettertext", true);
showhidebutton("ha-additionsbtn", "ha-lettertextbtn", "ha-lettertext", "ha-additions", false);
}); });