From 36567048a798e0c3d3a0e9742848e090384fa62b Mon Sep 17 00:00:00 2001 From: Chris Hallberg <crhallberg@gmail.com> Date: Wed, 16 Apr 2014 09:39:20 -0400 Subject: [PATCH] Replaced view icons in Bootstrap with FontAwesome icons. Moved the beloved icons to Bootprint. --- .../{bootstrap => bootprint}/images/view_grid.png | Bin .../{bootstrap => bootprint}/images/view_list.png | Bin themes/bootprint/js/vudl/config.js | 11 +++++++++++ .../bootprint/templates/search/controls/view.phtml | 11 +++++++++++ themes/bootstrap/css/bootstrap-custom.css | 1 + .../bootstrap/templates/search/controls/view.phtml | 2 +- 6 files changed, 24 insertions(+), 1 deletion(-) rename themes/{bootstrap => bootprint}/images/view_grid.png (100%) rename themes/{bootstrap => bootprint}/images/view_list.png (100%) create mode 100644 themes/bootprint/js/vudl/config.js create mode 100644 themes/bootprint/templates/search/controls/view.phtml diff --git a/themes/bootstrap/images/view_grid.png b/themes/bootprint/images/view_grid.png similarity index 100% rename from themes/bootstrap/images/view_grid.png rename to themes/bootprint/images/view_grid.png diff --git a/themes/bootstrap/images/view_list.png b/themes/bootprint/images/view_list.png similarity index 100% rename from themes/bootstrap/images/view_list.png rename to themes/bootprint/images/view_list.png diff --git a/themes/bootprint/js/vudl/config.js b/themes/bootprint/js/vudl/config.js new file mode 100644 index 00000000000..0fb9153a920 --- /dev/null +++ b/themes/bootprint/js/vudl/config.js @@ -0,0 +1,11 @@ +var vudlSettings = { + 'accordion': { + 'bottom' :20, // Pixels from the bottom to adjust accordion + 'headerHeight':26 // Height of the headers, plus top-bottom margins + }, + 'scroll': { + 'top' :100, // Pixels above to of accordion to trigger loading + 'bottom' :300, // Pixels below + 'selected':10 // When scrolling to selected, spacing from top + }, +} \ No newline at end of file diff --git a/themes/bootprint/templates/search/controls/view.phtml b/themes/bootprint/templates/search/controls/view.phtml new file mode 100644 index 00000000000..ab1e6380cfd --- /dev/null +++ b/themes/bootprint/templates/search/controls/view.phtml @@ -0,0 +1,11 @@ +<div class="pull-right"> +<? $viewList = $this->params->getViewList(); if (count($viewList) > 1): ?> + <? foreach ($viewList as $viewType => $viewData): ?> + <? if (!$viewData['selected']): ?> + <a href="<?=$this->results->getUrlQuery()->setViewParam($viewType)?>" title="<?=$this->transEsc('Switch view to')?> <?=$this->transEsc($viewData['desc'])?>" > + <? endif; ?> + <img src="<?=$this->imageLink('view_'.$viewType.'.png') ?>"<? if($viewData['selected']): ?> title="<?=$this->transEsc($viewData['desc']) ?> <?=$this->transEsc('view already selected') ?>" <? endif ?> alt="<?=$this->transEsc($viewData['desc'])?>"/> + <?=ucfirst($this->transEsc($viewType)) ?> <?=$this->transEsc('view') ?><? if (!$viewData['selected']): ?></a><? endif; ?> + <? endforeach; ?> +<? endif; ?> +</div> diff --git a/themes/bootstrap/css/bootstrap-custom.css b/themes/bootstrap/css/bootstrap-custom.css index 3b20ec2c68c..b72c191c600 100644 --- a/themes/bootstrap/css/bootstrap-custom.css +++ b/themes/bootstrap/css/bootstrap-custom.css @@ -1,4 +1,5 @@ h2,#modal h3 {margin-bottom:20px;font-size:21px;font-weight:200;line-height:30px} #modal h3 {margin-bottom:0px} +.icon-grid:before {content: "\f00a"} .result {border-top:1px solid #DDD;padding:1em 0} .tab-container {border:1px solid #DDD;border-top:0;border-radius:0 0 4px 4px;margin-top:-20px;padding:12px;position:relative} \ No newline at end of file diff --git a/themes/bootstrap/templates/search/controls/view.phtml b/themes/bootstrap/templates/search/controls/view.phtml index ab1e6380cfd..374a593d1f0 100644 --- a/themes/bootstrap/templates/search/controls/view.phtml +++ b/themes/bootstrap/templates/search/controls/view.phtml @@ -4,7 +4,7 @@ <? if (!$viewData['selected']): ?> <a href="<?=$this->results->getUrlQuery()->setViewParam($viewType)?>" title="<?=$this->transEsc('Switch view to')?> <?=$this->transEsc($viewData['desc'])?>" > <? endif; ?> - <img src="<?=$this->imageLink('view_'.$viewType.'.png') ?>"<? if($viewData['selected']): ?> title="<?=$this->transEsc($viewData['desc']) ?> <?=$this->transEsc('view already selected') ?>" <? endif ?> alt="<?=$this->transEsc($viewData['desc'])?>"/> + <i class="icon-<?=$viewType ?>"<? if($viewData['selected']): ?> title="<?=$this->transEsc($viewData['desc']) ?> <?=$this->transEsc('view already selected') ?>" <? endif ?> alt="<?=$this->transEsc($viewData['desc'])?>"></i> <?=ucfirst($this->transEsc($viewType)) ?> <?=$this->transEsc('view') ?><? if (!$viewData['selected']): ?></a><? endif; ?> <? endforeach; ?> <? endif; ?> -- GitLab