Commit 16cef9b4 authored by Dominik Hebeler's avatar Dominik Hebeler

Fixed layout for settings button

parent 6095ec77
...@@ -1457,6 +1457,30 @@ class MetaGer ...@@ -1457,6 +1457,30 @@ class MetaGer
return $this->searchUid; return $this->searchUid;
} }
public function getManualParameterFilterSet()
{
$filters = $this->sumaFile->filter->{"parameter-filter"};
foreach ($filters as $filterName => $filter) {
if (\Request::filled($filter->{"get-parameter"})) {
return true;
}
}
return false;
}
public function getSavedSettingCount()
{
$cookies = \Cookie::get();
$count = 0;
foreach ($cookies as $key => $value) {
if (starts_with($key, [$this->getFokus() . "_setting_", $this->getFokus() . "_engine_"])) {
$count++;
}
}
return $count;
}
# Einfache Getter # Einfache Getter
public function getVerificationId() public function getVerificationId()
......
...@@ -508,19 +508,48 @@ a { ...@@ -508,19 +508,48 @@ a {
transform: scaleY(0); transform: scaleY(0);
transition: transform .5s, max-height .5s; transition: transform .5s, max-height .5s;
} }
input[type=checkbox]:checked + div.scrollbox, input[type=checkbox]:checked + div.scrollbox + div#settings { input[type=checkbox]:checked + div.scrollbox{
max-height:200px; max-height:200px;
transform: scaleY(1); transform: scaleY(1);
} }
#toggle-box { #toggle-box {
display: flex; display: flex;
align-items: center; align-items: center;
margin-left: -8px;
@media(max-width: 350px){
flex-direction: row-reverse;
flex-wrap: wrap-reverse;
justify-content: space-around;
> div {
margin-top: 8px;
margin-bottom: 8px;
}
#filter-toggle {
flex-direction: column;
}
#settings {
}
#result-count{
}
}
> div {
margin-left: 8px;
}
#filter-toggle {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
flex-grow: 0;
margin-left: 0px;
>div {
margin-left: 8px;
}
}
#result-count { #result-count {
flex-grow: 1; flex-grow: 1;
text-align: right; text-align: right;
} width: 100%;
#options-reset {
margin-left: 10px;
} }
.option-toggle { .option-toggle {
text-align: center; text-align: center;
...@@ -536,8 +565,6 @@ a { ...@@ -536,8 +565,6 @@ a {
justify-content: left; justify-content: left;
overflow: hidden; overflow: hidden;
overflow-x: auto; overflow-x: auto;
border-bottom: 1px solid #ccc;
padding-bottom: 8px;
padding-top: 8px; padding-top: 8px;
#options-items { #options-items {
display: -ms-flexbox; display: -ms-flexbox;
...@@ -567,18 +594,18 @@ a { ...@@ -567,18 +594,18 @@ a {
} }
} }
#settings { #settings {
max-height: 0;
transform-origin: top;
transform: scaleY(0);
transition: transform .5s, max-height .5s;
margin-top: 4px;
text-align: center; text-align: center;
a {
>form>button { color: black;
color: #777;
&:hover { &:hover {
color: red; color: red;
} }
span.badge {
margin-top: -12px;
font-size: .7em;
font-weight: normal;
}
} }
} }
} }
......
@if(sizeof($metager->getAvailableParameterFilter()) > 0) @if(sizeof($metager->getAvailableParameterFilter()) > 0)
<div id="options"> <div id="options">
<div id="toggle-box"> <div id="toggle-box">
@if(sizeof($metager->getAvailableParameterFilter()) > 0) <div id="filter-toggle">
<div class="option-toggle"> @if(sizeof($metager->getAvailableParameterFilter()) > 0)
<label class="navigation-element" for="options-toggle"> <div class="option-toggle">
<i class="fas fa-filter"></i> Filter&hellip; <label class="navigation-element" for="options-toggle">
</label> <i class="fas fa-filter"></i> Filter&hellip;
</label>
</div>
@endif
@if($metager->getManualParameterFilterSet())
<div id="options-reset">
<a href="{{$metager->generateSearchLink($metager->getFokus())}}"><nobr>{{ trans('metaGer.filter.reset') }}</nobr></a>
</div>
@endif
</div> </div>
@endif <div id="settings">
@if(sizeof($metager->getParameterFilter()) > 0) <a href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), route('settings', ["fokus" => $metager->getFokus(), "url" => url()->full()])) }}">
<div id="options-reset"> <i class="fas fa-cogs"></i>
<a href="{{$metager->generateSearchLink($metager->getFokus())}}"><nobr>{{ trans('metaGer.filter.reset') }}</nobr></a> @if($metager->getSavedSettingCount() > 0) <span class="badge badge-primary">{{ $metager->getSavedSettingCount() }}@endif</span>
Einstellungen&hellip;
</a>
</div> </div>
@endif
@if($metager->getTotalResultCount() > 0) @if($metager->getTotalResultCount() > 0)
<div id="result-count"> <div id="result-count">
~ {{$metager->getTotalResultCount()}} {{ trans('metaGer.results') }} <nobr>~ {{$metager->getTotalResultCount()}}</nobr> {{ trans('metaGer.results') }}
</div> </div>
@endif @endif
</div> </div>
...@@ -42,12 +51,6 @@ ...@@ -42,12 +51,6 @@
</div> </div>
<div class="scrollfade-right"></div> <div class="scrollfade-right"></div>
</div> </div>
<div id="settings">
<form action="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), route('settings')) }}" method="get">
<input type="hidden" name="fokus" value="{{ $metager->getFokus() }}">
<input type="hidden" name="url" value="{{ url()->full() }}">
<button type="submit">Sucheinstellungen</button>
</form>
</div>
</div> </div>
@endif @endif
Markdown is supported
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