From 06ad5966bd089684f79c6922fbf8122f3852ca01 Mon Sep 17 00:00:00 2001
From: Dominik Hebeler <dominik@suma-ev.de>
Date: Thu, 15 Sep 2022 09:24:17 +0200
Subject: [PATCH] added options to directly open partnershop results

---
 metager/lang/de/partnershops.php              |  2 +-
 metager/lang/de/result.php                    |  1 +
 metager/lang/en/partnershops.php              |  2 +-
 metager/lang/en/result.php                    |  1 +
 metager/lang/es/result.php                    | 27 ++++++++++---------
 .../resources/views/layouts/result.blade.php  |  5 ++++
 6 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/metager/lang/de/partnershops.php b/metager/lang/de/partnershops.php
index ae57c49ad..4ee9e785d 100644
--- a/metager/lang/de/partnershops.php
+++ b/metager/lang/de/partnershops.php
@@ -3,6 +3,6 @@
 return [
     'heading'     => 'MetaGer-Partnershop',
     'paragraph.1' => 'Wenn in der MetaGer-Ergebnisliste Links erscheinen, bei denen das Wort "Partnershop" steht, dann sind das zunächst normale Ergebnisse einer MetaGer-Suche. Sie werden im Ranking nicht bevorzugt oder höher eingestuft, sondern wie alle anderen Suchergebnisse auch behandelt.',
-    'paragraph.2' => 'Wenn der Link angeklickt wird, erhalten wir einen geringen Betrag zur Finanzierung von MetaGer. Beim Ergebnis wird das zugehörige Firmenlogo angezeigt. Auch daran erkennen Sie immer unsere Partnershops. Beim Anklicken eines solchen Ergebnisses, werden Sie auf einen unserer Dienste "direct.metager.de" geleitet. Dieser kommuniziert anschließend mit unserem Werbenetzwerk, um einen Affiliate Link zu generieren. Dabei werden keine Nutzerdaten weitergegeben. Anschließend leiten wir Sie direkt zur Zielwebseite weiter. Wenn Sie dies vermeiden wollen, dann können Sie bei MetaGer auf "anonym öffnen" klicken. Allerdings erhalten wir dann auch keinen Beitrag zur Finanzierung von MetaGer. Wir bitten Sie dann um eine <a href=":link">Spende</a>, damit wir MetaGer als unabhängige Alternative in einem gemeinnützigen Verein weiter entwickeln und betreiben können.',
+    'paragraph.2' => 'Wenn der Link angeklickt wird, erhalten wir einen geringen Betrag zur Finanzierung von MetaGer. Beim Ergebnis wird das zugehörige Firmenlogo angezeigt. Auch daran erkennen Sie immer unsere Partnershops. Beim Anklicken eines solchen Ergebnisses, werden Sie auf einen unserer Dienste geleitet. Dieser kommuniziert anschließend mit unserem Werbenetzwerk, um einen Affiliate Link zu generieren. Anschließend leiten wir Sie zur Zielwebseite weiter. Wenn Sie dies vermeiden wollen, dann können Sie bei MetaGer auf "anonym öffnen", oder "mehr => direkt öffnen" klicken. Allerdings erhalten wir dann auch keinen Beitrag zur Finanzierung von MetaGer. Wir bitten Sie dann um eine <a href=":link">Spende</a>, damit wir MetaGer als unabhängige Alternative in einem gemeinnützigen Verein weiter entwickeln und betreiben können.',
     'paragraph.3' => 'Mitglieder des SUMA_EV können unsere werbefreie Suche nutzen. <a href="/beitritt">Werden Sie Mitglied!</a>',
 ];
diff --git a/metager/lang/de/result.php b/metager/lang/de/result.php
index c37cf30bb..6744cdbde 100644
--- a/metager/lang/de/result.php
+++ b/metager/lang/de/result.php
@@ -10,6 +10,7 @@ return [
     'options.5' => 'ANONYM ÖFFNEN',
     'options.6' => 'IN NEUEM TAB ÖFFNEN',
     'options.7' => 'ÖFFNEN',
+    'options.direct' => 'Direkt öffnen',
     'options.more' => 'MEHR',
     'options.less' => 'WENIGER',
     'gefVon' => 'von',
diff --git a/metager/lang/en/partnershops.php b/metager/lang/en/partnershops.php
index 2f6d8371b..40cbd8d7c 100644
--- a/metager/lang/en/partnershops.php
+++ b/metager/lang/en/partnershops.php
@@ -3,6 +3,6 @@
 return [
     'heading'     => "MetaGer-Partnershop",
     'paragraph.1' => "Whenever you see results with a label that says 'Partnershop', this is just a regular result. It is not ranked differently or prefered.",
-    'paragraph.2' => 'If the link is clicked, we will receive a small amount to finance MetaGer. The corresponding company logo is displayed with the result. You can always recognize our partner shops by this. If you click on such a result, you will be directed to one of our services "direct.metager.de". This then communicates with our advertising network in order to generate an affiliate link. No user data will be passed on. We will then redirect you directly to the target website. If you want to avoid this, you can click on "Open anonymously" at MetaGer. However, we will then not receive any contribution to the financing of MetaGer. We then ask for a <a href=":link"> donation </a> so that we can continue to develop and operate MetaGer as an independent alternative in a non-profit organization.',
+    'paragraph.2' => 'If the link is clicked, we receive a small amount to fund MetaGer. The corresponding company logo is displayed in the result. You can always recognize our partner shops by this. If you click on such a result, you will be directed to one of our services. This then communicates with our advertising network to generate an affiliate link. Then we will redirect you to the target website. If you want to avoid this, you can click on "open anonymously" in MetaGer, or "more => open directly". However, we will then not receive any contribution to the financing of MetaGer. We would then ask you for a <a href=":link">donation</a> so that we can further develop and operate MetaGer as an independent alternative in a non-profit association.',
     'paragraph.3' => 'SUMA-EV members may use our ad-free search. <a href=":link">Become a Member</a>',
 ];
diff --git a/metager/lang/en/result.php b/metager/lang/en/result.php
index 4f0a291ca..b9dd7e12d 100644
--- a/metager/lang/en/result.php
+++ b/metager/lang/en/result.php
@@ -10,6 +10,7 @@ return [
     'options.5'            =>    'OPEN ANONYMOUSLY',
     'options.6'         =>  'OPEN IN NEW TAB',
     'options.7'         =>  'OPEN',
+    'options.direct' => 'Abre directamente',
     'options.more'      =>  'MORE',
     'options.less'      =>  'LESS',
     'gefVon'            =>  'by',
diff --git a/metager/lang/es/result.php b/metager/lang/es/result.php
index 6eaccb745..8119daa60 100644
--- a/metager/lang/es/result.php
+++ b/metager/lang/es/result.php
@@ -1,15 +1,16 @@
 <?php return [
-    "options.headline"	=>	"Opciónes",
-    "options.savetab"	=>	"Grabar resultado",
-    "options.1"	=>	"Nueva búsqueda en este dominio",
-    "options.2"	=>	"ocultar :host",
-    "options.3"	=>	"ocultar *.:domain",
-    "options.4"	=>	"Tienda asociada",
-    "options.5"	=>	"ABRIR ANÓNIMO",
-    "options.6"	=>	"ABRIR NUEVA PESTAÑA",
-    "options.7"	=>	"ABRIR",
-    "options.more"	=>	"Más",
-    "options.less"	=>	"Menos",
-    "gefVon"	=>	"Encontrado de",
-    "proxytext"	=>	"Abrirá el link anonimizado."
+    "options.headline"    =>    "Opciónes",
+    "options.savetab"    =>    "Grabar resultado",
+    "options.1"    =>    "Nueva búsqueda en este dominio",
+    "options.2"    =>    "ocultar :host",
+    "options.3"    =>    "ocultar *.:domain",
+    "options.4"    =>    "Tienda asociada",
+    "options.5"    =>    "ABRIR ANÓNIMO",
+    "options.6"    =>    "ABRIR NUEVA PESTAÑA",
+    "options.7"    =>    "ABRIR",
+    'options.direct' => 'Direkt öffnen',
+    "options.more"    =>    "Más",
+    "options.less"    =>    "Menos",
+    "gefVon"    =>    "Encontrado de",
+    "proxytext"    =>    "Abrirá el link anonimizado."
 ];
diff --git a/metager/resources/views/layouts/result.blade.php b/metager/resources/views/layouts/result.blade.php
index 539230ce2..ae28c8823 100644
--- a/metager/resources/views/layouts/result.blade.php
+++ b/metager/resources/views/layouts/result.blade.php
@@ -80,6 +80,11 @@
 	<div class="result-options">
 		<div class="options">
 			<ul class="option-list list-unstyled small">
+				@if($result->partnershop)
+				<li>
+					<a href="{{ $result->originalLink }}" target="{{ $metager->getNewtab() }}" rel="noopener">{{ __('result.options.direct') }}</a>
+				</li>
+				@endif
 				<li class="js-only">
 					<a href="#" class="saver" data-id="{{ $result->hash }}">
 						<img class="mg-icon result-icon-floppy" src="/img/floppy.svg"> {!! trans('result.options.savetab') !!}
-- 
GitLab