mirror of
				https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
				synced 2025-11-04 12:15:32 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			133 lines
		
	
	
		
			4.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			133 lines
		
	
	
		
			4.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
@model UploadViewModel;
 | 
						|
@{
 | 
						|
    ViewData["Title"] = "Upload & Veröffentlichen";
 | 
						|
    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-adminuploadfields" id="ha-adminuploadfields">
 | 
						|
  @foreach (var item in Model.AvailableRoots!.OrderBy(x => x.Type)) {
 | 
						|
      <a class="ha-uploadfield" asp-controller="Upload" asp-action="Index" asp-route-id="@item.Prefix">
 | 
						|
        <div class="ha-uploadfieldname">@item.Type</div>
 | 
						|
        @if (Model.UsedFiles != null && Model.UsedFiles.ContainsKey(item.Prefix)) {
 | 
						|
          <div class="ha-uploadusedfiles">
 | 
						|
          @foreach(var file in Model.UsedFiles[item.Prefix]!) {
 | 
						|
            @if (file == Model.UsedFiles[item.Prefix]!.Last())
 | 
						|
            {
 | 
						|
              <span class="ha-uploadusedfile">@file.FileName</span>
 | 
						|
            }
 | 
						|
            else
 | 
						|
            {
 | 
						|
              <span class="ha-uploadusedfile">@file.FileName;</span>
 | 
						|
            }
 | 
						|
          }
 | 
						|
          </div>
 | 
						|
        }
 | 
						|
        else {
 | 
						|
          <div class="ha-uploadusedfiles ha-uploadusedfilesnotfound">Keine Datei geladen!</div>
 | 
						|
        }
 | 
						|
      </a>
 | 
						|
  }
 | 
						|
 | 
						|
  <div class="ha-uploadpublishforms">
 | 
						|
    @await Html.PartialAsync("/Views/Shared/_UploadForm.cshtml", Model)
 | 
						|
 | 
						|
    <a class="ha-publishbutton" asp-controller="Upload" asp-action="Index" asp-route-id="@string.Empty">
 | 
						|
      <div class="ha-publishtext">Veröffentlichen</div>
 | 
						|
    </a>
 | 
						|
  </div>
 | 
						|
</div>
 | 
						|
 | 
						|
 | 
						|
<div class="ha-uploadheader">
 | 
						|
  <h1 class="ha-uploadtitle">@Model.ActiveTitle</h1>
 | 
						|
</div>
 | 
						|
 | 
						|
 | 
						|
<div class="ha-uploadcontainer">
 | 
						|
  @* File Category Page File List *@
 | 
						|
  @if (Model.AvailableFiles != null && Model.AvailableFiles.Any()) {
 | 
						|
    <div class="ha-filesheader">
 | 
						|
      <div class="ha-availablefiles" id="ha-availablefiles">
 | 
						|
        <div class="ha-availablefilestitle">Datei(en)</div>
 | 
						|
          @if(Model.UsedFiles != null && Model.UsedFiles.ContainsKey(Model.Prefix)) {
 | 
						|
            <div class="ha-usedfilelist">
 | 
						|
            @foreach (var item in Model.UsedFiles[Model.Prefix]!)
 | 
						|
            {
 | 
						|
              if(item == Model.UsedFiles[Model.Prefix]!.Last()) {
 | 
						|
                <span class="ha-usedfile">@item.FileName</span>
 | 
						|
              }
 | 
						|
              else {
 | 
						|
                <span class="ha-usedfile">@item.FileName,</span>
 | 
						|
              }
 | 
						|
            }
 | 
						|
            </div>
 | 
						|
          }
 | 
						|
      </div>
 | 
						|
      <div class="ha-availablefileslist hidden" id="ha-availablefileslist">
 | 
						|
          @await Html.PartialAsync("/Views/Shared/_FileListForm.cshtml", (Model.AvailableFiles, "Verfügbare Dateien", "API", "SetUsed", Model.Prefix, "/Download/XML/" + Model.Prefix + "/", true))
 | 
						|
      </div>
 | 
						|
    </div>
 | 
						|
    
 | 
						|
    @if (Model.UsedFiles != null && Model.Prefix != null && Model.UsedFiles.ContainsKey(Model.Prefix)) {
 | 
						|
      <div class="ha-errorswarnings">
 | 
						|
        <div class="ha-criticalerrors">
 | 
						|
 | 
						|
        </div>
 | 
						|
        <div class="ha-warnings">
 | 
						|
          
 | 
						|
        </div>
 | 
						|
      </div>
 | 
						|
 | 
						|
      <div class="ha-crossfilechecking">
 | 
						|
        
 | 
						|
      </div>
 | 
						|
    }
 | 
						|
  }
 | 
						|
 | 
						|
 | 
						|
  @* Start Page File List *@
 | 
						|
  else {
 | 
						|
    <div class="ha-publishfilelist">
 | 
						|
      @await Html.PartialAsync("/Views/Shared/_PublishForm.cshtml", Model)
 | 
						|
    </div>
 | 
						|
 | 
						|
    <div class="ha-hamannfilechooser">
 | 
						|
      @await Html.PartialAsync("/Views/Shared/_FileListForm.cshtml", (Model.HamannFiles, "Verfügbare Hamann-Dateien", "API", "SetUsedHamann", string.Empty, "/Download/XML/", false))
 | 
						|
    </div>
 | 
						|
  }
 | 
						|
 | 
						|
</div>
 | 
						|
 | 
						|
@section Scripts {
 | 
						|
  <script>
 | 
						|
    "use strict";
 | 
						|
    const hideshowfiles = function() {
 | 
						|
      let elem = document.getElementById("ha-availablefileslist");
 | 
						|
      if (elem.classList.contains('hidden')) {
 | 
						|
        
 | 
						|
        elem.classList.remove('hidden');
 | 
						|
        elem.classList.add('block');
 | 
						|
      }
 | 
						|
      else {
 | 
						|
        elem.classList.add('hidden');
 | 
						|
        elem.classList.remove('block');
 | 
						|
      }
 | 
						|
    }
 | 
						|
 | 
						|
    function getCookie(name) {
 | 
						|
      var value = "; " + document.cookie;
 | 
						|
      var parts = value.split("; " + name + "=");
 | 
						|
      if (parts.length == 2) return parts.pop().split(";").shift();
 | 
						|
    }
 | 
						|
 | 
						|
    window.addEventListener("load", function () {
 | 
						|
      var filesbutton = document.getElementById("ha-availablefiles");
 | 
						|
      if (filesbutton !== null)
 | 
						|
        filesbutton.addEventListener("click", () => hideshowfiles());
 | 
						|
    });
 | 
						|
 | 
						|
    
 | 
						|
  </script>
 | 
						|
}
 |