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

Evergreen Git git at git.evergreen-ils.org
Fri Mar 30 11:51:44 EDT 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  4a1cf10753dde847ace2365cf4f7982ff6238a8b (commit)
       via  f955e769750594f7278c455d0d33f31d4809dfaf (commit)
       via  2f94c327bee44ecf36b6fb5ba2aaf23c199f0df2 (commit)
      from  6508510e74b62a78eb3b29ac7ea98741e522b91a (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 4a1cf10753dde847ace2365cf4f7982ff6238a8b
Author: Mike Rylander <mrylander at gmail.com>
Date:   Fri Mar 30 10:40:15 2012 -0400

    Minor cleanup of TT2 vs closing tag
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/src/templates/opac/parts/record/summary.tt2 b/Open-ILS/src/templates/opac/parts/record/summary.tt2
index c652d88..69a9f38 100644
--- a/Open-ILS/src/templates/opac/parts/record/summary.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/summary.tt2
@@ -143,10 +143,10 @@ IF num_uris > 0;
         <strong class='rdetail_label'>[% l("Publisher:") %]</strong>
         <span class='rdetail_value' itemprop="publisher">[%
             attrs.publisher | html;
-        %]</span>[% IF attrs.pubdate; %] <span itemprop="datePublished">[%
-            attrs.pubdate | html;
-            END;
         %]</span>
+        [% IF attrs.pubdate; %]
+        <span itemprop="datePublished">[% attrs.pubdate | html; %]</span>
+        [% END; %]
     </li>
     [%- END %]
 </ul>

commit f955e769750594f7278c455d0d33f31d4809dfaf
Author: Dan Scott <dan at coffeecode.net>
Date:   Sun Mar 18 23:13:12 2012 -0400

    Add basic schema.org microdata to record details
    
    It's shocking how little we can easily and reliably extract from MARC to
    map to schema.org's metadata structure. However, what I could get shows
    up relatively nicely on Google's Rich Snippets testing tool.
    
    Signed-off-by: Dan Scott <dan at coffeecode.net>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/templates/opac/parts/record/authors.tt2 b/Open-ILS/src/templates/opac/parts/record/authors.tt2
index fc06cac..4a0419c 100644
--- a/Open-ILS/src/templates/opac/parts/record/authors.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/authors.tt2
@@ -28,6 +28,7 @@ BLOCK build_author_links;
     FOR node IN ctx.marc_xml.findnodes(xpath);
         term = '';
         qterm = '';
+        iprop = '';
         FOR subfield IN node.childNodes;
             NEXT UNLESS subfield.nodeName == "subfield";
             code = subfield.getAttribute('code');
@@ -39,7 +40,14 @@ BLOCK build_author_links;
         END;
         url = mkurl(ctx.opac_root _ '/results', {query => qterm, qtype => 'author'}, ['page', 'expand']);
         author_type = label | html;
-        '<a href="' _ url _ '">' _ term _ '</a> (' _ author_type _ '). ';
+        
+        # schema.org changes
+        IF type == 'author';
+            iprop = ' itemprop="accountablePerson"';
+        ELSIF type == 'added';
+            iprop = ' itemprop="contributor"';
+        END;
+        '<a href="' _ url _ '"' _ iprop _ '>' _ term.replace('^\s+', '') _ '</a> (' _ author_type _ '). ';
     END;
 END;
 %]
@@ -47,7 +55,9 @@ END;
 <div class='rdetail_authors_div'>
 [%- FOREACH author IN authors;
     NEXT UNLESS author.xpath; 
-    links = PROCESS build_author_links(xpath=author.xpath, label=author.label);
+    links = PROCESS build_author_links(
+        xpath=author.xpath, label=author.label, type=author.type
+    );
     IF links.match('\S') %]
     <span class='rdetail-author-div'>[% links %]</span>
     [%- END %]
diff --git a/Open-ILS/src/templates/opac/parts/record/subjects.tt2 b/Open-ILS/src/templates/opac/parts/record/subjects.tt2
index 59e26a5..52d9ac8 100644
--- a/Open-ILS/src/templates/opac/parts/record/subjects.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/subjects.tt2
@@ -57,7 +57,7 @@
             <tbody>
                 <tr>
                     <td class='rdetail_subject_type'>[% subj.label %]</td>
-                    <td class='rdetail_subject_value'>[% content %]</td>
+                    <td class='rdetail_subject_value' itemprop='keywords'>[% content %]</td>
                 </tr>
             </tbody>
         </table>
diff --git a/Open-ILS/src/templates/opac/parts/record/summary.tt2 b/Open-ILS/src/templates/opac/parts/record/summary.tt2
index 7ca150e..c652d88 100644
--- a/Open-ILS/src/templates/opac/parts/record/summary.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/summary.tt2
@@ -51,7 +51,7 @@
             <img alt="[% attrs.format_label %]" title="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
         </div>
         [%- END %]
-        <h1 id='rdetail_title'>[% attrs.title_extended | html %]</h1>
+        <h1 id='rdetail_title' itemprop="name">[% attrs.title_extended | html %]</h1>
         [%- INCLUDE "opac/parts/record/authors.tt2" %]
     </div>
 </div>
@@ -115,7 +115,7 @@ IF num_uris > 0;
     [%- IF attrs.isbns.0; FOR isbn IN attrs.isbns %]
     <li class='rdetail_isbns'>
         <strong class='rdetail_label'>[% l('ISBN:'); %]</strong>
-        <span class='rdetail_value'>[% isbn | html  %]</span>
+        <span class='rdetail_value' itemprop='isbn'>[% isbn | html  %]</span>
     </li>
         [%- END %]
     [%- END %]
@@ -141,7 +141,12 @@ IF num_uris > 0;
     [%- IF attrs.publisher %]
     <li id='rdetail_publisher'>
         <strong class='rdetail_label'>[% l("Publisher:") %]</strong>
-        <span class='rdetail_value'>[% attrs.publisher | html %] [% IF attrs.pubdate; attrs.pubdate | html; END %]</span>
+        <span class='rdetail_value' itemprop="publisher">[%
+            attrs.publisher | html;
+        %]</span>[% IF attrs.pubdate; %] <span itemprop="datePublished">[%
+            attrs.pubdate | html;
+            END;
+        %]</span>
     </li>
     [%- END %]
 </ul>

commit 2f94c327bee44ecf36b6fb5ba2aaf23c199f0df2
Author: Dan Scott <dan at coffeecode.net>
Date:   Sat Mar 17 22:52:07 2012 -0400

    First inklings of schema.org support
    
    Just get the itemscope and very rudimentary mapping for the primary
    itemtype into record details.
    
    Signed-off-by: Dan Scott <dan at coffeecode.net>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2
index 5586d60..3b9f9a2 100644
--- a/Open-ILS/src/templates/opac/parts/misc_util.tt2
+++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2
@@ -3,6 +3,13 @@
     #   get_marc_attrs( { marc_xml => doc } )
     BLOCK get_marc_attrs;
         xml = args.marc_xml;
+
+        # Map item types to schema.org types; impedance mismatch :(
+        args.schema.itemtype = {};
+        schema_typemap = {};
+        schema_typemap.a = 'http://schema.org/Book';
+        schema_typemap.j = 'http://schema.org/MusicRecording';
+
         args.isbns = [];
         FOR isbn IN xml.findnodes('//*[@tag="020"]/*[@code="a"]');
             args.isbns.push(isbn.textContent);
@@ -208,10 +215,13 @@
             node = xml.findnodes(
                 '//*[local-name()="attributes"]/*[local-name()="field"][@name="' _ icon_style _ '"]');
             IF node AND node.textContent;
+                type = node.textContent;
                 args.format_label = node.getAttribute('coded-value')
-                args.format_icon = ctx.media_prefix _ '/images/format_icons/' _ icon_style _ '/' _ node.textContent _ '.png';
+                args.schema.itemtype = schema_typemap.$type;
+                args.format_icon = ctx.media_prefix _ '/images/format_icons/' _ icon_style _ '/' _ type _ '.png';
                 LAST;
             END;
         END;
+
     END;
 %]
diff --git a/Open-ILS/src/templates/opac/parts/record/body.tt2 b/Open-ILS/src/templates/opac/parts/record/body.tt2
index c5d9ec8..4b49435 100644
--- a/Open-ILS/src/templates/opac/parts/record/body.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/body.tt2
@@ -3,7 +3,7 @@
     PROCESS get_marc_attrs args=attrs;
     stop_parms = ['expand','cnoffset'];
 %]
-<div id='canvas_main' class='canvas'>
+<div id='canvas_main' class='canvas' itemscope itemtype='[% args.schema.itemtype %]'>
 
     [% IF ctx.search_result_index >= 0 %]
     <div id="rdetail_header">

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

Summary of changes:
 Open-ILS/src/templates/opac/parts/misc_util.tt2    |   12 +++++++++++-
 .../src/templates/opac/parts/record/authors.tt2    |   14 ++++++++++++--
 Open-ILS/src/templates/opac/parts/record/body.tt2  |    2 +-
 .../src/templates/opac/parts/record/subjects.tt2   |    2 +-
 .../src/templates/opac/parts/record/summary.tt2    |   11 ++++++++---
 5 files changed, 33 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list