From d82c439af62e39e7dba22ba940c01eab8288b699 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Mon, 17 Dec 2012 11:22:44 -0500 Subject: [PATCH] Added "more info" toggle for collections. --- languages/en-gb.ini | 1 + languages/en.ini | 1 + themes/blueprint/js/collection_record.js | 16 ++++++++++++++++ .../SolrDefault/collection-info.phtml | 2 ++ 4 files changed, 20 insertions(+) create mode 100644 themes/blueprint/js/collection_record.js diff --git a/languages/en-gb.ini b/languages/en-gb.ini index d287172d2c9..4e4dc4ee7b8 100644 --- a/languages/en-gb.ini +++ b/languages/en-gb.ini @@ -627,6 +627,7 @@ map_results_label = "At this location:" medium = "Medium" mobile_link = "You appear to be on a mobile device; switch to mobile view?" more = more +more_info_toggle = "Show/hide more info." navigate_back = "Back" no_description = "Description not available." no_items_selected = "No Items were Selected" diff --git a/languages/en.ini b/languages/en.ini index c92f7e40125..bd739a5daef 100644 --- a/languages/en.ini +++ b/languages/en.ini @@ -627,6 +627,7 @@ map_results_label = "At this location:" medium = "Medium" mobile_link = "You appear to be on a mobile device; switch to mobile view?" more = more +more_info_toggle = "Show/hide more info." navigate_back = "Back" no_description = "Description not available." no_items_selected = "No Items were Selected" diff --git a/themes/blueprint/js/collection_record.js b/themes/blueprint/js/collection_record.js new file mode 100644 index 00000000000..aaaa2ef23f0 --- /dev/null +++ b/themes/blueprint/js/collection_record.js @@ -0,0 +1,16 @@ +$(document).ready(function() { + showMoreInfoToggle(); +}); + +function showMoreInfoToggle() { + toggleCollectionInfo(); + $("#moreInfoToggle").show(); + $("#moreInfoToggle").click(function(e) { + e.preventDefault(); + toggleCollectionInfo(); + }); +} + +function toggleCollectionInfo() { + $("#collectionInfo").toggle(); +} diff --git a/themes/blueprint/templates/RecordDriver/SolrDefault/collection-info.phtml b/themes/blueprint/templates/RecordDriver/SolrDefault/collection-info.phtml index 85b7e560e83..1b13d22f04a 100644 --- a/themes/blueprint/templates/RecordDriver/SolrDefault/collection-info.phtml +++ b/themes/blueprint/templates/RecordDriver/SolrDefault/collection-info.phtml @@ -1,3 +1,4 @@ +<? $this->headScript()->appendFile('collection_record.js'); ?> <? /* Display thumbnail if appropriate: */ ?> <? $mediumThumb = $this->record($this->driver)->getThumbnail('medium'); $largeThumb = $this->record($this->driver)->getThumbnail('large'); ?> <? if ($mediumThumb): ?> @@ -11,6 +12,7 @@ <? $summ = $this->driver->getSummary(); if (!empty($summ)): ?> <p><?=$this->escapeHtml($summ[0])?></p> <? endif; ?> +<a id="moreInfoToggle" href="#" style="display:none"><?=$this->transEsc('more_info_toggle')?></a> <div id="collectionInfo" class="collectionInfo"> <table cellpadding="2" cellspacing="0" border="0" class="citation" summary="{translate text='Bibliographic Details'}"> <? $authors = $this->driver->getDeduplicatedAuthors(); ?> -- GitLab