Skip to content
Snippets Groups Projects
Commit c106cf12 authored by Chris Hallberg's avatar Chris Hallberg
Browse files

Per column cart settings in combined for blueprint and bootstrap.

parent ce2f4b7c
No related merge requests found
Showing
with 105 additions and 27 deletions
.main {padding:0;} .main {padding:0;}
.main .combined-list {margin:0 2px;} .main .combined-list {margin:0 2px;}
.main .combined-list .result [class^=span-] {width:100%;} .main .combined-list .result [class^=span-] {width:100%;}
.main .combined-list .result .summcover {display:block;margin:0 auto;} .main .combined-list .result .summcover {display:block;margin:0 auto;}
\ No newline at end of file .main .combined-list .result .span-15 {margin-left:5px;width:80%}
\ No newline at end of file
...@@ -64,8 +64,18 @@ ...@@ -64,8 +64,18 @@
<?=$this->recommend($current)?> <?=$this->recommend($current)?>
<? endforeach; ?> <? endforeach; ?>
<? else: ?> <? else: ?>
<? $viewType = in_array('list', array_keys($params->getViewList())) ? 'list' : $params->getView(); ?> <?
<?=$this->render('search/list-' . $viewType . '.phtml', array('results' => $results, 'params' => $params))?> $viewType = in_array('list', array_keys($params->getViewList()))
? 'list' : $params->getView();
$viewParams = array(
'results' => $results,
'params' => $params
);
if(isset($this->showCartControls) && !$this->showCartControls) {
$viewParams['hideCartControls'] = true;
}
?>
<?=$this->render('search/list-' . $viewType . '.phtml', $viewParams)?>
<? if ($currentSearch['more_link']): ?> <? if ($currentSearch['more_link']): ?>
<p class="more_link"><a href="<?=$moreUrl?>"><?=$this->transEsc($currentSearch['more_link'])?></a></p> <p class="more_link"><a href="<?=$moreUrl?>"><?=$this->transEsc($currentSearch['more_link'])?></a></p>
<? endif; ?> <? endif; ?>
......
...@@ -34,6 +34,9 @@ ...@@ -34,6 +34,9 @@
$this->escapeHtml($lookfor) . '</em>'; $this->escapeHtml($lookfor) . '</em>';
} }
// Enable cart if appropriate:
$this->showCartControls = $this->supportsCart && $this->cart()->isActive();
// Load Javascript dependencies into header: // Load Javascript dependencies into header:
$this->headScript()->appendFile("check_item_statuses.js"); $this->headScript()->appendFile("check_item_statuses.js");
$this->headScript()->appendFile("check_save_statuses.js"); $this->headScript()->appendFile("check_save_statuses.js");
...@@ -49,7 +52,15 @@ ...@@ -49,7 +52,15 @@
</div> </div>
<? endif; ?> <? endif; ?>
<?=$this->flashmessages()?> <?=$this->flashmessages()?>
<?=$this->context($this)->renderInContext('combined/stack-'.$placement.'.phtml', array('searchClassId' => $searchClassId, 'combinedResults' => $this->combinedResults))?> <?
$viewParams = array(
'searchClassId' => $searchClassId,
'combinedResults' => $this->combinedResults,
'supportsCartOptions' => $this->supportsCartOptions,
'showCartControls' => $this->showCartControls
);
?>
<?=$this->context($this)->renderInContext('combined/stack-'.$placement.'.phtml', $viewParams)?>
</div> </div>
<? /* End Main Listing */ ?> <? /* End Main Listing */ ?>
......
...@@ -14,10 +14,17 @@ ...@@ -14,10 +14,17 @@
<? $currentSearch = $searches[$columnIndex]; ?> <? $currentSearch = $searches[$columnIndex]; ?>
<? if ((!isset($currentSearch['ajax']) || !$currentSearch['ajax']) && isset($currentSearch['hide_if_empty']) && $currentSearch['hide_if_empty'] && $currentSearch['view']->results->getResultTotal() == 0) { $columnIndex += $columns; continue; } ?> <? if ((!isset($currentSearch['ajax']) || !$currentSearch['ajax']) && isset($currentSearch['hide_if_empty']) && $currentSearch['hide_if_empty'] && $currentSearch['view']->results->getResultTotal() == 0) { $columnIndex += $columns; continue; } ?>
<div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>"> <div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
<? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?> <?
<?=$this->render('combined/results-' . $templateSuffix . '.phtml', array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch))?> $viewParams = array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch);
// Enable cart if appropriate:
$viewParams['showCartControls'] = $this->supportsCartOptions[$columnIndex] && $this->showCartControls;
?>
<div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
<? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?>
<?=$this->render('combined/results-' . $templateSuffix . '.phtml', $viewParams)?>
</div>
</div> </div>
<? $columnIndex += $columns ?> <? $columnIndex += $columns ?>
<? endwhile; ?> <? endwhile; ?>
</div> </div>
<? endfor; ?> <? endfor; ?>
\ No newline at end of file
...@@ -21,8 +21,15 @@ ...@@ -21,8 +21,15 @@
<? $currentSearch = $searches[$columnIndex]; ?> <? $currentSearch = $searches[$columnIndex]; ?>
<div class="span-<?=$span ?> combined-list"> <div class="span-<?=$span ?> combined-list">
<div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>"> <div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
<? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?> <?
<?=$this->render('combined/results-' . $templateSuffix . '.phtml', array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch))?> $viewParams = array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch);
// Enable cart if appropriate:
$viewParams['showCartControls'] = $this->supportsCartOptions[$columnIndex] && $this->showCartControls;
?>
<div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
<? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?>
<?=$this->render('combined/results-' . $templateSuffix . '.phtml', $viewParams)?>
</div>
</div> </div>
</div> </div>
<? endfor; ?> <? endfor; ?>
\ No newline at end of file
...@@ -7,11 +7,18 @@ ...@@ -7,11 +7,18 @@
<div class="span-<?=$span ?> combined-list"> <div class="span-<?=$span ?> combined-list">
<? endif; ?> <? endif; ?>
<div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>"> <div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
<? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?> <?
<?=$this->render('combined/results-' . $templateSuffix . '.phtml', array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch))?> $viewParams = array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch);
// Enable cart if appropriate:
$viewParams['showCartControls'] = $this->supportsCartOptions[$columnIndex] && $this->showCartControls;
?>
<div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
<? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?>
<?=$this->render('combined/results-' . $templateSuffix . '.phtml', $viewParams)?>
</div>
</div> </div>
<? ++$columnIndex ?> <? ++$columnIndex ?>
<? if($columnIndex < $columns || $columnIndex == $sectionCount): ?> <? if($columnIndex < $columns || $columnIndex == $sectionCount): ?>
</div> </div>
<? endif; ?> <? endif; ?>
<? endforeach; ?> <? endforeach; ?>
\ No newline at end of file
.combined-list .result .left {width:23.0769%} .combined-list .result .left {margin:0;width:25%}
.combined-list .result .middle {width:65.812%} .combined-list .result .middle {margin:0;width:65%}
.combined-list .result .right {display:none} .combined-list .result .right {display:none}
.result {padding-right:0}
.result > .checkbox {padding-right:0;width:10%}
.result > .span11 {margin:0;width:85%}
.form-inline > .clearfix {margin-left:7px}
...@@ -66,8 +66,11 @@ ...@@ -66,8 +66,11 @@
<? <?
$viewType = in_array('list', array_keys($params->getViewList())) $viewType = in_array('list', array_keys($params->getViewList()))
? 'list' : $params->getView(); ? 'list' : $params->getView();
$viewParams = array('results' => $results, 'params' => $params); $viewParams = array(
if (!$params->getOptions()->supportsCart()) { 'results' => $results,
'params' => $params
);
if(isset($this->showCartControls) && !$this->showCartControls) {
$viewParams['hideCartControls'] = true; $viewParams['hideCartControls'] = true;
} }
?> ?>
......
...@@ -34,6 +34,9 @@ ...@@ -34,6 +34,9 @@
$this->escapeHtml($lookfor) . '</li>'; $this->escapeHtml($lookfor) . '</li>';
} }
// Enable cart if appropriate:
$this->showCartControls = $this->supportsCart && $this->cart()->isActive();
// Load Javascript dependencies into header: // Load Javascript dependencies into header:
$this->headScript()->appendFile("check_item_statuses.js"); $this->headScript()->appendFile("check_item_statuses.js");
$this->headScript()->appendFile("check_save_statuses.js"); $this->headScript()->appendFile("check_save_statuses.js");
...@@ -49,12 +52,20 @@ ...@@ -49,12 +52,20 @@
<? endforeach; ?> <? endforeach; ?>
</div> </div>
<? endif; ?> <? endif; ?>
<? if ($this->supportsCart && $this->cart()->isActive()): ?> <? if ($this->showCartControls): ?>
<div class="clearfix"> <div class="clearfix">
<?=$this->context($this)->renderInContext('search/bulk-action-buttons.phtml', array('idPrefix' => ''))?> <?=$this->context($this)->renderInContext('search/bulk-action-buttons.phtml', array('idPrefix' => ''))?>
</div> </div>
<? endif; ?> <? endif; ?>
<?=$this->context($this)->renderInContext('combined/stack-'.$placement.'.phtml', array('searchClassId' => $searchClassId, 'combinedResults' => $this->combinedResults))?> <?
$viewParams = array(
'searchClassId' => $searchClassId,
'combinedResults' => $this->combinedResults,
'supportsCartOptions' => $this->supportsCartOptions,
'showCartControls' => $this->showCartControls
);
?>
<?=$this->context($this)->renderInContext('combined/stack-'.$placement.'.phtml', $viewParams)?>
<? $recs = $combinedResults->getRecommendations('bottom'); if (!empty($recs)): ?> <? $recs = $combinedResults->getRecommendations('bottom'); if (!empty($recs)): ?>
<div> <div>
<? foreach ($recs as $current): ?> <? foreach ($recs as $current): ?>
......
...@@ -14,9 +14,14 @@ ...@@ -14,9 +14,14 @@
<? $searchClassId = $keys[$columnIndex]; ?> <? $searchClassId = $keys[$columnIndex]; ?>
<? $currentSearch = $searches[$columnIndex]; ?> <? $currentSearch = $searches[$columnIndex]; ?>
<? if ((!isset($currentSearch['ajax']) || !$currentSearch['ajax']) && isset($currentSearch['hide_if_empty']) && $currentSearch['hide_if_empty'] && $currentSearch['view']->results->getResultTotal() == 0) { $columnIndex += $columns; continue; } ?> <? if ((!isset($currentSearch['ajax']) || !$currentSearch['ajax']) && isset($currentSearch['hide_if_empty']) && $currentSearch['hide_if_empty'] && $currentSearch['view']->results->getResultTotal() == 0) { $columnIndex += $columns; continue; } ?>
<?
$viewParams = array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch);
// Enable cart if appropriate:
$viewParams['showCartControls'] = $this->supportsCartOptions[$columnIndex] && $this->showCartControls;
?>
<div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>"> <div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
<? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?> <? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?>
<?=$this->render('combined/results-' . $templateSuffix . '.phtml', array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch))?> <?=$this->render('combined/results-' . $templateSuffix . '.phtml', $viewParams)?>
</div> </div>
<? $columnIndex += $columns ?> <? $columnIndex += $columns ?>
<? endwhile; ?> <? endwhile; ?>
......
...@@ -11,9 +11,14 @@ ...@@ -11,9 +11,14 @@
<? for ($columnIndex = $columns-1;$columnIndex < $sectionCount;$columnIndex++): ?> <? for ($columnIndex = $columns-1;$columnIndex < $sectionCount;$columnIndex++): ?>
<? $searchClassId = $keys[$columnIndex]; ?> <? $searchClassId = $keys[$columnIndex]; ?>
<? $currentSearch = $searches[$columnIndex]; ?> <? $currentSearch = $searches[$columnIndex]; ?>
<?
$viewParams = array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch);
// Enable cart if appropriate:
$viewParams['showCartControls'] = $this->supportsCartOptions[$columnIndex] && $this->showCartControls;
?>
<div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>"> <div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
<? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?> <? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?>
<?=$this->render('combined/results-' . $templateSuffix . '.phtml', array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch))?> <?=$this->render('combined/results-' . $templateSuffix . '.phtml', $viewParams)?>
</div> </div>
<? endfor; ?> <? endfor; ?>
</div> </div>
......
...@@ -7,10 +7,15 @@ ...@@ -7,10 +7,15 @@
<? if ($columnIndex < $columns): ?> <? if ($columnIndex < $columns): ?>
<div class="span<?=$span ?> combined-list"> <div class="span<?=$span ?> combined-list">
<? endif; ?> <? endif; ?>
<div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>"> <?
<? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?> $viewParams = array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch);
<?=$this->render('combined/results-' . $templateSuffix . '.phtml', array('searchClassId' => $searchClassId, 'currentSearch' => $currentSearch))?> // Enable cart if appropriate:
</div> $viewParams['showCartControls'] = $this->supportsCartOptions[$columnIndex] && $this->showCartControls;
?>
<div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
<? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?>
<?=$this->render('combined/results-' . $templateSuffix . '.phtml', $viewParams)?>
</div>
<? ++$columnIndex ?> <? ++$columnIndex ?>
<? if($columnIndex < $columns || $columnIndex == $sectionCount): ?> <? if($columnIndex < $columns || $columnIndex == $sectionCount): ?>
</div> </div>
......
...@@ -68,9 +68,11 @@ ...@@ -68,9 +68,11 @@
? 'list' : $params->getView(); ? 'list' : $params->getView();
$viewParams = array( $viewParams = array(
'results' => $results, 'results' => $results,
'params' => $params, 'params' => $params
'showCartControls' => $this->showCartControls
); );
if(isset($this->showCartControls) && !$this->showCartControls) {
$viewParams['hideCartControls'] = true;
}
?> ?>
<?=$this->render('search/list-' . $viewType . '.phtml', $viewParams)?> <?=$this->render('search/list-' . $viewType . '.phtml', $viewParams)?>
<? if ($currentSearch['more_link']): ?> <? if ($currentSearch['more_link']): ?>
......
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