From 029ec0bb1703f55ad2885187fa4a2521f0f1c22a 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 4a58becf8e..fffd158158 100644 --- a/Open-ILS/src/templates/opac/parts/record/summary.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/summary.tt2 @@ -154,10 +154,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