Skip to content
Snippets Groups Projects
Commit d0c147f0 authored by Karl Hasselbring's avatar Karl Hasselbring
Browse files

Merge branch 'development' into 730-tabindex-und-autofokus-verwenden

parents 7e498a2c 6e34f0ae
No related branches found
No related tags found
1 merge request!1365Resolve "Filter Options for MetaGer"
Showing
with 327 additions and 230 deletions
......@@ -5,7 +5,6 @@ namespace App\Http\Controllers;
use App;
use App\MetaGer;
use Illuminate\Http\Request;
use LaravelLocalization;
class MetaGerSearch extends Controller
{
......@@ -13,15 +12,15 @@ class MetaGerSearch extends Controller
{
$focus = $request->input("focus", "web");
if ($focus === "maps") {
$searchinput = $request->input('eingabe', '');
return redirect()->to('https://maps.metager.de/map/' . $searchinput . '/1240908.5493525574,6638783.2192695495,6');
}
/*if ($focus !== "angepasst" && $this->startsWith($focus, "focus_")) {
$metager->parseFormData($request);
return $metager->createView();
$metager->parseFormData($request);
return $metager->createView();
}*/
#die($request->header('User-Agent'));
......@@ -35,7 +34,7 @@ class MetaGerSearch extends Controller
# Die Quicktips als Job erstellen
$quicktips = $metager->createQuicktips();
# Suche für alle zu verwendenden Suchmaschinen als Job erstellen,
# Suche für alle zu verwendenden Suchmaschinen als Job erstellen,
# auf Ergebnisse warten und die Ergebnisse laden
$metager->createSearchEngines($request);
......@@ -62,7 +61,7 @@ class MetaGerSearch extends Controller
public function get($url)
{
$ctx = stream_context_create(array('http'=>array('timeout' => 2,)));
$ctx = stream_context_create(array('http' => array('timeout' => 2)));
return file_get_contents($url, false, $ctx);
}
......
......@@ -13,6 +13,7 @@ class Quicktips
use DispatchesJobs;
const QUICKTIP_URL = "https://quicktips.metager3.de/quicktips.xml";
//const QUICKTIP_URL = "http://localhost:63825/quicktips.xml";
const QUICKTIP_NAME = "quicktips";
const CACHE_DURATION = 60;
......@@ -25,7 +26,7 @@ class Quicktips
public function startSearch($search, $locale, $max_time)
{
$url = self::QUICKTIP_URL . "?search=" . $search . "&locale=" . $locale;
$url = self::QUICKTIP_URL . "?search=" . $this->normalize_search($search) . "&locale=" . $locale;
$hash = md5($url);
......@@ -82,6 +83,7 @@ class Quicktips
Redis::hdel('search.' . $hash, self::QUICKTIP_NAME);
Cache::put($hash, $body, self::CACHE_DURATION);
#}
if ($body !== "") {
return $body;
} else {
......@@ -168,4 +170,9 @@ class Quicktips
return [];
}
}
public function normalize_search($search)
{
return urlencode($search);
}
}
......@@ -4,8 +4,9 @@
@import "./result-saver.less";
@import "./result.less";
@import "./product.less";
@result-width: 700px;
@quicktip-width: 500px;
//
@resultpage-background-color: #FAFAFA;
//
@results-margin-left: @resultpage-leftbox-big-screen-margin-left;
//
@result-page-body-background-color: @background-color;
......@@ -18,6 +19,24 @@
@a-hover-color: @result-page-a-hover-color;
@a-donation-hover-color: @result-page-a-hover-color;
@product-shop-color: @result-page-product-shop-color;
//
@results-width-min: 500px;
@results-width-max: 700px;
@additions-width-min: 400px;
@additions-width-max: 500px;
//
@resultpage-breakpoint-large: (@results-width-max + @additions-width-max + @padding-small-default * 4);
@resultpage-breakpoint-small: (@results-width-min + @additions-width-min + @padding-small-default * 4);
//
@resultpage-leftbox-max-width: @results-width-max;
@resultpage-leftbox-min-dist-left-right: @padding-small-default;
@resultpage-leftbox-min-dist-top-bottom: @padding-small-default;
@resultpage-leftbox-big-screen-margin-left: 50px;
//
@logo-size-breakpoint: (@results-width-min + @padding-small-default * 2);
//
@openSidebar-breakpoint: (@results-width-max + @padding-small-default * 2 + 60px);
//
#header-logo {
z-index: 0;
padding-right: 10px;
......@@ -27,12 +46,24 @@
font-size: 22px;
display: inline-block;
}
.screen-small {
display: none;
}
.screen-large {}
@media (max-width: @logo-size-breakpoint) {
.screen-large {
display: none;
}
.screen-small {
display: initial;
}
}
}
body {
&#resultBody {
&#resultpage-body {
background-image: inherit;
background-color: #FAFAFA;
background-color: @resultpage-background-color;
}
&.quicktips {
background-color: @quicktip-background-color;
......@@ -186,7 +217,7 @@ a {
}
.description-container {
margin: 0!important;
margin: 0 !important;
}
.options-list>li {
......@@ -211,7 +242,6 @@ a {
display: none;
}
/* Hier der Style für die Bilder */
#fit-width .masonry {
......@@ -234,7 +264,6 @@ a {
flex-wrap: wrap;
}
/* Placeholder für ladende Tabs */
.loader {
......@@ -284,7 +313,7 @@ a {
}
.lightslider {
overflow: visible!important;
overflow: visible !important;
}
#products {
......@@ -317,7 +346,6 @@ a {
}
}
/* New result style */
.content-wrapper {
......@@ -326,37 +354,178 @@ a {
}
#resultpage-container {
width: @result-width + @quicktip-width;
align-self: left;
display: flex;
justify-content: left;
margin-left: @results-margin-left;
background-color: #FAFAFA;
@media (max-width: (2 * @results-margin-left + @result-width + @quicktip-width - 1px)) {
width: @result-width;
margin: @padding-small-default;
display: grid;
grid-template-columns: @results-width-max @additions-width-max;
grid-template-areas: "searchbar ." "foki ." "results additions";
grid-column-gap: (@padding-small-default * 2);
grid-row-gap: @padding-small-default;
justify-items: stretch;
align-items: stretch;
/**/
background-color: @resultpage-background-color;
#research-bar-container {
grid-area: searchbar;
/**/
width: (@results-width-max + @padding-small-default * 2);
max-width: (@results-width-max + @padding-small-default * 2);
}
#research-bar-placeholder {
grid-area: searchbar;
/**/
max-width: @results-width-max;
}
#foki {
grid-area: foki;
/**/
max-width: @results-width-max;
}
#results-container {
grid-area: results;
/**/
max-width: @results-width-max;
.alert {
margin: @padding-small-default 0px;
}
}
#additions-container {
grid-area: additions;
/**/
//min-width: @additions-width-min;
max-width: @additions-width-max;
#search-settings {
display: none;
}
}
@media (max-width: @resultpage-breakpoint-large) {
@supports (display: grid) {
#research-bar-container {
width: ~"calc(60% - 1px)";
}
grid-template-columns:~"calc(60% - 8px)"~"calc(40% - 8px)";
grid-template-areas: "searchbar ." "foki ." "results additions";
}
}
@media (max-width: @resultpage-breakpoint-small) {
#research-bar-container {
width: 100%;
}
grid-template-columns: 100%;
grid-template-areas: "searchbar" "foki" "results";
#additions-container {
display: none;
float: right;
}
}
@media (max-width: (2 * @results-margin-left + @result-width - 1px)) {
}
#research-bar-container {
position: fixed;
z-index: 100;
top: 0;
left: 0;
background-color: @resultpage-background-color;
padding: 8px 8px 0px 8px;
#research-bar {
background-color: white;
border: 1px solid #ccc;
border-bottom: 2px solid @metager-orange;
box-shadow: 0px 1px 1.5px 0px rgba(0, 0, 0, 0.12), 1px 0px 1px 0px rgba(0, 0, 0, 0.24);
display: flex;
align-items: center;
padding: 4px;
.resultpage-searchbar {
.search-input-submit .search-input input {
border-bottom: 1px solid #ccc;
}
@media (max-width: @openSidebar-breakpoint) {
.search-focus-selector {
border-top: none;
border-radius: 5px;
}
.search-input-submit {
border-radius: 5px;
}
>* {
border-radius: 5px;
min-height: 40px;
&:not(:first-child) {
border-left: 1px solid #aaa;
}
}
}
}
}
}
#foki {
display: flex;
justify-content: left;
/*
@media (max-width: (@results-width-min + @additions-width-min - 1px)) {
width: 100%;
justify-content: center;
max-width: none;
margin: 0px;
padding: 0px @resultpage-leftbox-min-dist-left-right; // Verhindert, dass Text bei kleinen Bildschirmen an den Rand ragt
padding: @padding-small-default;
.scrollbox {
max-width: none;
margin: 0px;
#foki-box {
max-width: none;
margin: 0px;
}
}
}
#results-container {
max-width: @result-width;
@media (max-width: (4 * @padding-small-default + @results-width-max + @additions-width-max - 1px)) {
padding-left: @padding-small-default;
}
@media (max-width: (@results-width-min + @additions-width-min - 1px)) {
width: 100%;
.alert {
margin: 8px 0px;
max-width: 700px;
margin: 0px;
padding: @padding-small-default;
#research-bar {
max-width: none;
margin: 0px;
}
}
#additions-container {
padding-left: 50px;
width: @quicktip-width;
#search-settings {
display: none;
*/
#foki-box {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
width: 100%;
max-width: @resultpage-leftbox-max-width;
background-color: white;
border: 1px solid #ccc;
-webkit-box-shadow: 0px 1px 1.5px 0px rgba(0, 0, 0, 0.12), 1px 0px 1px 0px rgba(0, 0, 0, 0.24);
box-shadow: 0px 1px 1.5px 0px rgba(0, 0, 0, 0.12), 1px 0px 1px 0px rgba(0, 0, 0, 0.24);
overflow-x: visible;
padding: 10px;
@media (max-width: 700px) {
overflow-x: auto;
}
&>div {
padding: 0px 10px;
&>a {
color: black;
}
&.active>a {
border-bottom: 1px solid @metager-orange;
color: @metager-orange;
}
&:last-child {
padding-right: 20px
}
}
.edit-focus {
margin-left: 7px;
}
/* Scrollbar Style */
&::-webkit-scrollbar {
height: 0px;
/* remove scrollbar space */
background: transparent;
/* optional: just make scrollbar invisible */
}
}
}
......@@ -374,7 +543,43 @@ footer.resultPageFooter {
max-width: 700px;
margin-left: 50px;
margin-top: 20px;
@media (max-width: (2 * @results-margin-left + @result-width - 1px)) {
@media (max-width: (2 * @results-margin-left + @results-width-max - 1px)) {
margin: 20px 0 0 0;
}
}
/* Searchbar Opener */
#research-bar>.openSidebar {
display: none;
margin-right: 10px;
margin-left: 20px;
}
@media(max-width: @openSidebar-breakpoint) {
#resultpage-container>.openSidebar {
display: none;
}
#research-bar>.openSidebar {
display: initial;
}
}
/* Style-fixes for browsers that do not support grid layout */
#resultpage-container {
#results-container {
float: left;
@media (max-width: @resultpage-breakpoint-small) {
float:none;
}
}
#additions-container {
float: left;
margin-left: 20px;
@supports (display: grid) {
float: none;
margin-left: 0px;
}
}
}
\ No newline at end of file
......@@ -50,7 +50,7 @@
}
}
}
.result-body {
.resultpage-body {
margin-top: 20px;
.result-description {
margin-bottom: 3px;
......
......@@ -24,9 +24,6 @@
display: -ms-flexbox;
display: flex;
max-width: 600px;
@media (max-width: @screen-xs-max) {
max-width: initial;
}
}
.search-input {
-webkit-box-flex: 1;
......@@ -79,6 +76,9 @@
}
.search-input-submit {
border-radius: 5px;
@media (max-width: @screen-xs-max) {
max-width: initial;
}
}
.search-submit {
border-left: 1px solid #aaa;
......@@ -104,159 +104,19 @@
}
}
.resultpage-searchbar {
padding: 5px;
.search-input-submit .search-input input {
border-bottom: 1px solid #ccc;
}
@media (max-width: @screen-xs-max) {
.search-focus-selector {
border-top: none;
border-radius: 5px;
}
.search-input-submit {
border-radius: 5px;
}
>* {
border-radius: 5px;
min-height: 40px;
&:not(:first-child) {
border-left: 1px solid #aaa;
}
}
*:not(.search-submit) {
width: 100%;
}
}
}
@resultpage-leftbox-max-width: @result-width;
@resultpage-leftbox-min-dist-left-right: 8px;
@resultpage-leftbox-min-dist-top-bottom: 8px;
@resultpage-leftbox-big-screen-margin-left: 50px;
header {
padding-top: @resultpage-leftbox-min-dist-top-bottom;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
position: fixed;
z-index: 100; // Makes the header larger, so it correctly covers the non scrolling parts below
width: @resultpage-leftbox-max-width + @resultpage-leftbox-big-screen-margin-left + 10;
padding-left: @resultpage-leftbox-big-screen-margin-left;
background-color: inherit;
@media (max-width: 799px) {
width: 100%;
max-width: 799px;
margin: 0px;
padding: @resultpage-leftbox-min-dist-top-bottom @resultpage-leftbox-min-dist-left-right 0px @resultpage-leftbox-min-dist-left-right;
-webkit-box-pack: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
#research-bar {
width: 100%;
max-width: @resultpage-leftbox-max-width;
padding: 0px 30px 0px 10px;
background-color: white;
border: 1px solid #ccc;
border-bottom: 2px solid @metager-orange;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-shadow: 0px 1px 1.5px 0px rgba(0, 0, 0, 0.12), 1px 0px 1px 0px rgba(0, 0, 0, 0.24);
box-shadow: 0px 1px 1.5px 0px rgba(0, 0, 0, 0.12), 1px 0px 1px 0px rgba(0, 0, 0, 0.24);
@media (max-width: 799px) {
margin: 0px @resultpage-leftbox-min-dist-left-right;
}
}
}
header:nth-child(1) {
@media (max-width: 1400px) {
position: relative;
}
}
#foki {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: left;
-ms-flex-pack: left;
justify-content: left;
margin-left: @resultpage-leftbox-big-screen-margin-left;
padding-top: 8px;
width: @resultpage-leftbox-max-width;
@media (max-width: 799px) {
width: 100%;
margin: 0px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
padding: @resultpage-leftbox-min-dist-top-bottom @resultpage-leftbox-min-dist-left-right 0px @resultpage-leftbox-min-dist-left-right;
}
#foki-box {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
width: 100%;
max-width: @resultpage-leftbox-max-width;
background-color: white;
border: 1px solid #ccc;
-webkit-box-shadow: 0px 1px 1.5px 0px rgba(0, 0, 0, 0.12), 1px 0px 1px 0px rgba(0, 0, 0, 0.24);
box-shadow: 0px 1px 1.5px 0px rgba(0, 0, 0, 0.12), 1px 0px 1px 0px rgba(0, 0, 0, 0.24);
overflow-x: visible;
padding: 10px;
@media (max-width: 700px) {
overflow-x: auto;
}
&>div {
padding: 0px 10px;
&>a {
color: black;
}
&.active>a {
border-bottom: 1px solid @metager-orange;
color: @metager-orange;
}
&:last-child {
padding-right: 20px
}
}
.edit-focus {
margin-left: 7px;
}
/* Scrollbar Style */
&::-webkit-scrollbar {
height: 0px;
/* remove scrollbar space */
background: transparent;
/* optional: just make scrollbar invisible */
}
}
}
/* Scrollbar Style */
@scrollfade-color: white;
.scrollbox {
position: relative;
width: 100%;
max-width: @result-width;
max-width: @results-width-max;
.foki-scrollfade {
&-left,
&-right {
......@@ -295,10 +155,11 @@ header:nth-child(1) {
#search-delete-btn {
position: absolute;
right: 0;
bottom: 0px;
right: 2px;
bottom: 1px;
width: auto;
border: none;
background-color: transparent;
background-color: white;
font-size: 25px;
font-weight: normal;
}
\ No newline at end of file
......@@ -142,11 +142,13 @@ input#sideBarToggle:checked {
}
}
label#openSidebar {
position: fixed;
top: 23px;
right: 25px;
z-index: 998;
.openSidebar {
&.fixed {
position: fixed;
top: 23px;
right: 25px;
z-index: 998;
}
font-size: 36px;
line-height: 23px;
border-radius: 5px;
......
......@@ -25,7 +25,8 @@ Arial,
sans-serif;
// General textual link color.
@link-color: @metager-orange;
//
@padding-small-default: 8px;
/* Unsorted */
@quicktip-background-color: @color-white;
......
......@@ -14,7 +14,7 @@
{{ $ad->anzeigeLink }}
</a>
</div>
<div class="result-body">
<div class="resultpage-body">
<div class="result-description">
{{ $ad->descr }}
</div>
......
<header>
<div id="research-bar">
<div id="header-logo">
<a class="hidden-xs" href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/") }}">
<h1>MetaGer</h1>
</a>
<a class="visible-xs" href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/") }}">
<h1>M</h1>
</a>
</div>
<div id="header-searchbar">
@include('parts.searchbar', ['class' => 'resultpage-searchbar', 'request' => Request::method()])
<div id="resultpage-container">
<div id="research-bar-container">
<div id="research-bar">
<div id="header-logo">
<a class="screen-large" href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/") }}">
<h1>MetaGer</h1>
</a>
<a class="screen-small" href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/") }}">
<h1>M</h1>
</a>
</div>
<div id="header-searchbar">
@include('parts.searchbar', ['class' => 'resultpage-searchbar', 'request' => Request::method()])
</div>
@include('parts.sidebar-opener')
</div>
</div>
</header>
<div id="research-bar-placeholder"></div>
<div id="foki">
<div class="scrollbox">
<div class="foki-scrollfade-left"></div>
<div id="foki-box">
@include('parts.foki')
<div id="research-bar-placeholder">
</div>
@include('parts.sidebar-opener', ['class' => 'fixed'])
<div id="foki">
<div class="scrollbox">
<div class="foki-scrollfade-left"></div>
<div id="foki-box">
@include('parts.foki')
</div>
<div class="foki-scrollfade-right"></div>
</div>
<div class="foki-scrollfade-right"></div>
</div>
</div>
<div id="resultpage-container">
<div id="results-container">
@yield('results')
</div>
......
......@@ -21,7 +21,7 @@
</span>
@endif
</div>
<div class="result-body">
<div class="resultpage-body">
@if( isset($result->logo) )
<div class="result-logo">
<a href="{{ $result->link }}" target="{{ $metager->getNewtab() }}" rel="noopener">
......
......@@ -23,7 +23,7 @@
<meta name="referrer" content="origin">
@include('parts.utility')
</head>
<body id="resultBody">
<body id="resultpage-body">
@if(Request::getHttpHost() === "metager3.de")
<div class="alert alert-info" style="text-align: center; position: fixed; bottom: 0;">
Sie befinden sich auf einer MetaGer Testversion. Hier werden Features vor der Veröffentlichung getestet. Unter Umständen funktioniert hier nicht alles wie gewohnt.
......
......@@ -42,6 +42,7 @@
@yield('homeIcon')
</header>
@include('parts.sidebar', ['id' => 'staticPagesSideBar'])
@include('parts.sidebar-opener', ['class' => 'fixed'])
<div class="wrapper">
<main class="mg-panel">
@if (isset($success))
......
......@@ -12,7 +12,7 @@
de.wikipedia.org
</a>
</div>
<div class="result-body">
<div class="resultpage-body">
<div class="result-description" data-tooltip="{{ trans('fake-result.description') }}">
Wikipedia ist ein Projekt zum Aufbau einer Enzyklopädie aus freien Inhalten, zu denen du sehr gern beitragen kannst. Seit Mai 2001 sind 2.150.918 Artikel in ...
</div>
......
......@@ -40,15 +40,27 @@
</details>
@else
<div class="quicktip-summary">
@if ($quicktip->title != "")
<h1>
@if ($quicktip->link != "")
<a href="{{ $quicktip->link }}">{{ $quicktip->title }}</a>
@else
{{ $quicktip->title }}
<div class="quicktip-headline">
@if ($quicktip->title != "")
<h1 class="quicktip-title">
@if ($quicktip->link != "")
<a href="{{ $quicktip->link }}">{{ $quicktip->title }}</a>
@else
{{ $quicktip->title }}
@endif
</h1>
<div class="space-taker"></div>
@if ($quicktip->gefVonLink != "")
<a class="quicktip-hoster" href="{{ $quicktip->gefVonLink }}" target="_blank" rel="noopener">
@if ($quicktip->gefVonTitle != "")
{{ $quicktip->gefVonTitle }}
@else
{{ $quicktip->gefVonTitle }}
@endif
</a>
@endif
</h1>
@endif
@endif
</div>
<p>{!! $quicktip->descr !!}</p>
</div>
@endif
\ No newline at end of file
<label class="openSidebar {{$class or ''}}" role="button" for="sideBarToggle"></label>
\ No newline at end of file
<input id="sideBarToggle" style="display: none;" type="checkbox">
<label id="openSidebar" class="noprint" role="button" for="sideBarToggle"></label>
<div class="sideBar">
<label id="closeSidebar" role="button" for="sideBarToggle"></label>
<a href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/") }}">
......
......@@ -12,9 +12,15 @@ let mix = require('laravel-mix');
*/
mix
.less('resources/assets/less/default.less', 'public/css/themes/default.css')
.less('resources/assets/less/metager/beitritt.less', 'public/css/beitritt.css')
.less('resources/assets/less/utility.less', 'public/css/utility.css')
.less('resources/assets/less/default.less', 'public/css/themes/default.css', {
strictMath: true
})
.less('resources/assets/less/metager/beitritt.less', 'public/css/beitritt.css', {
strictMath: true
})
.less('resources/assets/less/utility.less', 'public/css/utility.css', {
strictMath: true
})
// js
.babel(['resources/assets/js/lib/jquery.js', 'resources/assets/js/lib/jquery-ui.min.js', 'resources/assets/js/lib/bootstrap.js', 'resources/assets/js/lib/lightslider.js',
'resources/assets/js/lib/masonry.js', 'resources/assets/js/lib/imagesloaded.js', 'resources/assets/js/lib/openpgp.min.js', 'resources/assets/js/lib/iframeResizer.min.js',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment