Added Summary template to git. Included social media links.
authorGarry Collum <gcollum@gmail.com>
Tue, 19 Jul 2016 18:56:13 +0000 (14:56 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 10 Aug 2016 16:21:09 +0000 (12:21 -0400)
Open-ILS/src/kcpl_templates/opac/parts/record/summary.tt2 [new file with mode: 0644]

diff --git a/Open-ILS/src/kcpl_templates/opac/parts/record/summary.tt2 b/Open-ILS/src/kcpl_templates/opac/parts/record/summary.tt2
new file mode 100644 (file)
index 0000000..f75f7dc
--- /dev/null
@@ -0,0 +1,325 @@
+[%  PROCESS "opac/parts/misc_util.tt2";
+    USE ResolverResolver;
+    ctx.page_title = attrs.title | html
+    ctx.metalinks.push('<meta property="og:image" content="' _ ctx.media_prefix _ '/opac/extras/ac/jacket/large/r/' _ ctx.bre_id _ '" />');
+%]
+<!-- ****************** rdetail_summary.xml ***************************** -->
+<abbr class="unapi-id" title='tag:[% ctx.hostname %],[% date.format(date.now, '%Y') %]:biblio-record_entry/[% ctx.bre_id %]'></abbr>
+
+<hr />
+
+[%-# This holds the record summary information %]
+<div id="rdetail_summary_header">
+    <div id='rdetail_title_div'>
+        <h1 id='rdetail_title' property="name">[% attrs.title_extended | html %]</h1>
+        [%-
+            FOR link880 IN attrs.graphic_titles;
+                FOR alt IN link880.graphic;
+                    '<h2 class="graphic880"';
+                    IF alt.dir;
+                        ' dir="' _ alt.dir _ '"';
+                    END;
+                    '>'; alt.value | html; '</h2>';
+                END;
+            END;
+        -%]
+        [%- INCLUDE "opac/parts/record/authors.tt2" %]
+    </div>
+    <div id="rdetail_image_div">
+        <a href='[% ctx.media_prefix %]/opac/extras/ac/jacket/large/r/[% ctx.bre_id | uri %]'><img
+            alt="[% l('Image of item') %]" id='rdetail_image'
+            src='[% ctx.media_prefix %]/opac/extras/ac/jacket/[% record.summary.jacket_size %]/r/[% ctx.bre_id | uri %]' /></a>
+        <br />
+    </div>
+    <div id="format_actions">
+        [%- IF attrs.format_label %]
+          [% FOR format IN attrs.all_formats %]
+              <img title="[% format.label | html %]" 
+                  alt="[% format.label | html %]" 
+                  src="[% format.icon %]" /> 
+              [% format.label | html %]
+          [% END %]
+        [%- END %]
+        <div id="rdetail_actions_div">
+            [%- search_ou = ctx.search_ou;
+                IF ctx.place_unfillable ||
+                    ( attrs.marc_xml.findnodes('//*[local-name()="holdings" and @has_holdable="true"]').size
+                        && (ctx.holds_block.enabled != 'true' || !attrs.org_copy_counts.$search_ou.available)
+                    )
+             %]
+            <div class="rdetail_aux_utils place_hold">
+                <a href="[% mkurl(ctx.opac_root _ '/place_hold', 
+                    {hold_target => ctx.bre_id, hold_type => 'T', hold_source_page => mkurl()}, stop_parms) %]" 
+                class="no-dec" rel="nofollow" vocab=""><img src="[% ctx.media_prefix %]/images/green_check.png"
+                    [% img_alt(l('Place Hold on [_1]', attrs.title)) %]/>
+                <span class="place_hold">[% l('Place Hold') %]</span></a>
+            </div>
+            [%- END -%]
+            <div class="rdetail_aux_utils toggle_list">
+            [%  IF ctx.user;
+                INCLUDE "opac/parts/bookbag_actions.tt2";
+            %]
+            [%  ELSE;
+                operation = ctx.mylist.grep(ctx.bre_id).size ? "delete" : "add";
+                label = (operation == "add") ? l("Add to my list") : l("Remove from my list"); 
+            %]
+                <a href="[% mkurl(ctx.opac_root _ '/mylist/' _ operation, {record => ctx.bre_id}, stop_parms) %]" class="no-dec" rel="nofollow" vocab="">
+                    <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
+                    [% label %]
+                </a>
+            [% END %]
+            </div>
+            <div class="rdetail_aux_utils">
+                <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="[% l('Print / Email Actions Image') %]" />
+                <a href="[% mkurl(ctx.opac_root _ '/record/print/' _ ctx.bre_id) %]" class="no-dec" rel="nofollow" vocab="">[% l('Print') %]</a> /
+                <a href="[% mkurl(ctx.opac_root _ '/record/email/' _ ctx.bre_id) %]" class="no-dec" rel="nofollow" vocab="">[% l('Email') %]</a>
+            </div>
+            [%- IF ctx.refworks.enabled == 'true' %]
+                [%- INCLUDE 'opac/parts/record/refworks.tt2' %]
+            [%- END %]
+            <div class="rdetail_aux_utils share_record">
+                <a href="[% mkurl('', {locg =>CGI.param('locg'), copy_depth =>CGI.param('copy_depth')}, 1) %]" class="no-dec">
+                     <img src="[% ctx.media_prefix %]/images/link.png" alt="[% l('Permalink') %]" />
+                     [% l('Permalink') %]
+                </a>
+            </div>
+           <div class="rdetail_aux_utils share_record">
+            [% INCLUDE "opac/parts/record/kcplsocial.tt2" %]
+           </div>
+            [%- IF ctx.is_staff %]
+            <div class="rdetail_aux_utils clear_addedcontent_cache">
+                <a href="[% ctx.media_prefix %]/opac/extras/ac/clearcache/all/r/[% ctx.bre_id | uri %]" class="no-dec" target="_blank">
+                     [% l('Clear AddedContent Cache') %]
+                </a>
+            </div>
+            [%- END %]
+        </div>
+    </div>
+</div>
+
+[%- IF openurl.enabled == 'true';
+    openurls = [];
+    FOREACH issn IN args.issns;
+        NEXT IF issn == '';
+        openurls = openurls.import(ResolverResolver.resolve_issn(issn, openurl.baseurl));
+    END;
+    IF openurls.size && openurls.0 != '';
+%]
+    <div id='rdetail_openurl'>
+        <strong class='rdetail_openurl_title'>[% l("Electronic resources") %]</strong>
+        <table><tbody>
+[%-
+        FOREACH res IN openurls;
+%]
+        <tr>
+            <td class='rdetail_openurl_entry'><a href="[% res.target_url %]">[% res.public_name | html %]</a></td>
+            <td>[% res.target_coverage | html %]
+            [%- IF res.target_embargo != '';
+                    ' - ';
+                    res.target_embargo | html;
+                END;
+            -%]
+            </td>
+        </tr>
+    [%- END %]
+    </tbody></table>
+    </div>    
+[%- END %]
+[%- END %]
+[%- merged_uris = args.uris.merge(args.online_res);
+num_uris = merged_uris.size;
+IF num_uris > 0;
+-%]
+<h2 class="rdetail_uris">[% l("Electronic resources") %]</h2>
+<div class="rdetail_uris">
+    [%- IF num_uris > 1 %]<ul>[% END %]
+    [%- FOR uri IN merged_uris %]
+        [%- IF num_uris == 1 -%]
+            <p class="rdetail_uri" property="offers" vocab="http://schema.org/" typeof="Offer">
+        [%- ELSE -%]
+            <li class="rdetail_uri" property="offers" vocab="http://schema.org/" typeof="Offer">
+        [%- END -%]
+        <a href="[% uri.href %]" class="uri_link" property="url">
+        [%- IF uri.href != uri.link;
+                '<span property="description">' _ uri.link _ '</span>';
+            ELSE;
+                uri.link;
+            END;
+        -%]
+        </a>
+        [%- ' - <span property="description">' _ uri.note _ '</span>' IF uri.note %]
+        <link property="availability" href="http://schema.org/OnlineOnly" />
+        [%- IF attrs.gtin13; '<meta property="gtin13" content="' _ attrs.gtin13 _ '" />'; END; %]
+        [%- IF num_uris == 1 %]</p>[% ELSE %]</li>[% END %]
+    [%- END %]
+    [%- IF num_uris > 1 %]</ul>[% END %]
+</div>
+[%- END %]
+[%- # Hold/copy summary
+    IF ctx.copy_summary.0.count
+%]
+<div id="copy_hold_counts">
+[%- INCLUDE "opac/parts/record/copy_counts.tt2" %]
+    <span id="rdetail_hold_counts">
+        <h2>[% l('Current holds') %]</h2>
+        <p>
+            [% 
+                # If org hiding is enabled/relevant, only show 
+                # counts for copies within the hiding scope.
+                count_entry = 0;
+                FOR count_chunk IN ctx.copy_summary;
+                    IF ctx.org_within_hiding_scope(count_chunk.org_unit);
+                        # always true when hiding is disabled
+                        LAST;
+                    END;
+                    count_entry = count_entry + 1;
+                END;
+                l("[quant,_1,current hold,current holds] with [quant,_2,total copy,total copies].", 
+                    ctx.record_hold_count, ctx.copy_summary.$count_entry.count) 
+            %]
+        </p>
+    </span>
+[%- INCLUDE "opac/parts/record/copy_table.tt2" copies=ctx.copies %]
+</div>
+[%- END %]
+
+<h2 id='rdetail_record_details'>[% l("Record details") %]</h2>
+<ul>
+    [%- IF attrs.isbns.0;
+          FOR isbn IN attrs.isbns;
+            isbn_extra = '';
+            IF (matches = isbn.match('^(.+?)(\s.+)$'));
+              isbn = matches.0;
+              isbn_extra = matches.1;
+            END;
+    %]
+    <li class='rdetail_isbns'>
+        <strong class='rdetail_label'>[% l('ISBN:'); %]</strong>
+        <span class='rdetail_value' property='isbn'>[% isbn | html  %]</span>[% isbn_extra | html %]
+    </li>
+        [%- END %]
+    [%- END %]
+    [%- IF attrs.issns.0; FOR issn IN attrs.issns %]
+    <li class='rdetail_issns'>
+        <strong class='rdetail_label'>[% l('ISSN:'); %]</strong>
+        <span class='rdetail_value'>[% issn | html  %]</span>
+    </li>
+        [%- END %]
+    [%- END %]
+    [%- IF attrs.phys_desc %]
+    <li id='rdetail_phys_desc'>
+        <strong class='rdetail_label'>[% l("Physical Description:") %]</strong>
+        <span class='rdetail_value'>[% attrs.phys_desc | html %]</span>
+    </li>
+    [%- END %]
+    [%- IF attrs.edition %]
+    <li id='rdetail_edition'>
+        <strong class='rdetail_label'>[% l("Edition:") %]</strong>
+        <span class='rdetail_value'>[% attrs.edition | html %]</span>
+        [%-
+        FOR entry IN attrs.graphic_editions;
+            FOR alt IN entry.graphic;
+                diratt = "";
+                IF alt.dir;
+                    diratt = ' dir="' _ alt.dir _ '"';
+                END;
+        -%]
+        <div class="graphic880 rdetail_value"[% diratt %]>
+            [% alt.value | html %]
+        </div>
+        [%-
+            END;
+        END;
+        -%]
+    </li>
+    [%- END %]
+    [%- IF attrs.publisher %]
+    <li id='rdetail_publisher'>
+        <strong class='rdetail_label'>[% l("Publisher:") %]</strong>
+        <span class='rdetail_value' property="publisher" typeof="Organization">
+        [%- IF attrs.pubplace; %]
+            <span property="location">[% attrs.pubplace | html; %]</span>
+        [%- END; %]
+            <span property="name">[% attrs.publisher | html; %]</span>
+        </span>
+        [%- IF attrs.pubdate; %]
+            <span property="datePublished">[% attrs.pubdate | html; %]</span>
+        [%- END; %]
+        [%-
+        IF attrs.graphic_pubinfos.size > 0;
+            FOR entry IN attrs.graphic_pubinfos;
+                FOR alt IN entry.graphic;
+                    diratt = "";
+                    IF alt.dir;
+                        diratt = ' dir="' _ alt.dir _ '"';
+                    END;
+        -%]
+        <div class="graphic880"[% diratt %]>
+            [% alt.value | html %]
+        </div>
+        [%-
+                END;
+            END;
+        END
+        -%]
+    </li>
+    [%- END %]
+    [%- IF attrs.producer %]
+        <li id='rdetail_producer'>
+            <strong class='rdetail_label'>[% l("Producer:") %]</strong>
+            <span class='rdetail_value'>
+            [%- IF attrs.prodplace; %]
+                <span>[% attrs.prodplace | html; %]</span>
+            [%- END; %]
+                <span>[% attrs.producer | html; %]</span>
+            [%- IF attrs.proddate; %]
+                <span>[% attrs.proddate | html; %]</span>
+            [%- END; %]
+            </span>
+        </li>
+    [%- END %]
+    [%- IF attrs.distributor %]
+        <li id='rdetail_distributor'>
+            <strong class='rdetail_label'>[% l("Distributor:") %]</strong>
+            <span class='rdetail_value'>
+            [%- IF attrs.distplace; %]
+                <span>[% attrs.distplace | html; %]</span>
+            [%- END; %]
+                <span>[% attrs.distributor | html; %]</span>
+            [%- IF attrs.distdate; %]
+                <span>[% attrs.distdate | html; %]</span>
+            [%- END; %]
+            </span>
+        </li>
+    [%- END %]
+    [%- IF attrs.manufacturer %]
+        <li id='rdetail_manufacturer'>
+            <strong class='rdetail_label'>[% l("Manufacturer:") %]</strong>
+            <span class='rdetail_value' property="manufacturer" typeof="Organization">
+            [%- IF attrs.manplace; %]
+                <span property="location">[% attrs.manplace | html; %]</span>
+            [%- END; %]
+                <span property="name">[% attrs.manufacturer | html; %]</span>
+            [%- IF attrs.mandate; %]
+                <span>[% attrs.mandate | html; %]</span>
+            [%- END; %]
+            </span>
+        </li>
+    [%- END %]
+    [%- IF attrs.copyright %]
+    <li id='rdetail_copyright'>
+        <strong class='rdetail_label'>[% l("Copyright:") %]</strong>
+        <span class='rdetail_value'>[% attrs.copyright | html_entity; %]
+        [%-# Provide the 4-digit year, cleansed of '@' and other junk %]
+        [%- IF attrs.copyrightYear -%]
+            <meta property='copyrightYear' content='[% attrs.copyrightYear | html; %]'>
+        [%- END -%]
+        </span>
+    </li>
+    [%- END %]
+</ul>
+
+[%- INCLUDE "opac/parts/record/contents.tt2" %]
+[%- INCLUDE "opac/parts/record/subjects.tt2" %]
+[%- INCLUDE "opac/parts/record/series.tt2" %]
+[%- INCLUDE "opac/parts/record/extras.tt2" %]