From 64b9ca05e5a63ca6dac81787cc5bc09d8905ab24 Mon Sep 17 00:00:00 2001 From: Fabian Steeg Date: Tue, 23 Jan 2024 11:08:41 +0100 Subject: [PATCH 1/3] Fix ISBN and ISSN display: use top-level field, not nested (#636) --- app/views/tags/result_doc.scala.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/tags/result_doc.scala.html b/app/views/tags/result_doc.scala.html index 187353d..5854159 100644 --- a/app/views/tags/result_doc.scala.html +++ b/app/views/tags/result_doc.scala.html @@ -247,8 +247,8 @@ @result_field("Auflage", "edition", doc, TableRow.VALUES) @result_field("Inhalt", "abstract", doc, TableRow.VALUES) @result_field("Anmerkungen", "note", doc, TableRow.VALUES, node = Option(doc)) - @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) From 57b10179dd7dcb5f76e6bd0d9d16230c3876e885 Mon Sep 17 00:00:00 2001 From: Fabian Steeg Date: Tue, 23 Jan 2024 11:12:44 +0100 Subject: [PATCH 2/3] Show all `related` publications, with their ISBN and ISSN (#636) Previously, only those with `id` showed up, without other details --- app/views/tags/result_doc.scala.html | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/app/views/tags/result_doc.scala.html b/app/views/tags/result_doc.scala.html index 5854159..7efe6ca 100644 --- a/app/views/tags/result_doc.scala.html +++ b/app/views/tags/result_doc.scala.html @@ -212,12 +212,22 @@ @parallelausgabe() = { @for( related <- (doc \ "related").asOpt[Seq[JsValue]].getOrElse(Seq()); - id <- (related \ "id").asOpt[String]; - shortId = Lobid.shortId(id); - note <- (related \ "note").asOpt[Seq[String]]) { + id = (related \ "id").asOpt[String]; + shortId = Lobid.shortId(id.getOrElse("")); + note = (related \ "note").asOpt[Seq[String]]){ Parallelausgabe - @note + + @if(id.isDefined){ + @note.getOrElse(shortId) | + +
+ } else { + @optional("", "note", related) + } + @optional("", "isbn", related) + @optional("", "issn", related) + } } From 037db0856512a0c1dd4dff3ad411b6f3a41cd4a0 Mon Sep 17 00:00:00 2001 From: Fabian Steeg Date: Thu, 25 Jan 2024 11:41:49 +0100 Subject: [PATCH 3/3] Display label for `@optional` subfields in details view (#636) --- app/views/tags/result_doc.scala.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/views/tags/result_doc.scala.html b/app/views/tags/result_doc.scala.html index 7efe6ca..3be13e8 100644 --- a/app/views/tags/result_doc.scala.html +++ b/app/views/tags/result_doc.scala.html @@ -18,6 +18,7 @@ @optional(label: String, key: String, v: JsValue) = { @defining((v\key).asOpt[Seq[JsValue]].getOrElse(Seq(v\key))) { elems => + @if(!elems.isEmpty && elems.head.asOpt[String].isDefined) { @label } @for(elem <- elems; elemString <- elem.asOpt[String]) { @(elemString)@if(elem!=elems.last){ | } else {
} } @@ -45,10 +46,10 @@ @start.asOpt[String].getOrElse(end.asOpt[String].getOrElse("")) }
- @optional("Erscheinungsort", "location", pub) - @optional("Verlag", "publishedBy", pub) + @optional("", "location", pub) + @optional("", "publishedBy", pub) @((pub\"frequency").asOpt[Seq[JsValue]].map { freq => - optional("Erscheinungsweise", "label", freq.head) + optional("", "label", freq.head) }) @@ -225,8 +226,8 @@ } else { @optional("", "note", related) } - @optional("", "isbn", related) - @optional("", "issn", related) + @optional("ISBN: ", "isbn", related) + @optional("ISSN: ", "issn", related) }