From b5bbcb2c0e355c3685af46af9f2ab1bb7f2f4617 Mon Sep 17 00:00:00 2001 From: Julian Prieber <60265788+JulianPrieber@users.noreply.github.com> Date: Thu, 23 Nov 2023 16:05:29 +0100 Subject: [PATCH] Added icon on user pages to report page - Not shown for admins or VIPs - Has to be turned on in the config to be active --- .env | 2 + resources/lang/de/messages.php | 4 +- resources/lang/en/messages.php | 2 + .../views/components/config/config.blade.php | 3 + .../views/components/finishing.blade.php | 3 + .../views/components/report-icon.blade.php | 89 +++++++++++++++++++ resources/views/littlelink.blade.php | 2 + 7 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 resources/views/components/report-icon.blade.php diff --git a/.env b/.env index 081f0d6..4f43f5e 100644 --- a/.env +++ b/.env @@ -130,3 +130,5 @@ ALLOW_USER_EXPORT=true ALLOW_USER_IMPORT=true MANUAL_USER_VERIFICATION=true + +ENABLE_REPORT_ICON=false diff --git a/resources/lang/de/messages.php b/resources/lang/de/messages.php index cbcc1c7..6d9693c 100644 --- a/resources/lang/de/messages.php +++ b/resources/lang/de/messages.php @@ -734,6 +734,8 @@ return [ 'ADMIN_EMAIL.description' => 'Wird zum Versenden von Benachrichtigungs-E-Mails verwendet.', 'HIDE_VERIFICATION_CHECKMARK.title' => 'Verifizierungshäkchen ausblenden', 'HIDE_VERIFICATION_CHECKMARK.description' => 'Versteckt das Verifizierungsabzeichen, das auf Admin- und VIP-Seiten angezeigt wird.', + 'ENABLE_REPORT_ICON.title' => 'Report-Icon aktivieren', + 'ENABLE_REPORT_ICON.description' => 'Zeigt ein Symbol auf Benutzerseiten an, das es Benutzern ermöglicht, Seiten zu melden.', 'LOCALE.title' => 'App Lokalisierung', 'LOCALE.description' => 'Ändern Sie die Sprache Ihrer Anwendung.', @@ -1090,7 +1092,7 @@ return [ 'report_error' => 'Profil konnte nicht gemeldet werden', 'report_success' => 'Profil wurde erfolgreich gemeldet', - + #=============================================================================# # Laravel internal translations # #=============================================================================# diff --git a/resources/lang/en/messages.php b/resources/lang/en/messages.php index 3da9fd8..c0a428f 100644 --- a/resources/lang/en/messages.php +++ b/resources/lang/en/messages.php @@ -731,6 +731,8 @@ return [ 'ADMIN_EMAIL.description' => 'Used to send notification emails.', 'HIDE_VERIFICATION_CHECKMARK.title' => 'Hide verification checkmark', 'HIDE_VERIFICATION_CHECKMARK.description' => 'Hides verification badge displayed on admin and VIP pages.', + 'ENABLE_REPORT_ICON.title' => 'Enable report icon', + 'ENABLE_REPORT_ICON.description' => 'Displays an icon on user pages that allows users to report pages.', 'LOCALE.title' => 'App locale', 'LOCALE.description' => 'Change the language of your application', diff --git a/resources/views/components/config/config.blade.php b/resources/views/components/config/config.blade.php index c844c9a..fdbc195 100644 --- a/resources/views/components/config/config.blade.php +++ b/resources/views/components/config/config.blade.php @@ -274,6 +274,9 @@ foreach($users as $user){if($user->littlelink_name != $configValue2){echo '

{{__('messages.Panel settings')}}

{{toggle('NOTIFY_EVENTS')}} diff --git a/resources/views/components/finishing.blade.php b/resources/views/components/finishing.blade.php index 79e6aa7..cbecd32 100644 --- a/resources/views/components/finishing.blade.php +++ b/resources/views/components/finishing.blade.php @@ -60,6 +60,9 @@ use App\Models\Page; if(EnvEditor::keyExists('LOCALE')){ /* Do nothing if key already exists */ } else {EnvEditor::addKey('LOCALE', 'en');} + if(EnvEditor::keyExists('ENABLE_REPORT_ICON')){ /* Do nothing if key already exists */ + } else {EnvEditor::addKey('ENABLE_REPORT_ICON', false);} + if(EnvEditor::keyExists('ADMIN_EMAIL')){} else {if(Auth::user()->id == 1){EnvEditor::addKey('ADMIN_EMAIL', App\Models\User::find(1)->email);} else{EnvEditor::addKey('ADMIN_EMAIL', '');}} diff --git a/resources/views/components/report-icon.blade.php b/resources/views/components/report-icon.blade.php new file mode 100644 index 0000000..6daf334 --- /dev/null +++ b/resources/views/components/report-icon.blade.php @@ -0,0 +1,89 @@ +@if($userinfo->role == 'user' and env('ENABLE_REPORT_ICON') == true) + +
+
+
+ + +
+
+ +
+ + +@endif \ No newline at end of file diff --git a/resources/views/littlelink.blade.php b/resources/views/littlelink.blade.php index b29da72..4e5a9e3 100644 --- a/resources/views/littlelink.blade.php +++ b/resources/views/littlelink.blade.php @@ -252,6 +252,8 @@ if($customBackgroundExists == true){ +@include('components.report-icon') +