[open-ils-commits] r19248 - branches/rel_2_0/Open-ILS/web/opac/skin/default/xml/result (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Jan 21 14:50:44 EST 2011
Author: miker
Date: 2011-01-21 14:50:39 -0500 (Fri, 21 Jan 2011)
New Revision: 19248
Modified:
branches/rel_2_0/Open-ILS/web/opac/skin/default/xml/result/result_table.xml
Log:
Move to the prettier and more useful Laurentian local call number display code as the example
Modified: branches/rel_2_0/Open-ILS/web/opac/skin/default/xml/result/result_table.xml
===================================================================
--- branches/rel_2_0/Open-ILS/web/opac/skin/default/xml/result/result_table.xml 2011-01-21 16:58:44 UTC (rev 19247)
+++ branches/rel_2_0/Open-ILS/web/opac/skin/default/xml/result/result_table.xml 2011-01-21 19:50:39 UTC (rev 19248)
@@ -137,13 +137,69 @@
</td>
</tr>
<tr name="local_callnumber_list" class="result_table_title_cell hide_me">
- <td colspan="2">&result.localCallNumbers;
- <span type='opac/slot-data+holdings_xml' query='volumes volume' join=", ">
- <!-- Because we clone this template table, and IE won't clone <script>
- nodes (yes, even when it doesn't understand the type ARG) we need
- to use something other than a <script> HATE HATE HATE -->
- <span class="hide_me" type='opac/slot-format'><![CDATA[return '<b>'+item.getAttribute('label')+'</b>';]]></span>
- </span>
+ <td>
+ <span type='opac/slot-data+holdings_xml' query='volumes'>
+ <span class='hide_me' debug='true' type='opac/slot-format'><![CDATA[
+ var output = dojo.create('span');
+
+ var item_cnt = 0;
+ var max_items = 4;
+
+
+ dojo.query('volume', item).forEach(function(vol) {
+ if (item_cnt >= max_items) {
+ return output.innerHTML;
+ }
+ dojo.query('copy', vol).forEach(function (cp) {
+ if (cp.getAttribute('deleted') == 't') {
+ return;
+ }
+ if (cp.getAttribute('opac_visible') == 'f') {
+ return;
+ }
+ var cp_entry = dojo.create('div');
+ var loc_id;
+ var vol_appended = false;
+ dojo.query('location', cp).forEach(function (location) {
+ loc_id = parseInt(location.getAttribute('ident'));
+ if (loc_id != 8 && loc_id != 20 && loc_id != 185 && loc_id != 156) {
+ if (!vol_appended) {
+ var cn = dojo.create('span', { style: "font-weight: bold;" }, cp_entry);
+ var cn_txt = dojo.doc.createTextNode(vol.getAttribute('label'));
+ cn.appendChild(cn_txt);
+ vol_appended = true;
+ }
+ var loc = dojo.create('span', { "style": "font-weight: bold;"}, cp_entry);
+ var loc_txt = dojo.doc.createTextNode(' - ' + dojox.xml.parser.textContent(location));
+ loc.appendChild(loc_txt);
+ }
+ });
+ if (loc_id == 8 || loc_id == 20 || loc_id == 185 || loc_id == 156) {
+ return;
+ }
+ dojo.query('circ_lib', cp).forEach(function (circ_lib) {
+ var cp_lib = dojo.create('span', { "style": "font-weight: bold;" }, cp_entry, "first");
+ var cp_lib_txt = dojo.doc.createTextNode(circ_lib.getAttribute('name') + ' - ');
+ cp_lib.appendChild(cp_lib_txt);
+ });
+ dojo.query('status', cp).forEach(function (status) {
+ var cp_status = dojo.create('span', { "style": "font-weight: bold;" }, cp_entry);
+ var cp_status_txt = dojo.doc.createTextNode(' (' + dojox.xml.parser.textContent(status) + ')');
+ cp_status.appendChild(cp_status_txt);
+ });
+
+ item_cnt++;
+ if (item_cnt >= max_items) {
+ dojo.create('br', null, cp_entry);
+ cp_entry.appendChild(dojo.doc.createTextNode('... more print items listed in full record'));
+ }
+ output.appendChild(cp_entry);
+ });
+ });
+
+ return output.innerHTML;
+ ]]></span>
+ </span>
</td>
</tr>
<!-- Placeholder for ChiliFresh Review -->
More information about the open-ils-commits
mailing list