Vorbereitung zur Veröffentlichung I: Letzter Stand auf Startseite

This commit is contained in:
Simon Martens
2023-02-21 15:54:50 +01:00
parent b72637baa4
commit 99693b0c1d
6 changed files with 1698 additions and 6058 deletions

View File

@@ -15,12 +15,14 @@ public class IndexController : Controller {
private IReaderService _readerService;
private IXMLService _xmlService;
private int _lettersForPage;
private int _endYear;
public IndexController(IHaDocumentWrappper lib, IReaderService readerService, IXMLService service, IConfiguration config) {
_lib = lib;
_readerService = readerService;
_xmlService = service;
_lettersForPage = config.GetValue<int>("LettersOnPage");
_endYear = config.GetValue<int>("AvailableEndYear");
}
[Route("/HKB/{letterno}")]
@@ -142,9 +144,13 @@ public class IndexController : Controller {
List<(string Volume, List<string> Pages)>? availablePages = null;
availablePages = lib.Structure.Where(x => x.Key != "-1").Select(x => (x.Key, x.Value.Select(x => x.Key).ToList())).ToList();
zhvolume = zhvolume == null ? "1" : zhvolume;
var lastletter = lib.MetasByDate.Last();
var model = new IndexViewModel(
letters,
page,
_endYear.ToString(),
"ZH " + HTMLHelpers.ConversionHelpers.ToRoman(Int32.Parse(lastletter.ZH.Volume)) + ", S. " + lastletter.ZH.Page,
pages,
_getAvailablePersons(lib),
availablePages.OrderBy(x => x.Volume).ToList(),

File diff suppressed because it is too large Load Diff

View File

@@ -12,9 +12,15 @@ public class IndexViewModel {
public string? ActiveVolume { get; private set; }
public string? ActivePage { get; private set; }
public string EndYear { get; private set; }
public string EndPageString { get; private set; }
public IndexViewModel(
List<(int Year, List<BriefeMetaViewModel> LetterList)>? letters,
int activeYear,
string endYear,
string endPageString,
List<(int StartYear, int EndYear)>? availableYears,
List<(string Key, string Name)>? availablePersons,
List<(string Volume, List<string> Pages)>? availablePages,
@@ -34,5 +40,7 @@ public class IndexViewModel {
ActiveVolume = activeVolume;
ActivePage = activePage;
ActivePerson = activePerson;
EndYear = endYear;
EndPageString = endPageString;
}
}

View File

@@ -48,6 +48,7 @@
<div class="ha-filterlist">
@* Go To Letter *@
<div class="ha-gotofilter">
<div class="ha-filtertitle">H&hairsp;K&hairsp;B</div>
@@ -71,6 +72,9 @@
<a class="ha-reversefilter" asp-controller="Index" asp-action="Index">← Auswahl aufheben</a>
</div>
}
</div>
<div class="mr-2 leading-snug text-base px-1 bg-slate-200">
Derzeit kritisch geprüft, ediert und hochgeladen sind Briefe bis einschließlich @Model.EndYear (= @Model.EndPageString).
</div>
<form class="ha-zhform" id="ha-zhform">
<span>Z&hairsp;H Band</span>
@@ -83,6 +87,7 @@
<input name="zhpage" id="ha-zhformpage" type="text" value="@Model.ActivePage" placeholder="Seite"/>
<button id="ha-zhformsubmit" type="submit">Nachschlagen</button>
</form>
</div>
}

View File

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

File diff suppressed because one or more lines are too long