mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-29 09:15:33 +00:00
Search Page Adjustments
This commit is contained in:
@@ -11,8 +11,6 @@ public class IndexViewModel {
|
||||
public List<(string Volume, List<string> Pages)>? AvailablePages { get; private set; }
|
||||
public string? ActiveVolume { get; private set; }
|
||||
public string? ActivePage { get; private set; }
|
||||
public string? ActiveSearch { get; private set; }
|
||||
public Dictionary<string, List<SearchResult>>? SearchResults { get; private set; }
|
||||
|
||||
public IndexViewModel(
|
||||
List<(int Year, List<BriefeMetaViewModel> LetterList)>? letters,
|
||||
@@ -21,9 +19,7 @@ public class IndexViewModel {
|
||||
List<(string Key, string Name)>? availablePersons,
|
||||
List<(string Volume, List<string> Pages)>? availablePages,
|
||||
string? activeVolume,
|
||||
string? activePage,
|
||||
string? activeSearch,
|
||||
Dictionary<string, List<SearchResult>>? searchResults
|
||||
string? activePage
|
||||
) {
|
||||
Letters = letters;
|
||||
if (letters != null)
|
||||
@@ -36,7 +32,5 @@ public class IndexViewModel {
|
||||
AvailablePages = availablePages;
|
||||
ActiveVolume = activeVolume;
|
||||
ActivePage = activePage;
|
||||
ActiveSearch = activeSearch;
|
||||
SearchResults = searchResults;
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,8 @@ public class SearchResult {
|
||||
public string Index { get; private set; }
|
||||
public string? Page { get; set; }
|
||||
public string? Line { get; set; }
|
||||
public string? Lemma { get; set; }
|
||||
public string? Link { get; set; }
|
||||
public string? Preview { get; set; }
|
||||
// TODO:
|
||||
public string? ParsedPreview { get; set; }
|
||||
|
||||
@@ -1,41 +1,48 @@
|
||||
namespace HaWeb.Models;
|
||||
using HaDocument.Models;
|
||||
|
||||
public enum SearchType {
|
||||
Letter,
|
||||
Register,
|
||||
Marginals
|
||||
}
|
||||
|
||||
public enum SearchResultType {
|
||||
Success,
|
||||
OutOfBounds,
|
||||
NotFound,
|
||||
InvalidSearchTerm
|
||||
}
|
||||
|
||||
public class SucheViewModel {
|
||||
public List<(int Year, List<BriefeMetaViewModel> LetterList)>? Letters { get; private set; }
|
||||
public int Count { get; private set; }
|
||||
public int ActiveYear { get; private set; }
|
||||
public List<(int StartYear, int EndYear)>? AvailableYears { get; private set; }
|
||||
public string? ActivePerson { get; set; }
|
||||
public List<(string Key, string Name)>? AvailablePersons { get; private set; }
|
||||
public List<(string Volume, List<string> Pages)>? AvailablePages { get; private set; }
|
||||
public string? ActiveVolume { get; private set; }
|
||||
public string? ActivePage { get; private set; }
|
||||
public string? ActiveSearch { get; private set; }
|
||||
public int ActivePage { get; private set; }
|
||||
public List<string>? AvailablePages { get; private set; }
|
||||
public string ActiveSearch { get; private set; }
|
||||
public Dictionary<string, List<SearchResult>>? SearchResults { get; private set; }
|
||||
public SearchResultType SearchResultType { get; private set; }
|
||||
public SearchType SearchType { get; private set; }
|
||||
|
||||
public SucheViewModel(
|
||||
List<(int Year, List<BriefeMetaViewModel> LetterList)>? letters,
|
||||
int activeYear,
|
||||
List<(int StartYear, int EndYear)>? availableYears,
|
||||
List<(string Key, string Name)>? availablePersons,
|
||||
List<(string Volume, List<string> Pages)>? availablePages,
|
||||
string? activeVolume,
|
||||
string? activePage,
|
||||
string? activeSearch,
|
||||
Dictionary<string, List<SearchResult>>? searchResults
|
||||
SearchType searchType,
|
||||
SearchResultType searchResultType,
|
||||
int activePage,
|
||||
List<string>? availablePages,
|
||||
string activeSearch,
|
||||
Dictionary<string, List<SearchResult>>? searchResults,
|
||||
List<(int Year, List<BriefeMetaViewModel> LetterList)>? letters
|
||||
) {
|
||||
Letters = letters;
|
||||
if (letters != null)
|
||||
Count = letters.Select(x => x.LetterList.Count).Aggregate(0, (x, y) => { x += y; return x; });
|
||||
else
|
||||
Count = 0;
|
||||
ActiveYear = activeYear;
|
||||
AvailableYears = availableYears;
|
||||
AvailablePersons = availablePersons;
|
||||
AvailablePages = availablePages;
|
||||
ActiveVolume = activeVolume;
|
||||
|
||||
SearchType = searchType;
|
||||
SearchResultType = searchResultType;
|
||||
ActivePage = activePage;
|
||||
AvailablePages = availablePages;
|
||||
ActiveSearch = activeSearch;
|
||||
SearchResults = searchResults;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user