Skip to content
Snippets Groups Projects
Commit da55773e authored by Dorian Merz's avatar Dorian Merz Committed by Robert Lange
Browse files

refs #20241 [fid_bbi] mark new publications in result list

* position new publications marker on lower end
* show only icon of new publications marker on mobile devices
parent b34c28f7
Branches
Tags
No related merge requests found
......@@ -161,4 +161,21 @@ class Record extends \finc\View\Helper\Root\Record
return false;
}
}
public function allowDirectDelivery() {
$publishDate = (int)$this->driver->tryMethod('getPublishDateSort');
if (
$this->driver->tryMethod('getFacetAvail') === ['Local']
&& !empty(
array_intersect($this->driver->getFormats(), ['Book','Thesis'])
)
&& $publishDate > date("Y") - 2
&& $publishDate < date("Y") + 1
) {
// @TODO check availability at Herzog August Biblioothek
return true;
}
return false;
}
}
......@@ -23,6 +23,7 @@ For Subject Librarians = Für Fachreferate
From the year = Vom Jahr
Functions & Filters = Funktionen & Filter
History = Verlauf
New Publication = Neuerscheinung
New Publications = Neuerscheinungen
Open navigation = Navigation öffnen
Open search = Suche öffnen
......
......@@ -15,6 +15,7 @@ From the year = From the year
to = to
the year = the year
For Subject Librarians = For Subject Librarians
New Publication = New Publication
New Publications = New Publications
Open navigation = Open navigation
Open search = Open search
......
......@@ -102,3 +102,18 @@
display: block;
}
}
.new-publication-marker {
//push to far right
align-self: flex-end;
margin-right: g(-2.25);
//style like link
color: $link-color;
font-weight: 500;
.label {
@media (max-width: map-get($grid-breakpoints, "md")) {
display: none;
}
}
}
......@@ -158,6 +158,13 @@ $icon = $this->record($this->driver)->getIconMapping($format);
<?php endif; ?>
</div>
<?php if ($this->record($this->driver)->allowDirectDelivery()): ?>
<div class="new-publication-marker">
<span class="label"><?=$this->translate('New Publication')?></span>
<span title="<?=$this->translate('New Publication')?>"><?=$this->icon('add-book')?></span>
</div>
<?php endif; ?>
<div class="result-actions">
<?php
$isCartActive = $this->cart()->isActiveInSearch()
......
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