From: Jeff Godin Date: Tue, 3 Apr 2012 14:25:26 +0000 (-0400) Subject: Enhance display of online-only bibs X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=29252788a1066b37d4f70e6ba0506895c4dfb818;p=evergreen%2Ftadl.git Enhance display of online-only bibs On search results: * Hide "place hold" links for bibs which appear to have TADL ezproxy auris. * Simplify physical description for online-only bibs in search results * Hide format icons for online-only bibs * Add some padding to result_table_format_cell On record summary: * Change auri links to use the css_button class. * Hide things which only make sense for physical holdings: * place hold * copy info displays * call number browse Signed-off-by: Jeff Godin --- diff --git a/Open-ILS/web/opac/skin/tadlv2/css/tadl_layout.css b/Open-ILS/web/opac/skin/tadlv2/css/tadl_layout.css index 065a07b3ac..92172553c7 100644 --- a/Open-ILS/web/opac/skin/tadlv2/css/tadl_layout.css +++ b/Open-ILS/web/opac/skin/tadlv2/css/tadl_layout.css @@ -7,6 +7,7 @@ /* Make titles in search results larger */ .result_table_title_cell { padding-top: 10px; } a[name="item_title"] { font-size: 1.5em; } +.result_table_format_cell { padding-top: 10px; } /* Make titles in record details larger */ #rdetail_details_tbody tr:first-child td.rdetail_item { font-size: 1.5em; padding-top: 5px; } diff --git a/Open-ILS/web/opac/skin/tadlv2/js/rdetail.js b/Open-ILS/web/opac/skin/tadlv2/js/rdetail.js index 2984ad1d36..f1df91b8f3 100644 --- a/Open-ILS/web/opac/skin/tadlv2/js/rdetail.js +++ b/Open-ILS/web/opac/skin/tadlv2/js/rdetail.js @@ -501,6 +501,16 @@ function _rdetailDraw(r) { // see if the record has any external links var links = record.online_loc(); + // When we see an ezproxy link, hide things that only make sense for physical holdings + // FIXME: We should also check for zero copies, or check all links for ezproxy looking urls + if (links.length > 0) { + if (links[0].substring(0,20) == "http://via.tadl.org/") { + hideMe($('rdetail_place_hold')); + hideMe($('rdetail_copy_info_link')); + hideMe($('rdetail_viewcn_link')); + hideMe($('rdetail_copy_info_div')); + } + } for( var i = 0; links && links.length > 0 && i < links.length; i = i + 3 ) { var href = links[i]; // avoid matching "HTTP: The Complete Reference" @@ -525,7 +535,7 @@ function _rdetailDraw(r) { displayLabel = note; } } - $('rdetail_online').appendChild(elem('a', {href:href,'class':'classic_link'}, displayLabel)); + $('rdetail_online').appendChild(elem('a', {href:href,'class':'css_button'}, displayLabel)); if (note && note != displayLabel) { $('rdetail_online').appendChild(elem('span', {'class':'url_note'}, ' - ' + note)); } diff --git a/Open-ILS/web/opac/skin/tadlv2/js/result_common.js b/Open-ILS/web/opac/skin/tadlv2/js/result_common.js index 204448948e..39177b53dd 100644 --- a/Open-ILS/web/opac/skin/tadlv2/js/result_common.js +++ b/Open-ILS/web/opac/skin/tadlv2/js/result_common.js @@ -452,6 +452,14 @@ function resultDisplayRecord(rec, pos, is_mr) { var r = table.rows[pos + 1]; var currentISBN = cleanISBN(rec.isbn()); + var is_online_only; + + if (rec.online_loc()[0]) { + // FIXME: check more than just the first url, check for copies, bib source? + if (rec.online_loc()[0].substring(0,20) == "http://via.tadl.org/") { + is_online_only = true; + } + } if (googleBooksLink) { var gbspan = $n(r, "googleBooksLink"); @@ -548,8 +556,11 @@ function resultDisplayRecord(rec, pos, is_mr) { args[PARAM_RID] = rec.doc_id(); pic.parentNode.setAttribute("href", buildOPACLink(args)); - unHideMe($n(r,'place_hold_span')); - $n(r,'place_hold_link').onclick = function() { resultDrawHoldsWindow(rec.doc_id(), 'T'); } + if (!is_online_only) { + // don't show Place Hold for online-only bibs + unHideMe($n(r,'place_hold_span')); + $n(r,'place_hold_link').onclick = function() { resultDrawHoldsWindow(rec.doc_id(), 'T'); } + } } buildSearchLink(STYPE_AUTHOR, rec.author(), author_link); @@ -573,14 +584,24 @@ function resultDisplayRecord(rec, pos, is_mr) { if(!isNull(rec.physical_description()) ) { unHideMe( $n(r, "result_table_extra_span")); - var t = " " + rec.physical_description(); - //$n(r, "result_table_phys_span").appendChild( text(t.replace(/:.*/g,''))); - $n(r, "result_table_phys_span").appendChild( text(t)); + var t; + if (is_online_only) { + // simplify physical description for online-only bibs + t = "online"; + } else { + t = " " + rec.physical_description(); + } + //$n(r, "result_table_phys_span").appendChild( text(t.replace(/:.*/g,''))); + $n(r, "result_table_phys_span").appendChild( text(t)); } } - resultBuildFormatIcons( r, rec, is_mr ); + if (is_online_only) { + hideMe($n(r,'result_table_format_cell')); + } else { + resultBuildFormatIcons( r, rec, is_mr ); + } var bt_params = { sync : false,