Skip to content
Snippets Groups Projects
Commit 33a7294a authored by Claas Kazzer's avatar Claas Kazzer :speech_balloon: Committed by Frank Morgner
Browse files

refs #10251 - improves print styles

* introduces new print.scss
* improves printing of result list, record view, and record detail view
parent 837922eb
No related merge requests found
*{background-color:#FFF;color:#000}a[href]:after{content:''}.container{margin:0}.hidden-print,.hidden-print *{display:none !important}@media print{body{padding:0}.main .container,.main .container-fluid,footer .container{border:0}.search-results-col{width:100%}.media-body .middle{width:88%}.print-full-width{width:85%}.info-col table{border:0}.record[class^='source']{border:0}.record-tabs li:not(.active){display:none}.record-tabs .table{border:0}.tab-content>.active{display:inline}.result:nth-of-type(2n){background-color:#fff}}
...@@ -83,6 +83,11 @@ body { ...@@ -83,6 +83,11 @@ body {
@media (min-width: $screen-md-min) { @media (min-width: $screen-md-min) {
padding-top: $navbar-height; padding-top: $navbar-height;
} }
//// for print
@media print {
padding-top: 0;
}
} }
// Collapse/Hide empty containers -- DO NOT INCLUDE span (dropdown carets are empty spans) NOR DIV (slider track handles) // Collapse/Hide empty containers -- DO NOT INCLUDE span (dropdown carets are empty spans) NOR DIV (slider track handles)
...@@ -1414,6 +1419,12 @@ footer { ...@@ -1414,6 +1419,12 @@ footer {
.media-left { .media-left {
min-width: 16%; min-width: 16%;
text-align: center; text-align: center;
//// remove left padding for print
@media print {
padding-left: 0;
}
} }
} }
...@@ -1458,7 +1469,7 @@ footer { ...@@ -1458,7 +1469,7 @@ footer {
// hide last and first page buttons // hide last and first page buttons
&.first, &.first,
&.last, &.last,
// select 7th to 11th child // select 7th to 11th child
&:nth-child(n+10):nth-child(-n+13) { &:nth-child(n+10):nth-child(-n+13) {
display: none; display: none;
} }
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<p><?=$this->truncate($summary, 300)?></p> <p><?=$this->truncate($summary, 300)?></p>
<? if(strlen($summary) > 300): ?> <? if(strlen($summary) > 300): ?>
<p><a href='<?=$this->recordLink()->getTabUrl($this->driver, 'Description')?>#tabnav'><?=$this->transEsc('Full description')?></a></p> <p class="hidden-print"><a href='<?=$this->recordLink()->getTabUrl($this->driver, 'Description')?>#tabnav'><?=$this->transEsc('Full description')?></a></p>
<? endif; ?> <? endif; ?>
<? endif; ?> <? endif; ?>
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<? /* Display the lists that this record is saved to */ ?> <? /* Display the lists that this record is saved to */ ?>
<div class="savedLists hidden alert alert-info"> <div class="savedLists hidden alert alert-info">
<strong><?=$this->transEsc("Saved in")?>:</strong> <strong><?=$this->transEsc("Saved in")?>:</strong>
</div> </div>
<? endif; ?> <? endif; ?>
<?/* Display Main Details */?> <?/* Display Main Details */?>
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<p><?=$this->truncate($summary, 300)?></p> <p><?=$this->truncate($summary, 300)?></p>
<? if(strlen($summary) > 300): ?> <? if(strlen($summary) > 300): ?>
<p><a href='<?=$this->recordLink()->getTabUrl($this->driver, 'Description')?>#tabnav'><?=$this->transEsc('Full description')?></a></p> <p class="hidden-print"><a href='<?=$this->recordLink()->getTabUrl($this->driver, 'Description')?>#tabnav'><?=$this->transEsc('Full description')?></a></p>
<? endif; ?> <? endif; ?>
<? endif; ?> <? endif; ?>
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<p><?=$this->truncate($summary, 300)?></p> <p><?=$this->truncate($summary, 300)?></p>
<? if(strlen($summary) > 300): ?> <? if(strlen($summary) > 300): ?>
<p><a href='<?=$this->recordLink()->getTabUrl($this->driver, 'Description')?>#tabnav'><?=$this->transEsc('Full description')?></a></p> <p class="hidden-print"><a href='<?=$this->recordLink()->getTabUrl($this->driver, 'Description')?>#tabnav'><?=$this->transEsc('Full description')?></a></p>
<? endif; ?> <? endif; ?>
<? endif; ?> <? endif; ?>
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<p><?=$this->truncate($summary, 300)?></p> <p><?=$this->truncate($summary, 300)?></p>
<? if(strlen($summary) > 300): ?> <? if(strlen($summary) > 300): ?>
<p><a href='<?=$this->recordLink()->getTabUrl($this->driver, 'Description')?>#tabnav'><?=$this->transEsc('Full description')?></a></p> <p class="hidden-print"><a href='<?=$this->recordLink()->getTabUrl($this->driver, 'Description')?>#tabnav'><?=$this->transEsc('Full description')?></a></p>
<? endif; ?> <? endif; ?>
<? endif; ?> <? endif; ?>
......
...@@ -64,8 +64,9 @@ $this->layout()->title = $this->driver->getShortTitle(); ...@@ -64,8 +64,9 @@ $this->layout()->title = $this->driver->getShortTitle();
<? /* finc-specific: Remove getToolbar from here and add it to sidebar below - CK */ ?> <? /* finc-specific: Remove getToolbar from here and add it to sidebar below - CK */ ?>
<div class="record source<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>"> <div class="record source<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?> row">
<div class="<?=$this->layoutClass('mainbody')?>"> <? /* finc-specific print... class - CK */ ?>
<div class="<?=$this->layoutClass('mainbody')?> print-full-width">
<input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" class="hiddenId"/> <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" class="hiddenId"/>
<input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>" class="hiddenSource"/> <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>" class="hiddenSource"/>
<?=$this->flashmessages()?> <?=$this->flashmessages()?>
......
...@@ -116,9 +116,7 @@ if (isset($searchDetails) && is_object($searchDetails)) { ...@@ -116,9 +116,7 @@ if (isset($searchDetails) && is_object($searchDetails)) {
</div> </div>
<? if($group == 0 && $search == 0): ?> <? if($group == 0 && $search == 0): ?>
</div> </div>
<? /* finc: moving entire original icon tag inside link WILL BUST removal-button functionality! <? /* finc: use xs-cols to improve mobile view, .middle used in print styles, CK */ ?>
(As this will also 'shift search_place_holder') Therefore Keep 'search_place_holder' separate and move icon only !
*/ ?>
<span class="float-left"> <span class="float-left">
<span class="search_place_holder hidden" aria-hidden="true"></span> <span class="search_place_holder hidden" aria-hidden="true"></span>
<a href="javascript:void(0);" class="add_search_link hidden"> <a href="javascript:void(0);" class="add_search_link hidden">
......
<!-- finc: search - results --> <!-- finc: search - results -->
<? <?
// Set up page title: // Set up page title:
$lookfor = $this->results->getUrlQuery()->isQuerySuppressed() ? '' : $this->params->getDisplayQuery(); $lookfor = $this->results->getUrlQuery()->isQuerySuppressed() ? '' : $this->params->getDisplayQuery();
if (isset($this->overrideTitle)) { if (isset($this->overrideTitle)) {
$this->headTitle($this->overrideTitle); $this->headTitle($this->overrideTitle);
} else { } else {
$this->headTitle($this->translate('Search Results') . (empty($lookfor) ? '' : " - {$lookfor}")); $this->headTitle($this->translate('Search Results') . (empty($lookfor) ? '' : " - {$lookfor}"));
} }
// Set up search box: // Set up search box:
$this->layout()->searchbox = $this->context($this)->renderInContext( $this->layout()->searchbox = $this->context($this)->renderInContext(
'search/searchbox.phtml', 'search/searchbox.phtml',
[ [
'lookfor' => $lookfor, 'lookfor' => $lookfor,
'searchIndex' => $this->params->getSearchHandler(), 'searchIndex' => $this->params->getSearchHandler(),
'searchType' => $this->params->getSearchType(), 'searchType' => $this->params->getSearchType(),
'searchId' => $this->results->getSearchId(), 'searchId' => $this->results->getSearchId(),
'searchClassId' => $this->params->getSearchClassId(), 'searchClassId' => $this->params->getSearchClassId(),
'checkboxFilters' => $this->params->getCheckboxFacets(), 'checkboxFilters' => $this->params->getCheckboxFacets(),
'filterList' => $this->params->getFilters(), 'filterList' => $this->params->getFilters(),
'hasDefaultsApplied' => $this->params->hasDefaultsApplied(), 'hasDefaultsApplied' => $this->params->hasDefaultsApplied(),
'selectedShards' => $this->params->getSelectedShards(), 'selectedShards' => $this->params->getSelectedShards(),
'ignoreHiddenFiltersInRequest' => isset($this->ignoreHiddenFiltersInRequest) ? $this->ignoreHiddenFiltersInRequest : false, 'ignoreHiddenFiltersInRequest' => isset($this->ignoreHiddenFiltersInRequest) ? $this->ignoreHiddenFiltersInRequest : false,
'ignoreHiddenFilterMemory' => isset($this->ignoreHiddenFilterMemory) ? $this->ignoreHiddenFilterMemory : false, 'ignoreHiddenFilterMemory' => isset($this->ignoreHiddenFilterMemory) ? $this->ignoreHiddenFilterMemory : false,
] ]
); );
// Set up breadcrumbs: // Set up breadcrumbs:
if (isset($this->overrideTitle)) { if (isset($this->overrideTitle)) {
$this->layout()->breadcrumbs .= '<li class="active">' . $this->escapeHtml($this->overrideTitle) . '</li>'; $this->layout()->breadcrumbs .= '<li class="active">' . $this->escapeHtml($this->overrideTitle) . '</li>';
} else { } else {
$this->layout()->breadcrumbs .= '<li class="active">' . $this->transEsc('Search') . ': ' . $this->escapeHtml($lookfor) . '</li>'; $this->layout()->breadcrumbs .= '<li class="active">' . $this->transEsc('Search') . ': ' . $this->escapeHtml($lookfor) . '</li>';
} }
// Enable cart if appropriate: // Enable cart if appropriate:
$this->showBulkOptions = $this->params->getOptions()->supportsCart() && $this->showBulkOptions; $this->showBulkOptions = $this->params->getOptions()->supportsCart() && $this->showBulkOptions;
// Checkboxes if appropriate: // Checkboxes if appropriate:
$this->showCartControls = $this->params->getOptions()->supportsCart() && $this->cart()->isActive() $this->showCartControls = $this->params->getOptions()->supportsCart() && $this->cart()->isActive()
&& ($this->showBulkOptions || !$this->cart()->isActiveInSearch()); && ($this->showBulkOptions || !$this->cart()->isActiveInSearch());
// Enable bulk options if appropriate: // Enable bulk options if appropriate:
$this->showCheckboxes = $this->showCartControls || $this->showBulkOptions; $this->showCheckboxes = $this->showCartControls || $this->showBulkOptions;
// Load Javascript only if list view parameter is NOT full: // Load Javascript only if list view parameter is NOT full:
if ($this->params->getOptions()->getListViewOption() != "full") { if ($this->params->getOptions()->getListViewOption() != "full") {
$this->headScript()->appendFile("record.js"); $this->headScript()->appendFile("record.js");
$this->headScript()->appendFile("embedded_record.js"); $this->headScript()->appendFile("embedded_record.js");
} }
// Load Javascript dependencies into header: // Load Javascript dependencies into header:
$this->headScript()->appendFile("vendor/hunt.min.js"); $this->headScript()->appendFile("vendor/hunt.min.js");
$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");
?> ?>
<div class="<?=$this->layoutClass('mainbody')?>"> <? /* finc: we need search-results-col to pull content to full width, also used in print styles! - CK */?>
<div class="<?=$this->layoutClass('mainbody')?> search-results-col">
<? if (($recordTotal = $this->results->getResultTotal()) > 0): // only display these at very top if we have results ?> <? if (($recordTotal = $this->results->getResultTotal()) > 0): // only display these at very top if we have results ?>
<? foreach ($this->results->getRecommendations('top') as $current): ?> <? foreach ($this->results->getRecommendations('top') as $current): ?>
<?=$this->recommend($current)?> <?=$this->recommend($current)?>
...@@ -70,37 +71,37 @@ ...@@ -70,37 +71,37 @@
<? endif; ?> <? endif; ?>
</div> </div>
<? if ($recordTotal > 0): ?> <? if ($recordTotal > 0): ?>
<div class="search-controls"> <div class="search-controls">
<?=$this->render('search/controls/limit.phtml')?> <?=$this->render('search/controls/limit.phtml')?>
<?=$this->render('search/controls/sort.phtml')?> <?=$this->render('search/controls/sort.phtml')?>
<?=$this->render('search/controls/view.phtml')?> <?=$this->render('search/controls/view.phtml')?>
</div> </div>
<? endif; ?> <? endif; ?>
</nav> </nav>
<? /* End Listing Options */ ?> <? /* End Listing Options */ ?>
<? if ($recordTotal < 1): ?> <? if ($recordTotal < 1): ?>
<p> <p>
<? if (isset($this->overrideEmptyMessage)): ?> <? if (isset($this->overrideEmptyMessage)): ?>
<?=$this->overrideEmptyMessage?> <?=$this->overrideEmptyMessage?>
<? else: ?> <? else: ?>
<? $this->layout()->srmessage = $this->translate('nohit_lookfor_html', ['%%lookfor%%' => $this->escapeHtml($lookfor)]); ?> <? $this->layout()->srmessage = $this->translate('nohit_lookfor_html', ['%%lookfor%%' => $this->escapeHtml($lookfor)]); ?>
<?=$this->layout()->srmessage ?> <?=$this->layout()->srmessage?>
<? endif; ?>
</p>
<? if (isset($this->parseError)): ?>
<p class="alert alert-danger"><?=$this->transEsc('nohit_parse_error')?></p>
<? endif; ?> <? endif; ?>
<? foreach (($top = $this->results->getRecommendations('top')) as $current): ?> </p>
<? if (isset($this->parseError)): ?>
<p class="alert alert-danger"><?=$this->transEsc('nohit_parse_error')?></p>
<? endif; ?>
<? foreach (($top = $this->results->getRecommendations('top')) as $current): ?>
<?=$this->recommend($current)?>
<? endforeach; ?>
<? foreach ($this->results->getRecommendations('noresults') as $current): ?>
<? if (!in_array($current, $top)): ?>
<?=$this->recommend($current)?> <?=$this->recommend($current)?>
<? endforeach; ?> <? endif; ?>
<? foreach ($this->results->getRecommendations('noresults') as $current): ?> <? endforeach; ?>
<? if (!in_array($current, $top)): ?> <? else: ?>
<?=$this->recommend($current)?>
<? endif; ?>
<? endforeach; ?>
<? else: ?>
<form id="search-cart-form" method="post" name="bulkActionForm" action="<?=$this->url('cart-searchresultsbulk')?>" data-lightbox data-lightbox-onsubmit="bulkFormHandler"> <form id="search-cart-form" method="post" name="bulkActionForm" action="<?=$this->url('cart-searchresultsbulk')?>" data-lightbox data-lightbox-onsubmit="bulkFormHandler">
<?=$this->context($this)->renderInContext('search/bulk-action-buttons.phtml', ['idPrefix' => ''])?> <?=$this->context($this)->renderInContext('search/bulk-action-buttons.phtml', ['idPrefix' => ''])?>
</form> </form>
...@@ -108,33 +109,34 @@ ...@@ -108,33 +109,34 @@
<?=$this->context($this)->renderInContext('search/bulk-action-buttons.phtml', ['idPrefix' => 'bottom_', 'formAttr' => 'search-cart-form'])?> <?=$this->context($this)->renderInContext('search/bulk-action-buttons.phtml', ['idPrefix' => 'bottom_', 'formAttr' => 'search-cart-form'])?>
<?=$this->paginationControl($this->results->getPaginator(), 'Sliding', 'search/pagination.phtml', ['results' => $this->results, 'options' => isset($this->paginationOptions) ? $this->paginationOptions : []])?> <?=$this->paginationControl($this->results->getPaginator(), 'Sliding', 'search/pagination.phtml', ['results' => $this->results, 'options' => isset($this->paginationOptions) ? $this->paginationOptions : []])?>
<div class="searchtools hidden-print"> <div class="searchtools hidden-print">
<strong><?=$this->transEsc('Search Tools')?>:</strong> <strong><?=$this->transEsc('Search Tools')?>:</strong>
<a href="<?=$this->results->getUrlQuery()->setViewParam('rss')?>"><i class="fa fa-bell" aria-hidden="true"></i> <?=$this->transEsc('Get RSS Feed')?></a> <a href="<?=$this->results->getUrlQuery()->setViewParam('rss')?>"><i class="fa fa-bell" aria-hidden="true"></i> <?=$this->transEsc('Get RSS Feed')?></a>
&mdash;
<a href="<?=$this->url('search-email')?>" class="mailSearch" data-lightbox id="mailSearch<?=$this->escapeHtmlAttr($this->results->getSearchId())?>">
<i class="fa fa-envelope" aria-hidden="true"></i> <?=$this->transEsc('Email this Search')?>
</a>
<? if ($this->accountCapabilities()->getSavedSearchSetting() === 'enabled'): ?>
&mdash; &mdash;
<a href="<?=$this->url('search-email')?>" class="mailSearch" data-lightbox id="mailSearch<?=$this->escapeHtmlAttr($this->results->getSearchId())?>"> <? if (is_numeric($this->results->getSearchId())): ?>
<i class="fa fa-envelope" aria-hidden="true"></i> <?=$this->transEsc('Email this Search')?> <? if ($this->results->isSavedSearch()): ?>
</a> <a href="<?=$this->url('myresearch-savesearch')?>?delete=<?=urlencode($this->results->getSearchId())?>"><i class="fa fa-remove"
<? if ($this->accountCapabilities()->getSavedSearchSetting() === 'enabled'): ?> aria-hidden="true"></i> <?=$this->transEsc('save_search_remove')?></a>
&mdash; <? else: ?>
<? if (is_numeric($this->results->getSearchId())): ?> <a href="<?=$this->url('myresearch-savesearch')?>?save=<?=urlencode($this->results->getSearchId())?>"><i class="fa fa-save" aria-hidden="true"></i> <?=$this->transEsc('save_search')?></a>
<? if ($this->results->isSavedSearch()): ?>
<a href="<?=$this->url('myresearch-savesearch')?>?delete=<?=urlencode($this->results->getSearchId())?>"><i class="fa fa-remove" aria-hidden="true"></i> <?=$this->transEsc('save_search_remove')?></a>
<? else: ?>
<a href="<?=$this->url('myresearch-savesearch')?>?save=<?=urlencode($this->results->getSearchId())?>"><i class="fa fa-save" aria-hidden="true"></i> <?=$this->transEsc('save_search')?></a>
<? endif; ?>
<? endif; ?> <? endif; ?>
<? endif; ?> <? endif; ?>
</div> <? endif; ?>
<? endif; ?> </div>
</div> <? endif; ?>
<? /* End Main Listing */ ?> </div>
<? /* End Main Listing */ ?>
<? /* Narrow Search Options */ ?> <? /* Narrow Search Options */ ?>
<div class="<?=$this->layoutClass('sidebar')?>"> <div class="<?=$this->layoutClass('sidebar')?>">
<? foreach ($this->results->getRecommendations('side') as $current): ?> <? foreach ($this->results->getRecommendations('side') as $current): ?>
<?=$this->recommend($current)?> <?=$this->recommend($current)?>
<? endforeach; ?> <? endforeach; ?>
</div> </div>
<? /* End Narrow Search Options */ ?> <? /* End Narrow Search Options */ ?>
<!-- finc: search - results - END --> <!-- finc: search - results - END -->
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