[%
- # Extract MARC fields from XML
- # get_marc_attrs( { marc_xml => doc } )
- BLOCK get_marc_attrs;
- xml = args.marc_xml;
- args.isbn = xml.findnodes('//*[@tag="020"]/*[@code="a"]').shift.textContent;
- args.upc = xml.findnodes('//*[@tag="024"]/*[@code="a"]').textContent;
- args.issn = xml.findnodes('//*[@tag="022"]/*[@code="a"]').textContent;
- args.title = xml.findnodes('//*[@tag="245"]/*[@code="a"]').textContent;
- args.author = xml.findnodes('//*[@tag="100"]/*[@code="a"]').textContent;
- args.publisher = xml.findnodes('//*[@tag="260"]/*[@code="b"]').textContent;
- args.pubdate = xml.findnodes('//*[@tag="260"]/*[@code="c"]').textContent;
- args.edition = xml.findnodes('//*[@tag="250"]/*[@code="a"]').textContent ||
- xml.findnodes('//*[@tag="534"]/*[@code="b"]').textContent ||
- xml.findnodes('//*[@tag="775"]/*[@code="b"]').textContent;
- phys = xml.findnodes(
- '//*[@tag="300"]/*[@code="a" or @code="b" or @code="c" or @code="e"]'
- );
- phys_content = [];
- FOR p IN phys; phys_content.push(p.textContent); END;
- args.phys_desc = phys_content.join("");
-
- # clean up the ISBN
- args.isbn_clean = args.isbn.replace('\ .*', '');
-
- # KCLS-specific stuff; needs to change
- args.mattype = xml.findnodes('//*[@tag="998"]/*[@code="d"]').textContent;
- args.kcls_cn = xml.findnodes('//*[@tag="092" or @tag="099"]/*').textContent;
-
- END;
-
icon_by_mattype = { # XXX KCLS-specific
"a" => "media_book.jpg",
"b" => "media_magazines.jpg",
"2" => "media_cassettewithbook.jpg",
"5" => "media_cdwithbook.jpg"
};
+
+ # Extract MARC fields from XML
+ # get_marc_attrs( { marc_xml => doc } )
+ BLOCK get_marc_attrs;
+ xml = args.marc_xml;
+ args.isbn = xml.findnodes('//*[@tag="020"]/*[@code="a"]').shift.textContent;
+ args.upc = xml.findnodes('//*[@tag="024"]/*[@code="a"]').textContent;
+ args.issn = xml.findnodes('//*[@tag="022"]/*[@code="a"]').textContent;
+ args.title = xml.findnodes('//*[@tag="245"]/*[@code="a"]').textContent;
+ args.author = xml.findnodes('//*[@tag="100"]/*[@code="a"]').textContent;
+ args.publisher = xml.findnodes('//*[@tag="260"]/*[@code="b"]').textContent;
+ args.pubdate = xml.findnodes('//*[@tag="260"]/*[@code="c"]').textContent;
+ args.edition = xml.findnodes('//*[@tag="250"]/*[@code="a"]').textContent ||
+ xml.findnodes('//*[@tag="534"]/*[@code="b"]').textContent ||
+ xml.findnodes('//*[@tag="775"]/*[@code="b"]').textContent;
+ phys = xml.findnodes(
+ '//*[@tag="300"]/*[@code="a" or @code="b" or @code="c" or @code="e"]'
+ );
+ phys_content = [];
+ FOR p IN phys; phys_content.push(p.textContent); END;
+ args.phys_desc = phys_content.join("");
+
+ # clean up the ISBN
+ args.isbn_clean = args.isbn.replace('\ .*', '');
+
+ # KCLS-specific stuff; needs to change
+ args.mattype = xml.findnodes('//*[@tag="998"]/*[@code="d"]').textContent;
+ args.kcls_cn = xml.findnodes('//*[@tag="092" or @tag="099"]/*').textContent;
+ mattype = attrs.mattype;
+ args.format = ctx.find_citm(mattype).value;
+ args.format_icon = icon_by_mattype.$mattype;
+
+ END;
+
%]
<tbody id="rdetail_details_tbody">
<tr>
<td width="90" valign="top" id="rdetail_image_cell">
- <a id='rdetail_img_link' href='${ident.large}'><img
- alt="Image of item" style='border: none;' id='rdetail_image'
- src='${ident.small}' /></a>
+ [% ident = attrs.isbn_clean || attrs.upc; IF ident; %]
+ <a id='rdetail_img_link' href='[% ctx.media_prefix %]/opac/extras/ac/jacket/large/[% ident %]'><img
+ alt="Image of item" id='rdetail_image'
+ src='[% ctx.media_prefix %]/opac/extras/ac/jacket/small/[% ident %]' /></a>
+ [% END %]
<br />
<div class='jacket_attrib hide_me' id='rdetail.jacket_attrib_div'>
<div>[% l("Image provided by") %]</div>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top">
- <span class="rdetail_item" id='rdetail_title'></span><br />
- <span style="color:#545454;">[% l("Author") %]: </span>
- <em><a title='[% l("Perform an author search") %]' id='rdetail_author'></a></em>
+ <span id='rdetail_title'>[% attrs.title %]</span><br />
+ [% IF attrs.author %]
+ <span style="color:#545454;">[% l("Author") %]:</span>
+ <em><a title='[% l("Perform an author search") %]'
+ id='rdetail_author'
+ href="[% ctx.opac_root %]/results?query=author%3a[% attrs.author | replace('[,\.:;]', '') | uri %]&loc=[% loc %]">[% attrs.author %]</a>
+ </em>
+ [% END %]
</td>
<td align="right" valign="top" nowrap="nowrap" style="white-space:nowrap;">
<div style="width:230px;text-align:left;margin-top:3px;">
<div style="float:right;">
<div style="border-bottom:1px dotted #ccc;padding-top:10px;"
class="rdetail_aux_utils">
- <a href="place_hold" id="rdetail_place_hold"><img
+ <a href="[% ctx.opac_root %]/place_hold?hold_target=[% record.id %]&hold_type=T" id="rdetail_place_hold"><img
src="[% ctx.media_prefix %]/images/green_check.png" alt="place hold" />
<span style="position:relative;top:-3px;left:3px;">Place Hold</span></a>
</div>
<table border="0" cellpadding="0" width="100%">
<tr>
<td nowrap='nowrap' valign="top">
- <strong id="rdetail_isbn_lbl" class="">[% l("ISBN") %]</strong>
+ [% IF attrs.isbn %]<strong id="rdetail_isbn_lbl" class="">[% l("ISBN") %]</strong>[% END %]
</td>
- <td valign="top" id='rdetail_isbn'></td>
+ <td valign="top" id='rdetail_isbn'>[% attrs.isbn %]</td>
<td nowrap='nowrap' valign="top">
- <strong id="rdetail_phys_lbl" class="">[% l("Physical Description") %]</strong>
+ [% IF attrs.phys_desc %]<strong id="rdetail_phys_lbl">[% l("Physical Description") %]</strong>[% END %]
</td>
- <td valign="top" id='rdetail_physical_desc'></td>
+ <td valign="top" id='rdetail_physical_desc'>[% attrs.phys_desc %]</td>
</tr>
<tr>
<td nowrap='nowrap' valign="top">
- <strong id="rdetail_ed_lbl" class="">[% l("Edition") %]</strong>
+ <strong id="rdetail_ed_lbl">[% IF attrs.edition; l("Edition"); END %]</strong>
</td>
- <td valign="top" id='rdetail_edition'></td>
+ <td valign="top" id='rdetail_edition'>[% attrs.edition %]</td>
<td nowrap='nowrap' valign="top">
- <strong id="rdetail_form_lbl" class="">[% l("Format") %]</strong>
+ <strong id="rdetail_form_lbl">[% IF attrs.format; l("Format"); END %]</strong>
</td>
<td valign="top">
- <img alt="Format" id='' class='tor_pic hide_me' />
- <span id='rdetail_tor'></span>
+ [% IF attrs.format %]
+ <img alt="Format" class='tor_pic'
+ title="[% attrs.format %]"
+ src="[% ctx.media_prefix _ '/images/' _ attrs.format_icon %]" />
+ [% END %]
</td>
</tr>
<tr>
<td nowrap='nowrap' valign="top">
- <strong id="rdetail_pubdate_lbl" class="">[% l("Publication Date") %]</strong>
+ <strong id="rdetail_pubdate_lbl">[% IF attrs.pubdate; l("Publication Date"); END %]</strong>
</td>
- <td valign="top" id='rdetail_pubdate'></td>
+ <td valign="top" id='rdetail_pubdate'>[% attrs.pubdate %]</td>
<td nowrap='nowrap' valign="top">
<strong id="rdetail_sum_lbl" class="">Summary</strong>
</td>
</tr>
<tr>
<td nowrap='nowrap' valign="top">
- <strong id="rdetail_pub_lbl" class="">[% l("Publisher") %]</strong>
+ <strong id="rdetail_pub_lbl" class="">[% IF attrs.publisher; l("Publisher"); END %]</strong>
</td>
- <td valign="top" id='rdetail_publisher'></td>
+ <td valign="top" id='rdetail_publisher'>[% attrs.publisher %]</td>
<td nowrap='nowrap' valign="top">
- <strong id="rdetail_sub_lbl" class="">[% l("Subjects") %]</strong>
+ [%# XXX TODO see kcls' drawMarcSubjects() in rdetail.js %]
+ <strong id="rdetail_sub_lbl" class="hide_me">[% l("Subjects") %]</strong>
</td>
<td valign="top"></td>
</tr>
</div>
</td>
<td width="1" valign="top" align="right" style="white-space:nowrap;">
- <a href="place_hold" id=''><img alt="Place Hold"
+ <a href="[% ctx.opac_root %]/place_hold?hold_target=[% record.id %]&hold_type=T"><img alt="Place Hold"
src="[% ctx.media_prefix %]/images/place_hold.gif" /></a>
<a href="#" id="rd_reviews_and_more" target="_blank"><img
alt="Reviews and More" src="[% ctx.media_prefix %]/images/reviews.gif" /></a>