Commit f66cd182 authored by Dominik Hebeler's avatar Dominik Hebeler

Quicktip für die Sprachauswahl hinzugefügt

parent 5633368a
......@@ -45,7 +45,7 @@ class MetaGerSearch extends Controller
->with('r', $redirect);
}
public function quicktips(Request $request)
public function quicktips(Request $request, MetaGer $metager)
{
$q = $request->input('q', '');
......@@ -99,12 +99,12 @@ class MetaGerSearch extends Controller
$searchWords = explode(' ', $q);
$within = false;
foreach($searchWords as $word){
if(stripos($result["name"], $word) !== false){
foreach ($searchWords as $word) {
if (stripos($result["name"], $word) !== false) {
$within = true;
}
}
if($within){
if ($within) {
$weather = [];
$weather["title"] = "Wetter in " . $result["name"];
$weather["URL"] = "http://openweathermap.org/city/" . $result["id"];
......
......@@ -877,12 +877,6 @@ class MetaGer
if ($this->lang !== "de" && $this->lang !== "en" && $this->lang !== "all") {
$this->lang = "all";
}
if ($this->lang !== 'all') {
# Warnung hinzufügen, dass die Ergebnisse gefiltert sind.
$this->warnings[] = trans('results.filter', ['langName' => LaravelLocalization::getSupportedLocales()[LaravelLocalization::getCurrentLocale()]['native'], 'link' => $this->getUnFilteredLink(), 'filter' => $this->lang]);
} else {
$this->warnings[] = trans('results.filter.default', ['langName' => LaravelLocalization::getSupportedLocales()[LaravelLocalization::getCurrentLocale()]['native']]);
}
$this->agent = new Agent();
$this->mobile = $this->agent->isMobile();
......@@ -1237,6 +1231,7 @@ class MetaGer
public function getUnFilteredLink()
{
$requestData = $this->request->except(['lang']);
$requestData['lang'] = "all";
$link = action('MetaGerSearch@search', $requestData);
return $link;
}
......
......@@ -4,6 +4,6 @@ return [
'redirect' => '(mit redirect)',
'weiter' => 'Weitersuchen',
'zurueck' => 'Zurück',
'filter' => 'Die Suchergebnisse wurden gefiltert: <strong>[:filter]</strong>. <a href=":link">Filter abschalten.</a>',
'filter' => 'Die Suchergebnisse wurden gefiltert: <strong>[:filter]</strong>. <a href=":link" target="_blank">Filter abschalten.</a>',
'filter.default' => 'Sie erhalten die Benutzeroberfläche in <strong>:langName</strong>, aber Ergebnisse in <strong>ALLEN</strong> Sprachen. Für ausschließlich deutschsprachige Ergebnisse können Sie unter <a href="/settings" target="_blank">anpassen</a> die "Sprache auswählen".',
];
......@@ -56,7 +56,7 @@
@if( $metager->showQuicktips() )
<div class="hidden-xs col-md-4" id="quicktips">
<iframe class="col-mod-4 hidden-xs hidden-sm" src="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/qt") }}?q={{ $metager->getQ() }}&sprueche={{ $metager->getSprueche() }}"></iframe>
<iframe class="col-mod-4 hidden-xs hidden-sm" src="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/qt") }}?q={{ $metager->getQ() }}&sprueche={{ $metager->getSprueche() }}&lang={{ Request::input('lang', 'all') }}&unfilteredLink={{ base64_encode($metager->getUnfilteredLink()) }}"></iframe>
</div>
@endif
@endsection
......@@ -50,6 +50,23 @@
@endif
</div>
@endforeach
<div class="quicktip">
<details>
<summary>
<div class="media">
<div class="media-body">
<div>
@if( Request::input('lang') === "all")
{!! trans('results.filter.default', ['langName' => LaravelLocalization::getSupportedLocales()[LaravelLocalization::getCurrentLocale()]['native']]) !!}
@else
{!! trans('results.filter', ['langName' => LaravelLocalization::getSupportedLocales()[LaravelLocalization::getCurrentLocale()]['native'], 'link' => base64_decode(Request::input('unfilteredLink','')), 'filter' => Request::input('lang')]) !!}
@endif
</div>
</div>
</div>
</summary>
</details>
</div>
<script src="/js/quicktips.js">
</script>
</body>
......
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