-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into rpb-225-fetchAndTrans…
…formHebis
- Loading branch information
Showing
28 changed files
with
251,707 additions
and
247,152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,5 @@ RPB-Export_HBZ_ZSS.txt | |
conf/RPBEXP/*.ZIP | ||
conf/strapi-export.tar.gz | ||
nohup.out* | ||
conf/*.ndjson | ||
conf/*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
@* Copyright 2014-2024 Fabian Steeg, hbz. Licensed under the GPLv2 *@ | ||
|
||
@(items: Map[String,List[String]], itemDetails: Map[String,String]) | ||
|
||
@import play.api.libs.ws.WS | ||
@import play.api.libs.json.JsArray | ||
@import play.api.libs.json.Json | ||
@import play.api.libs.json.JsValue | ||
@import scala.concurrent._ | ||
@import ExecutionContext.Implicits.global | ||
@import scala.concurrent.duration._ | ||
@import play.api.Play.current | ||
@import controllers.nwbib._ | ||
@import play.api.cache.Cache | ||
|
||
@string(value: JsValue) = { @value.asOpt[String].getOrElse("--") } | ||
|
||
<link rel="stylesheet" href="@controllers.routes.Assets.at("stylesheets/leaflet.css")" /> | ||
<script src="@controllers.routes.Assets.at("javascripts/leaflet.js")"></script> | ||
@*<script type="text/javascript" src="http://maps.stamen.com/js/tile.stamen.js?v1.2.4"></script>*@ | ||
<table class="table table-striped table-condensed"> | ||
<tr> | ||
<th style="width: 30%"/> | ||
<th style="width: 70%"/> | ||
</tr> | ||
</table> | ||
<p> | ||
<div class="items-map" id="items-map"></div> | ||
@map_credits() | ||
</p> | ||
<table style="display:none;" id="table" class="table table-striped table-condensed"> | ||
</table> | ||
@if(items.size > 1){<a href="#" style="text-decoration-line: underline; text-decoration-style: dotted;" onclick="$('#table').show(); $(this).hide()">Details zum Bestand als Liste anzeigen</a>} | ||
<script> | ||
var layer = L.tileLayer('https://lobid.org/tiles/{z}/{x}/{y}.png'); | ||
var rlp = new L.LatLng(49.7, 7.4) | ||
var map = new L.Map("items-map", { | ||
center: rlp, | ||
zoom: 7, | ||
maxZoom: 17, | ||
scrollWheelZoom: true, | ||
attributionControl: false, | ||
zoomControl: false | ||
}); | ||
new L.Control.Zoom({ position: 'bottomleft' }).addTo(map); | ||
var markerCount = 0; | ||
var tableDetails = ''; | ||
var allTableDetails = ''; | ||
var markers = {}; | ||
@markers(items) | ||
$('#table').append(allTableDetails); | ||
map.addLayer(layer); | ||
</script> | ||
|
||
@markers(items: Map[String,List[String]]) = { | ||
@for((key,i) <- items.keySet.toList.sortWith((k1:String,k2:String)=>Lobid.compareIsil(k1,k2)).zipWithIndex; | ||
owner = Application.CONFIG.getString("orgs.api")+"/"+key; | ||
json = Json.parse(Lobid.cachedJsonCall(owner).toString); | ||
ownerUrl = if((json\\"url").isEmpty) owner else (json\\"url")(0).as[String]; | ||
ownerName = if((json\\"name").isEmpty) "" else (json\\"name")(0).as[String]) { | ||
@for((itemId,i) <- items(key).zipWithIndex; | ||
shortItemId = itemId.substring(itemId.lastIndexOf(":") + 1, itemId.lastIndexOf("#")); | ||
itemJson = Json.parse(itemDetails(itemId)); | ||
owners = (itemJson\\"heldBy"); | ||
if(!owners.isEmpty); | ||
signatures = (itemJson\\"callNumber"); | ||
signature = if(signatures.isEmpty) "" else signatures(0).as[String]; | ||
urls = (itemJson\\"electronicLocator"); | ||
url = if(urls.isEmpty) "" else urls(0).as[String]; | ||
seeAlso = (itemJson\\"seeAlso"); | ||
opacLink = if(seeAlso.isEmpty) null else seeAlso(0).as[Seq[JsValue]].map(_.as[String])) { | ||
var details = '<tr><td><i>Bibliothek:</i></td><td>'+ | ||
'<i>@if(!ownerName.isEmpty){<a href="@ownerUrl">@ownerName</a>}else{<Keine Angabe>}</i></td></tr>' | ||
@if(opacLink!=null){+'<tr><td>Verfügbarkeit:</td>'+'<td><a href="@opacLink">Lokalen Katalog abfragen</a></td></tr>'}; | ||
tableDetails = details; | ||
if(allTableDetails=='') | ||
allTableDetails += tableDetails; | ||
else | ||
allTableDetails += '<tr><th style="width: 30%"/><th style="width: 70%"/></tr>' + tableDetails; | ||
var sig = '<tr><td>@if(!signature.isEmpty){Signatur:}@if(!urls.isEmpty){Elektronische Ressource:}</td>'+ | ||
'<td>@if(!url.isEmpty){<a href="@url">@shortItemId</a>} else {@if(!signature.isEmpty){@signature}}</td></tr>'; | ||
@for(noteSeq <- (itemJson\"note").asOpt[Seq[String]]; note = noteSeq(0)) {sig += '<tr><td>Notiz:</td><td>' + '@note' + '</td></tr>';} | ||
tableDetails += sig; | ||
allTableDetails += sig; | ||
} | ||
@if( | ||
!(json \\ "lon").isEmpty && (json \\ "lon").head.asOpt[String].isDefined && | ||
!(json \\ "lat").isEmpty && (json \\ "lat").head.asOpt[String].isDefined) { | ||
@defining(i) { id => | ||
var lat = @string((json \\ "lat").head) | ||
var lon = @string((json \\ "lon").head) | ||
var latlng@(id) = L.latLng(lat, lon); | ||
var icon@(id) = L.icon({ | ||
iconUrl: '@controllers.routes.Assets.at("javascripts/images/marker-icon-red.png")', | ||
iconSize: [20, 30], | ||
iconAnchor: [10, 30], | ||
popupAnchor: [0, -30] | ||
}); | ||
var marker@(id) = L.marker([lat, lon],{ | ||
title: "@ownerName (@key)", | ||
icon: icon@(id) | ||
}); | ||
markers[latlng@(id).toString()] = marker@(id); | ||
bindPopup@(id)(tableDetails); | ||
marker@(id).on('click', function(e) { | ||
zoomDetails@(id)(); | ||
}); | ||
marker@(id).on('popupclose', function(e) { | ||
map.setView(rlp, 7); | ||
}); | ||
marker@(id).addTo(map); | ||
markerCount++; | ||
if(@items.size == 1){ | ||
bindPopup@(id)(allTableDetails); | ||
zoomDetails@(id)(); | ||
} | ||
function zoomDetails@(id)() { | ||
map.setView(latlng@(id), 17); | ||
marker@(id).openPopup(); | ||
} | ||
function bindPopup@(id)(content) { | ||
marker@(id).bindPopup( | ||
'<table class="table-striped table-condensed">'+ | ||
content+ | ||
'</table>', | ||
{ | ||
keepInView: true, | ||
maxWidth: 250 | ||
}); | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.