From 7bd229eec07a995ac5837d997ffa83840ded464c Mon Sep 17 00:00:00 2001 From: Chris Hallberg <crhallberg@gmail.com> Date: Mon, 12 May 2014 10:58:14 -0400 Subject: [PATCH] Bootstrap theming for RandomRecommend. Some small tweaks to a similar template. --- themes/bootstrap/css/screen.css | 3 +- .../templates/Recommend/CatalogResults.phtml | 7 +- .../templates/Recommend/RandomRecommend.phtml | 74 +++++++++++-------- 3 files changed, 47 insertions(+), 37 deletions(-) diff --git a/themes/bootstrap/css/screen.css b/themes/bootstrap/css/screen.css index c1e942063b1..53bb7dc6841 100644 --- a/themes/bootstrap/css/screen.css +++ b/themes/bootstrap/css/screen.css @@ -26,7 +26,8 @@ li a.hidden {display:none} .sidebar .nav-list li.applied input[type="checkbox"] { margin-top:7px } .sidebar .nav-list li .icon-ok { margin-top:3px } .sidebar .nav-list li .icon-remove { margin-left:3px } -.sidebar .small { color:#333;margin-top:9px;line-height:85% } +.sidebar .small { color:#333;line-height:85% } +.sidebar a .small { margin-top:6px } .sidebar a.small,.sidebar .small a { color:#08C } .small { font-size:85% } .switch-margins,.row .switch-margins,.row-fluid .switch-margins { display: inline-block; margin:auto 0 } diff --git a/themes/bootstrap/templates/Recommend/CatalogResults.phtml b/themes/bootstrap/templates/Recommend/CatalogResults.phtml index f493ee5d168..937defe38f3 100644 --- a/themes/bootstrap/templates/Recommend/CatalogResults.phtml +++ b/themes/bootstrap/templates/Recommend/CatalogResults.phtml @@ -4,7 +4,7 @@ <? foreach ($results as $driver): ?> <li> <? $formats = $driver->getFormats(); $format = isset($formats[0]) ? $formats[0] : ''; ?> - <a href="<?=$this->recordLink()->getUrl($driver)?>" class="title <?=$this->record($driver)->getFormatClass($format)?>"> + <a href="<?=$this->recordLink()->getUrl($driver)?>" class="title <?=$this->record($driver)->getFormatClass($format)?> clearfix"> <? $summHighlightedTitle = $driver->getHighlightedTitle(); $summTitle = $driver->getTitle(); @@ -17,14 +17,13 @@ } ?> <? $summAuthor = $driver->getPrimaryAuthor(); ?> - <? if (!empty($summAuthor)): ?> - <span class="small pull-right"> + <? $summAuthor = $driver->getPrimaryAuthor(); ?> + <span class="small<? if (!empty($summAuthor)): ?> pull-right<? endif; ?>"> <? $summDate = $driver->getPublicationDates(); ?> <? if (!empty($summDate)): ?> <?=$this->transEsc('Published')?>: (<?=$this->escapeHtml($summDate[0])?>) <? endif; ?> </span> - <? endif; ?> </a> <? if (!empty($summAuthor)): ?> <a class="small text-right" href="<?=$this->record($driver)->getLink('author', $summAuthor)?>"> diff --git a/themes/bootstrap/templates/Recommend/RandomRecommend.phtml b/themes/bootstrap/templates/Recommend/RandomRecommend.phtml index 66c5eba84e4..7f489269297 100644 --- a/themes/bootstrap/templates/Recommend/RandomRecommend.phtml +++ b/themes/bootstrap/templates/Recommend/RandomRecommend.phtml @@ -1,48 +1,58 @@ <? $recommend = $this->recommend->getResults(); if (count($recommend)> 0): ?> <h4><?=$this->transEsc("random_recommendation_title")?></h4> - <ul class="random <?=$this->recommend->getDisplayMode()?>"> + <ul class="random <?=$this->recommend->getDisplayMode()?> nav nav-list collapsed <? if(!in_array($title, $collapsedFacets)): ?> open<? endif ?>"> <? foreach ($recommend as $driver): ?> <li> + <?if($this->recommend->getDisplayMode() === "images" || $this->recommend->getDisplayMode() === "mixed"):?> - <?if($this->recommend->getDisplayMode() === "images" || $this->recommend->getDisplayMode() === "mixed"):?> - - <? /* Display thumbnail if appropriate: */ ?> - <? $smallThumb = $this->record($driver)->getThumbnail('small'); $mediumThumb = $this->record($driver)->getThumbnail('medium'); ?> - <? if ($smallThumb): ?> - <a href="<?=$this->recordLink()->getUrl($driver)?>"> - <img alt="<?=$this->transEsc('Cover Image')?>" src="<?=$this->escapeHtml($smallThumb);?>"/><br /> - </a> - <?elseif($mediumThumb):?> - <a href="<?=$this->recordLink()->getUrl($driver)?>"> - <img alt="<?=$this->transEsc('Cover Image')?>" src="<?=$this->escapeHtml($mediumThumb);?>"/><br /> - </a> - <? else: ?> - <img src="<?=$this->url('cover-unavailable')?>" alt="<?=$this->transEsc('No Cover Image')?>"/><br /> - <? endif; ?> + <? /* Display thumbnail if appropriate: */ ?> + <? $smallThumb = $this->record($driver)->getThumbnail('small'); + $mediumThumb = $this->record($driver)->getThumbnail('medium'); ?> + <? if ($smallThumb): ?> + <a href="<?=$this->recordLink()->getUrl($driver)?>"> + <img alt="<?=$this->transEsc('Cover Image')?>" src="<?=$this->escapeHtml($smallThumb);?>"/><br /> + </a> + <?elseif($mediumThumb):?> + <a href="<?=$this->recordLink()->getUrl($driver)?>"> + <img alt="<?=$this->transEsc('Cover Image')?>" src="<?=$this->escapeHtml($mediumThumb);?>"/><br /> + </a> + <? else: ?> + <img src="<?=$this->url('cover-unavailable')?>" alt="<?=$this->transEsc('No Cover Image')?>"/><br /> + <? endif; ?> - <?endif;?> + <?endif;?> - <?if($this->recommend->getDisplayMode() === "standard" || $this->recommend->getDisplayMode() === "mixed"):?> - <? $formats = $driver->getFormats(); $format = isset($formats[0]) ? $formats[0] : ''; ?> - <a href="<?=$this->recordLink()->getUrl($driver)?>" class="title <?=$this->record($driver)->getFormatClass($format)?>"><? + <? $formats = $driver->getFormats(); $format = isset($formats[0]) ? $formats[0] : ''; ?> + <a href="<?=$this->recordLink()->getUrl($driver)?>" class="title <?=$this->record($driver)->getFormatClass($format)?> clearfix"> + <? + $summHighlightedTitle = $driver->getHighlightedTitle(); $summTitle = $driver->getTitle(); - if (!empty($summTitle)) { + if (!empty($summHighlightedTitle)) { + echo $this->highlight($this->addEllipsis($summHighlightedTitle, $summTitle)); + } else if (!empty($summTitle)) { echo $this->escapeHtml($this->truncate($summTitle, 180)); } else { echo $this->transEsc('Title not available'); } + ?> + <? $summAuthor = $driver->getPrimaryAuthor(); ?> + <span class="small<? if (!empty($summAuthor)): ?> pull-right<? endif; ?>"> + <? $summDate = $driver->getPublicationDates(); ?> + <? if (!empty($summDate)): ?> + <?=$this->transEsc('Published')?>: (<?=$this->escapeHtml($summDate[0])?>) + <? endif; ?> + </span> + </a> + <? if (!empty($summAuthor)): ?> + <a class="small text-right" href="<?=$this->record($driver)->getLink('author', $summAuthor)?>"> + <span><?=$this->transEsc('By')?></span> + <? + $summHighlightedAuthor = $driver->getHighlightedAuthor(); + echo !empty($summHighlightedAuthor) + ? $this->highlight($summHighlightedAuthor) + : $this->escapeHtml($summAuthor); ?></a> - <? $summAuthor = $driver->getPrimaryAuthor(); if (!empty($summAuthor)): ?> - <br /> - <?=$this->transEsc('By')?>: - <a href="<?=$this->record($driver)->getLink('author', $summAuthor)?>"> - <?=$this->escapeHtml($summAuthor)?> - </a> - <? endif; ?> - <? $summDate = $driver->getPublicationDates(); if (!empty($summDate)): ?> - <br/><?=$this->transEsc('Published')?>: (<?=$this->escapeHtml($summDate[0])?>) - <? endif; ?> - <?endif;?> + <? endif; ?> </li> <? endforeach; ?> </ul> -- GitLab