Skip to content
Snippets Groups Projects
Commit 6c9ad760 authored by Chris Hallberg's avatar Chris Hallberg Committed by Demian Katz
Browse files

Decolumnize search/home.

parent 38bffd6c
No related merge requests found
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -8,6 +8,22 @@
.result .checkbox { display: none; }
}
.searchHomeContent { .clearfix(); }
.home-facet-list {
padding-left: 0;
padding-right: 1rem;
list-style: none;
}
@media (min-width: 768px) {
.search-home-facets,
.home-facet-container { display: flex; }
.home-facet {
flex: 1 1 100%;
flex-basis: auto;
}
.home-facet-list { flex: 0 1 100%; }
}
.searchForm {
margin: 0;
padding: 0;
......
......@@ -21,28 +21,27 @@
<div class="searchHomeContent">
<?
$ilsStatusScript = <<<JS
$(document).ready(function() {
$.ajax({
dataType: 'json',
method: 'GET',
data: {'offlineModeMsg':'ils_offline_home_message'},
url: VuFind.path + '/AJAX/JSON?method=getIlsStatus',
success: function(response) {
$('.searchHomeContent').append(response.data);
}
});
});
$(document).ready(function() {
$.ajax({
dataType: 'json',
method: 'GET',
data: {'offlineModeMsg':'ils_offline_home_message'},
url: VuFind.path + '/AJAX/JSON?method=getIlsStatus',
success: function(response) {
$('.searchHomeContent').append(response.data);
}
});
});
JS;
?>
<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $ilsStatusScript, 'SET'); ?>
<div class="well well-lg clearfix" role="search">
<?=$this->context($this)->renderInContext("search/searchbox.phtml", ['ignoreHiddenFilterMemory' => true])?>
</div>
<?=$this->context($this)->renderInContext("search/searchbox.phtml", ['ignoreHiddenFilterMemory' => true])?>
<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$("#searchForm_lookfor").focus();', 'SET'); ?>
</div>
<? if (isset($facetList) && is_array($facetList)): ?>
<div class="row">
<div class="search-home-facets">
<? foreach ($facetList as $field => $details): ?>
<? if (isset($this->hierarchicalFacets) && in_array($field, $this->hierarchicalFacets)): ?>
<? $this->headScript()->appendFile('vendor/jsTree/jstree.min.js'); ?>
......@@ -56,7 +55,7 @@ $(document).ready(function() {
JS;
?>
<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?>
<div class="facet <?=$field=='callnumber-first' ? 'col-sm-6' : 'col-sm-3' ?>">
<div class="home-facet <?=$this->escapeHtmlAttr($field) ?>">
<h2><?=$this->transEsc('home_browse') . ' ' . $this->transEsc($details['label'])?></h2>
<div id="facet_<?=$this->escapeHtml($field)?>" class="jstree-facet"
data-facet="<?=$this->escapeHtml($field)?>"
......@@ -70,42 +69,41 @@ JS;
<noscript>
<? endif; ?>
<? $sortedList = $this->sortFacetList($this->results, $field, $details['list'], $basicSearch); ?>
<div class="<?=$field=='callnumber-first' ? 'col-sm-6' : 'col-sm-3' ?>">
<div class="home-facet <?=$this->escapeHtmlAttr($field) ?>">
<h2><?=$this->transEsc('home_browse') . ' ' . $this->transEsc($details['label'])?></h2>
<div class="row">
<ul class="list-unstyled <?=$field == "callnumber-first" ? 'col-sm-6' : 'col-sm-12' ?>">
<? /* Special case: two columns for LC call numbers... */ ?>
<? if ($field == "callnumber-first"): ?>
<? $i = 0; foreach ($sortedList as $url => $value): ?>
<? if (!empty($value)): ?>
<li><a href="<?=$url?>"><?=$this->escapeHtml($value)?></a></li>
<? else: $i--; ?>
<? endif; ?>
<? if (++$i == 10): ?>
</ul><ul class="list-unstyled col-sm-6">
<? endif; ?>
<? endforeach; ?>
<? /* Special case: collections */ ?>
<? elseif ($field == 'hierarchy_top_title'): ?>
<? $i = 0; foreach ($sortedList as $url => $value): ?>
<? if (++$i > 10): ?>
<li><a href="<?=$this->url('collections-home')?>"><strong><?=$this->transEsc("More options")?>...</strong></a></li>
<? break; ?>
<? else: ?>
<div class="home-facet-container">
<ul class="home-facet-list">
<? /* Special case: two columns for LC call numbers... */ ?>
<? if ($field == "callnumber-first"): ?>
<? $i = 0; foreach ($sortedList as $url => $value): ?>
<? if (!empty($value)): ?>
<li><a href="<?=$url?>"><?=$this->escapeHtml($value)?></a></li>
<? else: $i--; ?>
<? endif; ?>
<? if (++$i == 10): ?>
</ul><ul class="home-facet-list">
<? endif; ?>
<? endforeach; ?>
<? /* Special case: collections */ ?>
<? elseif ($field == 'hierarchy_top_title'): ?>
<? $i = 0; foreach ($sortedList as $url => $value): ?>
<? if (++$i > 10): ?>
<li><a href="<?=$this->url('collections-home')?>"><strong><?=$this->transEsc("More options")?>...</strong></a></li>
<? break; ?>
<? endif; ?>
<li><a href="<?=$this->url('collections-bytitle')?>?title=<?=urlencode($value)?>"><?=$this->escapeHtml($value)?></a></li>
<? endif; ?>
<? endforeach; ?>
<? else: ?>
<? $i = 0; foreach ($sortedList as $url => $value): ?>
<? if (++$i > 10): ?>
<li><a href="<?=$this->url($advSearch)?>"><strong><?=$this->transEsc("More options")?>...</strong></a></li>
<? break; ?>
<? elseif (!empty($value)): ?>
<li><a href="<?=$url?>"><?=$this->escapeHtml($value)?></a></li>
<? else: $i--; ?>
<? endif; ?>
<? endforeach; ?>
<? endif; ?>
<? endforeach; ?>
<? else: ?>
<? $i = 0; foreach ($sortedList as $url => $value): ?>
<? if (++$i > 10): ?>
<li><a href="<?=$this->url($advSearch)?>"><strong><?=$this->transEsc("More options")?>...</strong></a></li>
<? break; ?>
<? elseif (!empty($value)): ?>
<li><a href="<?=$url?>"><?=$this->escapeHtml($value)?></a></li>
<? else: $i--; ?>
<? endif; ?>
<? endforeach; ?>
<? endif; ?>
</ul>
</div>
</div>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment