mirror of
				https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
				synced 2025-11-04 04:05:32 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			150 lines
		
	
	
		
			7.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			150 lines
		
	
	
		
			7.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
@model SucheViewModel;
 | 
						|
@{
 | 
						|
    ViewData["Title"] = "Briefauswahl & Suche";
 | 
						|
    ViewData["SEODescription"] = "Johann Georg Hamann: Kommentierte Briefausgabe, Hg. v. Leonard Keidel und Janina Reibold. Durchsuchbare Online-Ausgabe der Briefe von und an Johann Georg Hamann.";
 | 
						|
    ViewData["showCredits"] = "false";
 | 
						|
}
 | 
						|
 | 
						|
<div class="ha-search">
 | 
						|
    <div class="ha-searchhead">
 | 
						|
        <h1>Volltextsuche</h1>
 | 
						|
        <div class="ha-searchfilterinfo hyphenate"> 
 | 
						|
            Die Volltextsuche kann Brieftexte, Stellenkommentare, Forschungsbibliographie und Registereinträge über Seiten- und Zeilengrenzen hinweg durchsuchen. Angezeigt werden dabei exakte Übereinstimmungen mit dem Suchbegriff. Von dieser Regel ausgenommen sind Abweichungen in der Groß- und Kleinschreibung.
 | 
						|
        </div>
 | 
						|
        <div class="ha-searchfilter">
 | 
						|
        @if (Model.ActiveSearch != null) {
 | 
						|
        <div class="ha-activefilterinfo">
 | 
						|
            @if (Model.SearchType == "letters") {
 | 
						|
                <span><span class="">Briefe</span>, die »@Model.ActiveSearch« enthalten. </span><br>
 | 
						|
            }
 | 
						|
            @if (Model.SearchType == "register") {
 | 
						|
                @if (Model.ActivePage == 0) {
 | 
						|
                    <span><span class="">Registereinträge</span>, die »@Model.ActiveSearch« enthalten. </span><br>
 | 
						|
                    <a class="ha-reversefilter" asp-controller="Register" asp-action="Allgemein">← Registerübersicht</a><span> / </span>
 | 
						|
                } else {
 | 
						|
                    <span><span class="">Bibliografische Einträge</span>, die »@Model.ActiveSearch« enthalten. </span><br>
 | 
						|
                    <a class="ha-reversefilter" asp-controller="Register" asp-action="Forschung">← Forschungsbibliographie</a><span> / </span>
 | 
						|
                }
 | 
						|
            }
 | 
						|
            @if (Model.SearchType == "marginals") {
 | 
						|
                <span><span class="">Stellenkommentare</span>, die »@Model.ActiveSearch« enthalten. </span><br>
 | 
						|
            }
 | 
						|
            <a class="ha-reversefilter" asp-controller="Index" asp-action="Index">← Briefübersicht</a>
 | 
						|
        </div>
 | 
						|
        }
 | 
						|
 | 
						|
        <form class="ha-searchform" id="ha-searchform" asp-controller="Suche" asp-action="Index" method="get">
 | 
						|
            <input id="ha-searchformtext" name="search" type="text" placeholder="Suchbegriff" value="@Model.ActiveSearch"/>
 | 
						|
            <input type="hidden" name="category" type="text" value="@Model.SearchType"/>
 | 
						|
            <button id="ha-searchformsubmit" type="submit">Suchen</button>
 | 
						|
        </form>
 | 
						|
 | 
						|
        <div class="ha-alternativesearches">
 | 
						|
            @if (Model.SearchType != "letters") {
 | 
						|
                <a asp-controller="Suche" asp-action="index" asp-route-search="@Model.ActiveSearch" asp-route-category="letters">
 | 
						|
                    Stattdessen Briefe nach »@Model.ActiveSearch« durchsuchen →
 | 
						|
                </a>
 | 
						|
            }
 | 
						|
            @if (Model.SearchType != "register") {
 | 
						|
                <a asp-controller="Suche" asp-action="index" asp-route-search="@Model.ActiveSearch" asp-route-category="register">
 | 
						|
                    Stattdessen Register & Bibliographie nach »@Model.ActiveSearch« durchsuchen →
 | 
						|
                </a>
 | 
						|
            }
 | 
						|
            @if (Model.SearchType != "marginals") {
 | 
						|
                <a asp-controller="Suche" asp-action="index" asp-route-search="@Model.ActiveSearch" asp-route-category="marginals">
 | 
						|
                    Stattdessen Stellenkommentare nach »@Model.ActiveSearch« durchsuchen →
 | 
						|
                </a>
 | 
						|
            }
 | 
						|
        </div>
 | 
						|
        </div>
 | 
						|
        <script>
 | 
						|
            const ACTIVATESEARCHFILTER = function(filter, button) {
 | 
						|
                let f = filter.value;
 | 
						|
                if (f === "") {
 | 
						|
                    button.disabled = true;
 | 
						|
                    return;
 | 
						|
                }
 | 
						|
                button.disabled = false;
 | 
						|
            }
 | 
						|
 | 
						|
            window.addEventListener("load", () => {
 | 
						|
                let searchfilter = document.getElementById("ha-searchformtext");
 | 
						|
                let searchsubmitbtn = document.getElementById("ha-searchformsubmit");
 | 
						|
                let searchform = document.getElementById("ha-searchform");
 | 
						|
                ACTIVATESEARCHFILTER(searchfilter, searchsubmitbtn);
 | 
						|
                searchfilter.addEventListener("input", () => ACTIVATESEARCHFILTER(searchfilter, searchsubmitbtn));
 | 
						|
            });
 | 
						|
        </script>
 | 
						|
 | 
						|
        <div class="ha-searchnav">
 | 
						|
        @if (Model.AvailablePages != null && Model.AvailablePages.Any() && Model.AvailablePages.Count > 1) {
 | 
						|
            @for(var i = 0; i < Model.AvailablePages.Count; i++) {
 | 
						|
                <a class="@(Model.ActivePage == i ? "active" : "")"  asp-route-search="@Model.ActiveSearch" asp-controller="Suche" asp-route-page="@i" asp-route-category="@Model.SearchType">
 | 
						|
                    <span>
 | 
						|
                        @Model.AvailablePages[i]
 | 
						|
                    </span>
 | 
						|
                </a>
 | 
						|
            }
 | 
						|
        }
 | 
						|
        </div>
 | 
						|
    </div>
 | 
						|
 | 
						|
    <div class="ha-searchbody">
 | 
						|
        
 | 
						|
        @* Letter Search *@
 | 
						|
        @if (Model.Letters != null) {
 | 
						|
            <div class="ha-letterlist">
 | 
						|
            @foreach (var year in Model.Letters) {
 | 
						|
                foreach (var letter in year.LetterList) {
 | 
						|
                    <div class="ha-letterlistentry">
 | 
						|
                        <a asp-controller="Briefe" asp-action="Index" asp-route-id="@letter.Meta.Autopsic">
 | 
						|
                            @await Html.PartialAsync("/Views/Shared/_LetterHead.cshtml", (letter, true, false))
 | 
						|
                        </a>
 | 
						|
                        
 | 
						|
                        @if (Model.SearchResults != null && Model.SearchResults.ContainsKey(letter.Meta.Index)) {
 | 
						|
                        <div class="ha-letterlistsearchresults">
 | 
						|
                        @foreach (var sr in Model.SearchResults[letter.Meta.Index])
 | 
						|
                        {
 | 
						|
                            <a class="ha-letterlistsearchresult" asp-controller="Briefe" asp-action="Index" asp-route-id="@letter.Meta.Autopsic" asp-fragment="@sr.Page-@sr.Line">
 | 
						|
                                <div class="ha-searchresultlocation caps-allpetite">
 | 
						|
                                    HKB @sr.Page/@sr.Line</div><div class="ha-searchresultpreview">@sr.Preview
 | 
						|
                                </div>
 | 
						|
                            </a>
 | 
						|
                        }
 | 
						|
                        </div>
 | 
						|
                        }
 | 
						|
                    </div>
 | 
						|
                }
 | 
						|
            }
 | 
						|
            </div>
 | 
						|
        }
 | 
						|
 | 
						|
        @* Register Search *@
 | 
						|
        @if (Model.SearchType == "register" && Model.Comments != null && Model.Comments.Any()) {
 | 
						|
            <div class="ha-commentlist @(Model.ActivePage == 1 ? "ha-forschung" : "")">
 | 
						|
            @foreach (var k in Model.Comments) {
 | 
						|
                <div class="ha-comment">
 | 
						|
                    <div class="ha-headcomment">@Html.Raw(k.ParsedComment)</div>
 | 
						|
                    @if (k.ParsedSubComments != null ) {
 | 
						|
                        @foreach (var sk in k.ParsedSubComments) {
 | 
						|
                            <div class="ha-subcomment">@Html.Raw(sk)</div>
 | 
						|
                        }
 | 
						|
                    }
 | 
						|
                </div>
 | 
						|
            }
 | 
						|
            </div>
 | 
						|
        }
 | 
						|
 | 
						|
        @if (Model.SearchResultType == SearchResultType.NotFound) {
 | 
						|
             <div class="ha-commentlist">
 | 
						|
                Keine Treffer für »@Model.ActiveSearch«.
 | 
						|
             </div>
 | 
						|
        }
 | 
						|
 | 
						|
         @if (Model.SearchResultType == SearchResultType.InvalidSearchTerm) {
 | 
						|
            <div class="ha-commentlist">
 | 
						|
                »@Model.ActiveSearch« ist ein ungültiger Suchbegriff. Die Suche darf nicht leer sein und nicht ausschließlich aus Spatien bestehen.
 | 
						|
             </div>
 | 
						|
         }
 | 
						|
    </div>
 | 
						|
</div> |