From d6515fb9c754f4216a1ed6baf05186fc6f695bbd Mon Sep 17 00:00:00 2001 From: dbs Date: Fri, 21 Jan 2011 20:36:16 +0000 Subject: [PATCH] Adopt the Conifer local call number display code as an example of complex client-side customization It's useful, too - library / call number / copy location / copy status on search results, and easily tweaked from the out of the box defaults. git-svn-id: svn://svn.open-ils.org/ILS/trunk@19250 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../opac/skin/default/xml/result/result_table.xml | 71 +++++++++++++++++++--- 1 file changed, 63 insertions(+), 8 deletions(-) diff --git a/Open-ILS/web/opac/skin/default/xml/result/result_table.xml b/Open-ILS/web/opac/skin/default/xml/result/result_table.xml index 46edda88c0..f3a10fb86e 100644 --- a/Open-ILS/web/opac/skin/default/xml/result/result_table.xml +++ b/Open-ILS/web/opac/skin/default/xml/result/result_table.xml @@ -136,14 +136,69 @@ - - &result.localCallNumbers; - - - '+item.getAttribute('label')+'';]]> - + + + + = 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_visible; + var vol_appended = false; + dojo.query('location', cp).forEach(function (location) { + loc_visible = location.getAttribute('opac_visible'); + if (loc_visible == 't') { + 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_visible != 't') { + 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; + ]]> + -- 2.11.0