[open-ils-commits] r991 - conifer/branches/rel_1_6_1/web/opac/skin/lul/xml/result (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Sep 13 16:28:38 EDT 2010


Author: dbs
Date: 2010-09-13 16:28:33 -0400 (Mon, 13 Sep 2010)
New Revision: 991

Modified:
   conifer/branches/rel_1_6_1/web/opac/skin/lul/xml/result/result_table.xml
Log:
Rework online resource display to not show results for records with ISSNs

TODO: Pull ResolverResolver into the mix


Modified: conifer/branches/rel_1_6_1/web/opac/skin/lul/xml/result/result_table.xml
===================================================================
--- conifer/branches/rel_1_6_1/web/opac/skin/lul/xml/result/result_table.xml	2010-09-13 20:16:32 UTC (rev 990)
+++ conifer/branches/rel_1_6_1/web/opac/skin/lul/xml/result/result_table.xml	2010-09-13 20:28:33 UTC (rev 991)
@@ -70,84 +70,89 @@
 		<tr name="local_callnumber_list" class="result_table_title_cell hide_me">
 			<td colspan="2">&result.localCallNumbers;
 				<!-- Prevent records with dozens of items attached from filling the screen -->
-				<span type='opac/slot-data+marcxml-full' query='volumes'>
+				<span type='opac/slot-data+marcxml-full' query='record'>
 					<span class='hide_me' debug='true' type='opac/slot-format'><![CDATA[
-						var item_cnt = 0;
-						var max_items = 4;
+						var output = dojo.create('span'); 
+						dojo.query('volumes', item).forEach(function(volume) {
+							var item_cnt = 0;
+							var max_items = 4;
 
-						var output = dojo.create('span'); 
-						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;
+							dojo.query('volume', volume).forEach(function(vol) {
+								if (item_cnt >= max_items) {
+									return output.innerHTML;
 								}
-								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) {
-										if (!vol_appended) {
-											dojo.create('b', { "innerHTML": vol.getAttribute('label') }, output);
-											vol_appended = true;
+								dojo.query('copy', vol).forEach(function (cp) {
+									if (cp.getAttribute('deleted') == 't') {
+										return;
+									}
+									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) {
+											if (!vol_appended) {
+												dojo.create('b', { "innerHTML": vol.getAttribute('label') }, output);
+												vol_appended = true;
+											}
+											var pfx = dojo.doc.createTextNode(' - ');
+											output.appendChild(pfx);
+											dojo.create('b', { "innerHTML": dojox.xml.parser.textContent(location) }, output);
 										}
-										var pfx = dojo.doc.createTextNode(' - ');
+									});
+									if (loc_id == 8 || loc_id == 20) {
+										return;
+									}
+									dojo.query('status', cp).forEach(function (status) {
+										var pfx = dojo.doc.createTextNode(' (');
 										output.appendChild(pfx);
-										dojo.create('b', { "innerHTML": dojox.xml.parser.textContent(location) }, output);
+										dojo.create('b', { "innerHTML": dojox.xml.parser.textContent(status) }, output);
+										var sfx = dojo.doc.createTextNode(')');
+										output.appendChild(sfx);
+									});
+									dojo.create('br', null, output);
+
+									item_cnt++;
+									if (item_cnt >= max_items) {
+										output.appendChild(dojo.doc.createTextNode('... more items in full record'));
 									}
 								});
-								if (loc_id == 8 || loc_id == 20) {
-									return;
+							});
+						});
+						dojo.query('volumes volume uris uri', item).forEach(function(link) {
+							var found_issn = false;
+							dojo.query('datafield[tag="022"]', item).forEach(function () {
+								found_issn = true;
+							});
+							if (found_issn) {
+								return;
+							}
+							var uri = new Object;
+							uri.href = link.getAttribute('href');
+							uri.label = link.getAttribute('label');
+							uri.use = link.getAttribute('use_restriction');
+							if (uri.href == uri.label) {
+								if (uri.use && uri.use != uri.label) {
+									uri.label = uri.use;
+									uri.use = null;
 								}
-								dojo.query('status', cp).forEach(function (status) {
-									var pfx = dojo.doc.createTextNode(' (');
-									output.appendChild(pfx);
-									dojo.create('b', { "innerHTML": dojox.xml.parser.textContent(status) }, output);
-									var sfx = dojo.doc.createTextNode(')');
-									output.appendChild(sfx);
-								});
-								dojo.create('br', null, output);
+							}
+							var link = dojo.create('a', {"class":"search_link", "href": uri.href});
+							var link_text = dojo.doc.createTextNode(uri.label);
+							link.appendChild(link_text);
+							output.appendChild(link);
 
-								item_cnt++;
-								if (item_cnt >= max_items) {
-									output.appendChild(dojo.doc.createTextNode('... more items in full record'));
-								}
-							});
+							if (uri.use) {
+								var use_text = dojo.doc.createTextNode(' (' + uri.use + ')');
+								output.appendChild(use_text);
+							}
+							dojo.create('br', null, output);
 						});
-						return output.innerHTML;
+						if (output) {
+							return output.innerHTML;
+						}
 					]]></span>
 				</span>
 
-				<!-- Be lenient in what we accept -->
-			<span type='opac/slot-data+marcxml-full' query='volumes volume uris uri'>
-				<span class='hide_me' type='opac/slot-format'><![CDATA[
-					var output = dojo.create('span'); 
-					var uri = new Object;
-					uri.href = item.getAttribute('href');
-					uri.label = item.getAttribute('label');
-					uri.use = item.getAttribute('use_restriction');
-					if (uri.href == uri.label) {
-						if (uri.use && uri.use != uri.label) {
-							uri.label = uri.use;
-							uri.use = null;
-						}
-					}
-					var link = dojo.create('a', {"class":"search_link", "href": uri.href});
-					var link_text = dojo.doc.createTextNode(uri.label);
-					link.appendChild(link_text);
-					output.appendChild(link);
-
-					if (uri.use) {
-						var use_text = dojo.doc.createTextNode(' (' + uri.use + ')');
-						output.appendChild(use_text);
-					}
-					dojo.create('br', null, output);
-					return output.innerHTML;
-				]]></span>
-			</span>
-
 			</td>
 		</tr>
 
@@ -255,11 +260,11 @@
 	               style='padding-left: 40px;' >
 	            <a class='search_page_nav_link' id='search_home_link2' 
 	               title="&rdetail.page.results;">&rdetail.start;</a><a class='search_page_nav_link' 
-	               id='prev_link2' title='&rdetail.page.previous;'>&rdetail.page.previous.symbol; &rdetail.page.previous;</a>
+	               id='prev_link2' title='&rdetail.page.previous;'>&rdetail.page.previous.symbol;</a>
             
 	            <span class='search_page_nav_link' id='page_numbers2'> </span>
 	               <a  class='search_page_nav_link' id='next_link2' 
-	                  title='&rdetail.page.next;'>&rdetail.page.next; &rdetail.page.next.symbol;</a>
+	                  title='&rdetail.page.next;'>&rdetail.page.next.symbol;</a>
                       <!--
                       <a class='search_page_nav_link' 
 	                  id='end_link2' title="&rdetail.page.last;">&rdetail.end;</a>



More information about the open-ils-commits mailing list