[open-ils-commits] r1343 - conifer/branches/rel_2_0/web/opac/skin/default/xml/rdetail (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Apr 13 10:48:28 EDT 2011
Author: dbs
Date: 2011-04-13 10:48:25 -0400 (Wed, 13 Apr 2011)
New Revision: 1343
Modified:
conifer/branches/rel_2_0/web/opac/skin/default/xml/rdetail/rdetail_summary.xml
Log:
Copy LUL details page, sans resolver lookup, into default
Modified: conifer/branches/rel_2_0/web/opac/skin/default/xml/rdetail/rdetail_summary.xml
===================================================================
--- conifer/branches/rel_2_0/web/opac/skin/default/xml/rdetail/rdetail_summary.xml 2011-04-13 14:42:17 UTC (rev 1342)
+++ conifer/branches/rel_2_0/web/opac/skin/default/xml/rdetail/rdetail_summary.xml 2011-04-13 14:48:25 UTC (rev 1343)
@@ -7,11 +7,12 @@
<span class='hide_me' id='rdetail_isbn'></span>
<span class='hide_me' id='rdetail_publisher'></span>
<span class='hide_me' id='rdetail_abstract'></span>
+ <span class='hide_me' id='rdetail_edition'></span>
<table id='rdetail_details_table'>
<tbody id='rdetail_details_tbody'>
<tr>
- <td id='rdetail_image_cell' rowspan='30'>
+ <td id='rdetail_image_cell' rowspan='40'>
<a id='rdetail_img_link'>
<img style='border: none;' id='rdetail_image'
onerror='
@@ -28,20 +29,33 @@
<td nowrap='nowrap' class='rdetail_desc'>&common.title;</td>
<td type='opac/slot-data' query='datafield[tag=245]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ var rdetail_bib_title = BT.textContent(item);
+ var title_node = dojo.query('head title');
+ dojo.addOnLoad(function() {dojo.place('<title>' + rdetail_bib_title + '</title>', title_node[0], 'replace');});
+ return '<span>' + rdetail_bib_title + '</span><br/>';
]]></script>
</td>
</tr>
<tr class='hide_me' id='tag246'>
<td nowrap='nowrap' class='rdetail_desc'>&common.alternate.title;</td>
- <td type='opac/slot-data' query='datafield[tag=246] > subfield[code=a]' class='rdetail_item'>
+ <td type='opac/slot-data' query='datafield[tag=246] subfield[code=a]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
- unHideMe($('tag246'));
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ dojo.query('#tag246').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
+ <tr class='hide_me' id='tag247'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.former.title;</td>
+ <td type='opac/slot-data' query='datafield[tag="247"]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ dojo.query('#tag247').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
+ ]]></script>
+ </td>
+ </tr>
+
<tr class='hide_me'>
<td nowrap='nowrap' class='rdetail_desc'>&common.author;</td>
<td class='rdetail_item'>
@@ -52,8 +66,8 @@
<td nowrap='nowrap' class='rdetail_desc'>&common.author;</td>
<td type='opac/slot-data' query='datafield[tag=100]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
- unHideMe($('tag100'));
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ dojo.query('#tag100').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
@@ -61,8 +75,8 @@
<td nowrap='nowrap' class='rdetail_desc'>&common.corporate.author;</td>
<td type='opac/slot-data' query='datafield[tag=110]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
- unHideMe($('tag110'));
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ dojo.query('#tag110').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
@@ -70,8 +84,8 @@
<td nowrap='nowrap' class='rdetail_desc'>&common.meeting.name;</td>
<td type='opac/slot-data' query='datafield[tag=111]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
- unHideMe($('tag111'));
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ dojo.query('#tag111').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
@@ -79,26 +93,38 @@
<td nowrap='nowrap' class='rdetail_desc'>&common.isbn;</td>
<td type='opac/slot-data' query='datafield[tag=020]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
- unHideMe($('tag020'));
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ dojo.query('#tag020').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
<tr class='hide_me' id='tag022'>
- <td nowrap='nowrap' class='rdetail_desc'>&common.issn;</td>
+ <td nowrap='nowrap' class='rdetail_desc' id='issn_title'>&common.issn;</td>
<td type='opac/slot-data' query='datafield[tag=022]' class='rdetail_item' id='rdetail_issn'>
<script type='opac/slot-format'><![CDATA[
- unHideMe($('tag022'));
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ dojo.query('#tag022').removeClass('hide_me');
+ var issn_raw = dojo.trim(BT.textContent(item));
+
+ // textContent returns multiple subfields concatenated with linefeeds,
+ // so our regex needs to match against linefeeds. "." does not match
+ // linefeeds, so get \s into the mix
+ var issn = issn_raw.replace(/^(\s|.)*?(\d{4}).(\d{3,4}[xX]?)(\s|.)*/, "$2-$3");
+
+ return '<span>' + issn + '</span><br/>';
]]></script>
</td>
</tr>
- <tr>
- <td nowrap='nowrap' class='rdetail_desc'>&common.edition;</td>
- <td class='rdetail_item' id='rdetail_edition'> </td>
+ <tr class='hide_me' id='tag250'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.edition;</td>
+ <td type='opac/slot-data' query='datafield[tag=250]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ dojo.query('#tag250').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
+ ]]></script>
+ </td>
</tr>
<tr class='hide_me'>
@@ -110,8 +136,8 @@
<td nowrap='nowrap' class='rdetail_desc'>&common.publisher;</td>
<td type='opac/slot-data' query='datafield[tag=260]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
- unHideMe($('tag260'));
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ dojo.query('#tag260').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
@@ -134,8 +160,8 @@
<td nowrap='nowrap' class='rdetail_desc'>&rdetail.detailMain.abstract;</td>
<td type='opac/slot-data' query='datafield[tag=520]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
- unHideMe($('tag520'));
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ dojo.query('#tag520').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
@@ -143,36 +169,125 @@
<!-- *** Example of how to use the openils.BibTemplate infrastructure to augment the stock
*** summary screen with complex information, such as new search links on subjects. -->
- <tr class='hide_me' id='tag65_'>
+ <tr class='hide_me' id='tag600'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.600;</td>
+ <td type='opac/slot-data' query='datafield[tag^=600]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag600', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag610'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.610;</td>
+ <td type='opac/slot-data' query='datafield[tag^=610]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag610', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag611'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.611;</td>
+ <td type='opac/slot-data' query='datafield[tag^=611]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag611', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag630'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.630;</td>
+ <td type='opac/slot-data' query='datafield[tag^=630]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag630', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag648'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.648;</td>
+ <td type='opac/slot-data' query='datafield[tag^=648]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag648', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag650'>
<td nowrap='nowrap' class='rdetail_desc'>&common.subjects;</td>
- <td type='opac/slot-data' query='datafield[tag^=65]' class='rdetail_item'>
+ <td type='opac/slot-data' query='datafield[tag^=650]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
- unHideMe($('tag65_'));
- var cgi = new CGI();
- var other_params = [ 'd', 'l', 'r', 'av', 's', 'sd' ];
- var total = '';
- var output = [];
- var list = dojo.query( 'subfield', item );
- for (var i =0; i < list.length; i++) {
- total += dojox.data.dom.textContent(list[i]) + ' ';
- var current = '<a href="rresult.xml?rt=subject&tp=subject&t=' + total;
- for (var p in other_params) {
- if (cgi.param(other_params[p]))
- current += '&' + other_params[p] + '=' + cgi.param(other_params[p]);
- }
- current += '">' + dojox.data.dom.textContent(list[i]) + '</a>'
- output.push(current);
- }
- return '<span>' + output.join(' -- ') + '</span><br/>';
+ return subjectMe('#tag650', item);
]]></script>
</td>
</tr>
+ <tr class='hide_me' id='tag651'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.651;</td>
+ <td type='opac/slot-data' query='datafield[tag^=651]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag651', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag653'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.653;</td>
+ <td type='opac/slot-data' query='datafield[tag^=653]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag653', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag654'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.654;</td>
+ <td type='opac/slot-data' query='datafield[tag^=654]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag654', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag655'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.655;</td>
+ <td type='opac/slot-data' query='datafield[tag^=655]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag655', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag656'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.656;</td>
+ <td type='opac/slot-data' query='datafield[tag^=656]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag656', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag657'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.657;</td>
+ <td type='opac/slot-data' query='datafield[tag^=657]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag657', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag658'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.658;</td>
+ <td type='opac/slot-data' query='datafield[tag^=658]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag658', item);
+ ]]></script>
+ </td>
+ </tr>
+ <tr class='hide_me' id='tag662'>
+ <td nowrap='nowrap' class='rdetail_desc'>&common.subject.662;</td>
+ <td type='opac/slot-data' query='datafield[tag^=662]' class='rdetail_item'>
+ <script type='opac/slot-format'><![CDATA[
+ return subjectMe('#tag662', item);
+ ]]></script>
+ </td>
+ </tr>
+
<tr class='hide_me' id='tag500'>
<td nowrap='nowrap' class='rdetail_desc'>&common.general.note;</td>
<td type='opac/slot-data' query='datafield[tag=500]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
- unHideMe($('tag500'));
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ dojo.query('#tag500').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
@@ -180,17 +295,17 @@
<td nowrap='nowrap' class='rdetail_desc'>&common.contents.note;</td>
<td type='opac/slot-data' query='datafield[tag=505]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
- unHideMe($('tag505'));
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ dojo.query('#tag505').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
<tr class='hide_me' id='tag506'>
<td nowrap='nowrap' class='rdetail_desc'>&common.usage.restrictions;</td>
- <td type='opac/slot-data' query='datafield[tag=506] > subfield[code=a]' class='rdetail_item'>
+ <td type='opac/slot-data' query='datafield[tag=506] subfield[code=a]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
- unHideMe($('tag506'));
- return '<span>' + dojox.data.dom.textContent(item) + '</span> ';
+ dojo.query('#tag506').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span> ';
]]></script>
</td>
</tr>
@@ -198,8 +313,8 @@
<td nowrap='nowrap' class='rdetail_desc'>&common.performer.note;</td>
<td type='opac/slot-data' query='datafield[tag=511]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
- unHideMe($('tag511'));
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ dojo.query('#tag511').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
@@ -207,8 +322,13 @@
<td nowrap='nowrap' class='rdetail_desc'>&common.additional.authors;</td>
<td type='opac/slot-data' query='datafield[tag=700]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
- unHideMe($('tag700'));
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ dojo.query('#tag700').removeClass('hide_me');
+ var text = '';
+ var list = dojo.query( 'subfield:not([code=4])', item );
+ for (var i =0; i < list.length; i++) {
+ text += BT.textContent(list[i]) + ' ';
+ }
+ return '<span>' + text + '</span><br/>';
]]></script>
</td>
</tr>
@@ -216,8 +336,8 @@
<td nowrap='nowrap' class='rdetail_desc'>&common.preceding.entry;</td>
<td type='opac/slot-data' query='datafield[tag=780]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
- unHideMe($('tag780'));
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ dojo.query('#tag780').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
@@ -225,8 +345,8 @@
<td nowrap='nowrap' class='rdetail_desc'>&common.succeeding.entry;</td>
<td type='opac/slot-data' query='datafield[tag=785]' class='rdetail_item'>
<script type='opac/slot-format'><![CDATA[
- unHideMe($('tag785'));
- return '<span>' + dojox.data.dom.textContent(item) + '</span><br/>';
+ dojo.query('#tag785').removeClass('hide_me');
+ return '<span>' + BT.textContent(item) + '</span><br/>';
]]></script>
</td>
</tr>
@@ -234,7 +354,7 @@
<!-- *** Example of how to use the openils.BibTemplate infrastructure to augment the stock
*** summary screen with complex information, such as location-specific URIs (856$9). -->
<td nowrap='nowrap' class='rdetail_desc'>&rdetail.summary.online;</td>
- <td class='rdetail_item' id='rdetail_online' type='opac/slot-data' query='volumes > volume > uris > uri'>
+ <td class='rdetail_item' id='rdetail_online' type='opac/slot-data' query='volumes volume uris uri'>
<script type='opac/slot-format'><![CDATA[
dojo.query('*:not([type^=opac])', 'rdetail_online').orphan();
var uri = new Object;
@@ -247,7 +367,7 @@
uri.use = null;
}
}
- var link = '<a class="classic_link" href="' + uri.href + '">' + uri.label + '</a>';
+ var link = '<a class="search_link" href="' + uri.href + '">' + uri.label + '</a>';
if (uri.use) {
link += ' (' + uri.use + ')';
}
@@ -255,7 +375,66 @@
]]></script>
</td>
</tr>
+ <tr name="serial_holdings_label"
+ class="result_table_title_cell hide_me">
+ <td class="rdetail_desc">&rdetail.summary.issues_held;</td>
+ <td templated="true" type="opac/slot-data"
+ query="datafield[tag='901'] subfield[code='c']"
+ class="rdetail_item">
+ ${holdingsStatement}
+ <span class="hide_me" name="holdingsStatement" type="opac/template-value"><![CDATA[
+ if (fetchOrgSettingDefault(
+ getLocation(),
+ "opac.fully_compressed_serial_holdings"
+ )) {
+ var bibid = BT.textContent(item_list[0]);
+ var blob = fieldmapper.standardRequest(
+ ["open-ils.serial",
+ "open-ils.serial.bib.summary_statements"],
+ [bibid, {
+ "orgid": getLocation(), "depth": getDepth()
+ }]
+ );
+ var fake = dojo.create("td");
+ var something = false;
+
+ for (var i in blob) {
+ if (!blob[i].length) continue;
+ if (something) dojo.create("br", null, fake);
+ something = true;
+
+ var a = dojo.create(
+ "a", {
+ "innerHTML": "[+]",
+ "href": "javascript:void(0);",
+ "onclick":
+ "rdetailDrawExpandedHoldings(this,"+
+ bibid + ",'" + i + "');",
+ "style": {"marginRight": "1.5em"}
+ }, fake
+ );
+ dojo.create(
+ "span", {
+ "innerHTML": blob[i].join(", ")
+ }, fake
+ );
+ dojo.create(
+ "span", {"id": "holding_type_" + i}, fake
+ );
+ }
+
+ if (something)
+ unHideMe(slot.parentNode);
+
+ return fake.innerHTML;
+ } else {
+ return "";
+ }
+ ]]></span>
+ </td>
+ </tr>
+
</tbody>
</table>
@@ -273,15 +452,49 @@
config.ids.rdetail.image = 'rdetail_image';
config.ids.rdetail.tor_pic = 'rdetail_tor_pic';
+ /* Only clear the resources box once */
+ var first_issn = true;
+
+ function subjectMe(tag, item) {
+ dojo.query(tag).removeClass('hide_me');
+ var cgi = new CGI();
+ var other_params = [ 'd', 'l', 'r', 'av', 's', 'sd' ];
+ var total = '';
+ var output = [];
+ dojo.query( 'subfield:not([code=2])', item ).forEach( function (onesub) {
+ var subtext = '';
+ try {
+ if (dojo.isIE) {
+ subtext = onesub.firstChild.nodeValue;
+ } else {
+ subtext = onesub.textContent;
+ }
+ total += subtext + ' ';
+ } catch (e) {
+ return;
+ }
+ var current = '<a class="search_link" href="rresult.xml?rt=subject&tp=subject&t=' + total;
+ for (var p in other_params) {
+ if (cgi.param(other_params[p]))
+ current += '&' + other_params[p] + '=' + cgi.param(other_params[p]);
+ }
+ current += '">' + subtext + '</a>'
+ output.push(current);
+ });
+ return '<span>' + output.join(' -- ') + '</span><br/>';
+ }
+
dojo.addOnLoad( function () {
- var here = findOrgUnit(getLocation());
- if (getDepth() > 0 || getDepth === 0 ) {
- while (getDepth() < findOrgDepth(here))
- here = findOrgUnit( here.parent_ou() );
- }
+ setTimeout( function () {
+ var here = findOrgUnit(getLocation());
+ if (getDepth() > 0 || getDepth === 0 ) {
+ while (getDepth() < findOrgDepth(here))
+ here = findOrgUnit( here.parent_ou() );
+ }
- dojo.require('openils.BibTemplate');
- new openils.BibTemplate({ record : new CGI().param('r'), org_unit : here.shortname() }).render();
+ dojo.require('openils.BibTemplate');
+ new openils.BibTemplate({ record : new CGI().param('r'), org_unit : here.shortname() }).render();
+ }, 0);
});
]]></script>
More information about the open-ils-commits
mailing list