From 5796c765f4e061a862ef6c6e33e5004c9045d210 Mon Sep 17 00:00:00 2001 From: TobiasNx Date: Thu, 5 Sep 2024 11:14:27 +0200 Subject: [PATCH] Use zbd or hbz id as lobidUri for linking #1992 --- web/app/views/tags/result_doc.scala.html | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/web/app/views/tags/result_doc.scala.html b/web/app/views/tags/result_doc.scala.html index 6efe6c325..74071d9d8 100644 --- a/web/app/views/tags/result_doc.scala.html +++ b/web/app/views/tags/result_doc.scala.html @@ -91,8 +91,11 @@ }}} } -@lobidUrl(doc: JsValue) = @{ - "http://lobid.org/resources/" + (doc\"almaMmsId").asOpt[String].orElse((doc\"hbzId").asOpt[String]).orElse((doc\"rpbId").asOpt[String]).getOrElse("") + "#!" +@lobidUrlWithHbzId(doc: JsValue) = @{ + "http://lobid.org/resources/" + ((doc\"hbzId").asOpt[String]).getOrElse("") + "#!" +} +@lobidUrlWithZdbId(doc: JsValue) = (doc: JsValue) = @{ + "http://lobid.org/resources/ZDB-" + (doc\"zdbId").asOpt[String].getOrElse("") + "#!" } @lobid2_part_of(field: String, subField: String) = { @@ -197,9 +200,13 @@ @result_field("In", "containedIn", doc, TableRow.LINKS) @lobid2_part_of("isPartOf", "hasSuperordinate") - @defining(lobidUrl(doc)){ id => - @subordinated("isPartOf.hasSuperordinate.id", id, "Bände", ("zugehöriger Band", "zugehörige Bände")) - @subordinated("containedIn.id", id, "Enthält", ("Beitrag", "Beiträge")) + @defining(lobidUrlWithZdbId(doc)){ id => + @subordinated("isPartOf.hasSuperordinate.id", id, "Bände", ("zugehöriger Band", "zugehörige Bände")) + @subordinated("containedIn.id", id, "Enthält", ("Beitrag", "Beiträge")) + } + @defining(lobidUrlWithHbzId(doc)){ id => + @subordinated("isPartOf.hasSuperordinate.id", id, "Bände", ("zugehöriger Band", "zugehörige Bände")) + @subordinated("containedIn.id", id, "Enthält", ("Beitrag", "Beiträge")) }