Skip to content

Commit

Permalink
Merge pull request #2067 from hbz/1951-ISSNISBN
Browse files Browse the repository at this point in the history
Reuse nwbib fix for #1992, #1951 and  #1829
  • Loading branch information
TobiasNx authored Sep 11, 2024
2 parents 1f100be + fcf01f4 commit b828d09
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
21 changes: 14 additions & 7 deletions web/app/views/tags/result_doc.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -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) = @{
"http://lobid.org/resources/ZDB-" + (doc\"zdbId").asOpt[String].getOrElse("") + "#!"
}

@lobid2_part_of(field: String, subField: String) = {
Expand Down Expand Up @@ -188,18 +191,22 @@
@for(pub <- sortedPublications((doc\"publication").asOpt[Seq[JsValue]].getOrElse(Seq()))){ @publication(pub) }

@result_field("Auflage", "edition", doc, TableRow.VALUES)
@result_field("ISBN", "isbn", doc, TableRow.VALUES)
@result_field("ISSN", "issn", doc, TableRow.VALUES)
@result_field("ISBN", "isbn", doc, TableRow.VALUES, node = Option(doc))
@result_field("ISSN", "issn", doc, TableRow.VALUES, node = Option(doc))
@withPrefixedLink("DOI", "https://dx.doi.org/", doc \ "doi")
@withPrefixedLink("URN", "https://nbn-resolving.org/", doc \ "urn")
@result_field("Umfang", "extent", doc, TableRow.VALUES)
@result_field("Quelle", "bibliographicCitation", doc, TableRow.VALUES)
@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"))
}


Expand Down
7 changes: 4 additions & 3 deletions web/app/views/tags/result_field.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
@import java.util.Optional
@import controllers.resources.Lobid

@jsonVal(p: String) = @{ node match {
case Some(node) => node
case None => if ((doc \\ p).isEmpty) (doc \ p) else (doc \\ p).head
@jsonVal(p: String) = @{
node match {
case Some(node) => (node \ p).asOpt[JsValue].getOrElse(node \ p)
case None => if ((doc \\ p).isEmpty) (doc \ p) else (doc \\ p).head
}
}

Expand Down

0 comments on commit b828d09

Please sign in to comment.