[open-ils-commits] [GIT] Evergreen ILS branch master updated. ffed5ee6377841d507a7f779c85425a413278607

Evergreen Git git at git.evergreen-ils.org
Tue Jan 31 14:14:57 EST 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  ffed5ee6377841d507a7f779c85425a413278607 (commit)
      from  fb1ec50af5617f17dfa568db1f889afde11ca509 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ffed5ee6377841d507a7f779c85425a413278607
Author: Dan Scott <dscott at laurentian.ca>
Date:   Sun Jan 22 16:34:31 2012 -0500

    TPAC: Cleaner title display in simple and detailed views
    
    The TPAC uses a simple 245a display for the "simple view" in search
    results, so records like the concerto.sql "Violin concerto no. 3 in G,
    K. 216 ;" display with a trailing semicolon that is rather
    disconcerting.
    
    Similarly, the subfields in the extended title as displayed in the
    record detail view was simply concatenating subfields together. This
    resulted in titles like:
    
    Violin concerto no. 3 in G, K. 216 ;Sinfonia ...
    
    rather than:
    
    Violin concerto no. 3 in G, K. 216 ; Sinfonia ...
    
    This commit strips trailing punctuation that suggests a continuation
    (:;/) from the brief title and joins the subfields with a space for the
    extended title.
    
    Also, enable the detailed view in search results to display the complete
    title.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2
index 70c4f43..95c6f4a 100644
--- a/Open-ILS/src/templates/opac/parts/misc_util.tt2
+++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2
@@ -13,9 +13,18 @@
         END;
         args.upc = args.upcs.0; # use first UPC as the default
         args.issn = xml.findnodes('//*[@tag="022"]/*[@code="a"]').textContent;
-        args.title = xml.findnodes('//*[@tag="245"]/*[@code="a"]').textContent;
-        args.title_extended = xml.findnodes('//*[@tag="245"]').textContent;
         args.author = xml.findnodes('//*[@tag="100"]/*[@code="a"]').textContent;
+
+        # Avoid ugly trailing syntax on brief titles
+        args.title = xml.findnodes('//*[@tag="245"]/*[@code="a"]').textContent;
+        args.title = args.title | replace('[:;/]$', '');
+
+        # Provide correct spacing between the subfields
+        titsubs = xml.findnodes('//*[@tag="245"]/*[@code]');
+        titsubs_content = [];
+            FOR sub IN titsubs; titsubs_content.push(sub.textContent); END;
+        args.title_extended = titsubs_content.join(" ");
+
         args.publisher = xml.findnodes('//*[@tag="260"]/*[@code="b"]').textContent;
         args.pubdate = xml.findnodes('//*[@tag="260"]/*[@code="c"]').textContent;
         args.summary = xml.findnodes('//*[@tag="520"]/*[@code="a"]').textContent;
diff --git a/Open-ILS/src/templates/opac/parts/result/table.tt2 b/Open-ILS/src/templates/opac/parts/result/table.tt2
index 5c7cbcf..21ccaa4 100644
--- a/Open-ILS/src/templates/opac/parts/result/table.tt2
+++ b/Open-ILS/src/templates/opac/parts/result/table.tt2
@@ -7,6 +7,7 @@
     IF ctx.result_stop > ctx.hit_count; ctx.result_stop = ctx.hit_count; END;
 
     result_count = ctx.result_start;
+
 %]
 
 [% PROCESS "opac/parts/result/paginate.tt2" %] 
@@ -30,7 +31,11 @@
                     <tbody id="result_table">
                     [%  FOR rec IN ctx.records;
                             attrs = {marc_xml => rec.marc_xml};
-                            PROCESS get_marc_attrs args=attrs %]
+                            PROCESS get_marc_attrs args=attrs;
+                            IF CGI.param('detail_record_view');
+                                attrs.title = attrs.title_extended;
+                            END;
+                    -%]
                         <tr class="result_table_row">
                                             <td class="results_row_count" name="results_row_count">[%
                                                     result_count; result_count = result_count + 1

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/templates/opac/parts/misc_util.tt2    |   13 +++++++++++--
 Open-ILS/src/templates/opac/parts/result/table.tt2 |    7 ++++++-
 2 files changed, 17 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list