From 4b040b7041c2660abdd9c26317baaa0fc051623a Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Thu, 5 Jun 2014 20:27:39 -0400 Subject: [PATCH] LP#1303544 Trim junk from the ISBN in record summary When asserting that we are publishing an ISBN, move the "(pbk.)" and similar such matter outside of the schema.org element. See "The walking dead" in the sample dataset for an example. Signed-off-by: Dan Scott Signed-off-by: Ben Shum --- Open-ILS/src/templates/opac/parts/record/summary.tt2 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/templates/opac/parts/record/summary.tt2 b/Open-ILS/src/templates/opac/parts/record/summary.tt2 index c6e3b7c3ae..313f3e5c67 100644 --- a/Open-ILS/src/templates/opac/parts/record/summary.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/summary.tt2 @@ -150,10 +150,17 @@ IF num_uris > 0;

[% l("Record details") %]

    - [%- IF attrs.isbns.0; FOR isbn IN attrs.isbns %] + [%- IF attrs.isbns.0; + FOR isbn IN attrs.isbns; + isbn_extra = ''; + IF (matches = isbn.match('^(.+?)(\s.+)$')); + isbn = matches.0; + isbn_extra = matches.1; + END; + %]
  • [% l('ISBN:'); %] - [% isbn | html %] + [% isbn | html %][% isbn_extra | html %]
  • [%- END %] [%- END %] -- 2.11.0