From b90f9395a977b51e930ae6cd22f1bebb29fcdaa7 Mon Sep 17 00:00:00 2001
From: Dominik Hebeler <dominik@suma-ev.de>
Date: Mon, 1 Mar 2021 15:54:18 +0100
Subject: [PATCH] fixed styleing and added asso key

---
 app/Http/Controllers/Assoziator.php           | 14 ++++++--
 .../less/metager/pages/asso/style-dark.less   |  7 ++++
 resources/less/metager/pages/asso/style.less  | 33 +++++++++++++++++++
 resources/views/assoziator/asso.blade.php     | 19 -----------
 routes/web.php                                |  4 ++-
 webpack.mix.js                                |  6 ++++
 6 files changed, 60 insertions(+), 23 deletions(-)
 create mode 100644 resources/less/metager/pages/asso/style-dark.less
 create mode 100644 resources/less/metager/pages/asso/style.less

diff --git a/app/Http/Controllers/Assoziator.php b/app/Http/Controllers/Assoziator.php
index a0364a260..a0ff27d3d 100644
--- a/app/Http/Controllers/Assoziator.php
+++ b/app/Http/Controllers/Assoziator.php
@@ -14,7 +14,14 @@ class Assoziator extends Controller
             return redirect(LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), '/asso'));
         }
 
-        $url = "https://metager.de/meta/meta.ger3?eingabe=" . urlencode($eingabe) . "&out=atom10&key=" . env('ASSO_KEY', 'test');
+        $params = [
+            "eingabe" => $eingabe,
+            "out" => "atom10",
+            "key" => env("ASSO_KEY", "test"),
+        ];
+
+
+        $url = "https://metager.de/meta/meta.ger3?" . http_build_query($params, "", "&", PHP_QUERY_RFC3986);
 
         $ch = curl_init();
 
@@ -115,8 +122,9 @@ class Assoziator extends Controller
             ->with('navbarFocus', 'dienste')
             ->with('words', $words)
             ->with('keywords', $eingabe)
-            ->with('wordCount', $wordCount);
+            ->with('wordCount', $wordCount)
+            ->with('css', [mix('css/asso/style.css')])
+            ->with('darkcss', [mix('css/asso/dark.css')]);;
 
-        die(var_dump($words));
     }
 }
diff --git a/resources/less/metager/pages/asso/style-dark.less b/resources/less/metager/pages/asso/style-dark.less
new file mode 100644
index 000000000..8a60b0a30
--- /dev/null
+++ b/resources/less/metager/pages/asso/style-dark.less
@@ -0,0 +1,7 @@
+.reasso {
+    color: #fd8307;
+}
+
+tr:nth-child(odd){
+    background-color: #333030;
+}
\ No newline at end of file
diff --git a/resources/less/metager/pages/asso/style.less b/resources/less/metager/pages/asso/style.less
new file mode 100644
index 000000000..a3234f46b
--- /dev/null
+++ b/resources/less/metager/pages/asso/style.less
@@ -0,0 +1,33 @@
+table {
+    width: 100%;
+}
+table > tbody > tr {
+    text-align: center;
+
+}
+
+tr:nth-child(odd){
+    background-color: #dbd8d8;
+}
+form div.input-group-addon button {
+    padding: 9px;
+}
+
+.reasso {
+    color: #06C;
+    font-size: 1.3rem;
+    cursor: pointer;
+}
+.reasso:hover {
+    color: red;
+}
+
+td.association {
+    display: flex;
+    align-items: center;
+    margin-left: 8px;
+    padding: 8px;
+}
+.asso-search-link {
+    margin-right: 10px;
+}
\ No newline at end of file
diff --git a/resources/views/assoziator/asso.blade.php b/resources/views/assoziator/asso.blade.php
index fdeeb6e92..b9c94954f 100644
--- a/resources/views/assoziator/asso.blade.php
+++ b/resources/views/assoziator/asso.blade.php
@@ -3,25 +3,6 @@
 @section('title', $title )
 
 @section('content')
-	<style>
-		form div.input-group-addon button {
-			padding: 9px;
-		}
-
-		.reasso {
-			color: rgb(0, 102, 204);
-		}
-		.reasso:hover {
-			color: red;
-		}
-
-		td.association {
-			display: flex;
-		}
-		.asso-search-link {
-			margin-right: 10px;
-		}
-	</style>
 	<h1 class="page-title">{{ trans('asso.head.1') }}</h1>
 	<div class="card-heavy">
 		<p>{{ trans('asso.1.1') }} <a href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), '/datenschutz') }}" target="_blank">{{ trans('asso.1.2') }}</a>{{ trans('asso.1.3') }}.</p>
diff --git a/routes/web.php b/routes/web.php
index 8777d7770..530fc0d1d 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -38,7 +38,9 @@ Route::group(
         Route::get('asso', function () {
             return view('assoziator.asso')
                 ->with('title', trans('titles.asso'))
-                ->with('navbarFocus', 'dienste');
+                ->with('navbarFocus', 'dienste')
+                ->with('css', [mix('css/asso/style.css')])
+                ->with('darkcss', [mix('css/asso/dark.css')]);
         });
         Route::post('asso', 'Assoziator@asso')->middleware('browserverification:true', 'humanverification:true');
 
diff --git a/webpack.mix.js b/webpack.mix.js
index a3b4e9188..f25aa7d60 100644
--- a/webpack.mix.js
+++ b/webpack.mix.js
@@ -55,6 +55,12 @@ mix
   .less("resources/less/metager/pages/count/style.less", "public/css/count/style.css", {
     strictMath: true
   })
+  .less("resources/less/metager/pages/asso/style-dark.less", "public/css/asso/dark.css", {
+    strictMath: true
+  })
+  .less("resources/less/metager/pages/asso/style.less", "public/css/asso/style.css", {
+    strictMath: true
+  })
   .less("resources/less/metager/pages/spende/danke.less", "public/css/spende/danke.css", {
     strictMath: true
   })
-- 
GitLab