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

Browse decolumnization.

parent fcdd1be5
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.
......@@ -131,16 +131,51 @@ footer {
/* --- Badges - blend the links in --- */
.badge a {color: #fff;}
/* --- Browse --- */
.browse.list-group .list-group-item {
/* ------ Browse ------ */
// Layout
@media (min-width: 768px) {
.browse-container { display: flex; }
.browse-list {
flex-basis: 25%;
padding-left: .5rem;
padding-right: .5rem;
}
}
// List item styling
.browse-item {
position: relative;
display: block;
padding: .5rem 1rem;
border: 1px solid @list-group-border;
border-bottom: 0;
word-wrap: break-word;
&.view-record {
padding: 2px 4px;
font-size: 85%;
text-align: right;
border-top: 0;
}
.browse-item.active {
background-color: @brand-primary;
color: #fff;
.badge {
background-color: #fff;
color: @gray-darker;
}
}
.browse-item:hover { background-color: @nav-link-hover-bg; }
.browse-item:last-child { border-bottom: 1px solid @list-group-border; }
.browse-item.with-badge {
padding-right: 3rem; // Prevent text from overlapping badge
.badge {
position: absolute;
top: .5rem;
right: .25rem;
}
}
.browse-item.view-record {
padding: 2px 4px;
font-size: 85%;
text-align: right;
border-top: 0;
}
/* --- Cart --- */
.cart-controls .checkbox {
......
......@@ -10,10 +10,10 @@
<h2><?=$this->transEsc('Choose a Category to Begin Browsing') ?>:</h2>
<? endif; ?>
<div class="row">
<div class="browse list-group col-sm-3<? if (!empty($this->categoryList)): ?> hidden-xs<? endif ?>" id="list1">
<div class="browse-container">
<div class="browse-list<? if (!empty($this->categoryList) || !empty($this->secondaryList)): ?> hidden-xs<? endif ?>" id="list1">
<? foreach ($this->browseOptions as $item=>$currentOption): ?>
<a href="<?=$this->url('browse-' . strtolower($currentOption['action'])); ?>" class="list-group-item<? if($currentOption['action'] == $this->currentAction): ?> active<? endif; ?>">
<a href="<?=$this->url('browse-' . strtolower($currentOption['action'])); ?>" class="browse-item<? if($currentOption['action'] == $this->currentAction): ?> active<? endif; ?>">
<?=$this->transEsc($currentOption['description']) ?>
<span class="pull-right flip"><i class="fa fa-angle-right" title="<?=$this->transEsc('more') ?>"></i></span>
</a>
......@@ -21,9 +21,9 @@
</div>
<? if (!empty($this->categoryList)): ?>
<div class="browse list-group col-sm-3<? if (!empty($this->secondaryList) || !empty($this->resultList)): ?> hidden-xs<? endif ?>" id="list2">
<div class="browse-list<? if (!empty($this->secondaryList) || !empty($this->resultList)): ?> hidden-xs<? endif ?>" id="list2">
<? foreach($this->categoryList as $findby=>$category): ?>
<a href="<?=$BROWSE_BASE ?>?findby=<?=urlencode($findby) ?>&amp;query_field=<?=$this->browse()->getSolrField($findby, $this->currentAction) ?>" class="list-group-item clearfix<? if ($this->findby == $findby): ?> active<? endif; ?>">
<a href="<?=$BROWSE_BASE ?>?findby=<?=urlencode($findby) ?>&amp;query_field=<?=$this->browse()->getSolrField($findby, $this->currentAction) ?>" class="browse-item<? if (!is_string($category)): ?> with-badge<? endif; ?><? if ($this->findby == $findby): ?> active<? endif; ?>">
<? if(is_string($category)): ?>
<?=$this->transEsc($category)?>
<span class="pull-right flip"><i class="fa fa-angle-right" title="<?=$this->transEsc('more') ?>"></i></span>
......@@ -37,7 +37,7 @@
<? endif; ?>
<? if (!empty($this->secondaryList)): ?>
<div class="browse list-group col-sm-3<? if (!empty($this->resultList)): ?> hidden-xs<? endif ?>" id="list3">
<div class="browse-list<? if (!empty($this->resultList)): ?> hidden-xs<? endif ?>" id="list3">
<? foreach($this->secondaryList as $secondary): ?>
<? $url = $BROWSE_BASE . '?findby=' . urlencode($this->findby)
. '&amp;category=' . urlencode($this->category)
......@@ -51,34 +51,35 @@
}
}
$viewRecord = !empty($this->categoryList) && $this->currentAction != 'Tag' && $this->findby != 'alphabetical';
$hasBadge = $this->findby != 'alphabetical' && isset($secondary['count']);
?>
<a href="<?=$url ?>" class="list-group-item clearfix<? if ($this->query == $secondary['value'].'' || $this->query == $secondary['value'].'*'): ?> active<? endif; ?>">
<a href="<?=$url ?>" class="browse-item<? if ($hasBadge): ?> with-badge<? endif; ?><? if ($this->query == $secondary['value'].'' || $this->query == $secondary['value'].'*'): ?> active<? endif; ?>">
<?=$this->escapeHtml($secondary['displayText']) ?>
<? if ($this->findby != 'alphabetical' && isset($secondary['count'])): ?>
<? if ($hasBadge): ?>
<span class="badge"><?=number_format($secondary['count']) ?></span>
<? else: ?>
<span class="pull-right flip"><i class="fa fa-angle-right" title="<?=$this->transEsc('more') ?>"></i></span>
<? endif; ?>
</a>
<? if($viewRecord): ?>
<a class="list-group-item view-record" href="<?=$SEARCH_BASE ?>?lookfor=<? if ($this->filter): ?>&amp;filter[]=<?=urlencode($this->filter) ?>%3A<?=str_replace('+AND+','&amp;filter[]=', urlencode($secondary['value'])) ?><? endif; ?>&amp;filter[]=<?=$this->browse()->getSolrField($this->currentAction) ?>%3A[* TO *]<? if($this->dewey_flag):?>&amp;sort=dewey-sort<?endif;?>"><?=$this->transEsc('View Records') ?></a>
<a class="browse-item view-record" href="<?=$SEARCH_BASE ?>?lookfor=<? if ($this->filter): ?>&amp;filter[]=<?=urlencode($this->filter) ?>%3A<?=str_replace('+AND+','&amp;filter[]=', urlencode($secondary['value'])) ?><? endif; ?>&amp;filter[]=<?=$this->browse()->getSolrField($this->currentAction) ?>%3A[* TO *]<? if($this->dewey_flag):?>&amp;sort=dewey-sort<?endif;?>"><?=$this->transEsc('View Records') ?></a>
<? endif; ?>
<? endforeach; ?>
</div>
<? endif; ?>
<? if (!empty($this->resultList)): ?>
<div class="browse list-group col-sm-3" id="list4">
<div class="browse-list" id="list4">
<? foreach($this->resultList as $result): ?>
<a class="list-group-item clearfix" href="<?=$SEARCH_BASE ?>?<?=$this->paramTitle ?><?=urlencode($result['value']) ?><? if ($this->searchParams): foreach($this->searchParams as $var=>$val): ?>&amp;<?=$var ?>=<?=urlencode($val) ?><? endforeach;endif; ?>">
<a class="browse-item with-badge" href="<?=$SEARCH_BASE ?>?<?=$this->paramTitle ?><?=urlencode($result['value']) ?><? if ($this->searchParams): foreach($this->searchParams as $var=>$val): ?>&amp;<?=$var ?>=<?=urlencode($val) ?><? endforeach;endif; ?>">
<?=$this->escapeHtml($result['displayText'])?>
<span class="badge"><?=number_format($result['count']) ?></span>
</a>
<? endforeach; ?>
</div>
<? elseif (isset($this->query)): ?>
<ul class="browse list-group col-sm-3" id="list4">
<li class="list-group-item"><?=$this->transEsc('nohit_heading') ?></li>
</ul>
<div class="browse-list" id="list4">
<span class="browse-item"><?=$this->transEsc('nohit_heading') ?></li>
</div>
<? endif; ?>
</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