From 4babe1fe2e005db6fd169c1714614b6753d7454f Mon Sep 17 00:00:00 2001 From: Julian Prieber <60265788+JulianPrieber@users.noreply.github.com> Date: Sun, 20 Mar 2022 17:15:16 +0100 Subject: [PATCH] Made update notification optional / Added Event notification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added optional event notification that can be enabled in the config (is disabled by default). You can read more about this feature on the Blog here: https://blog.littlelink-custom.com/event-notifications/ --- .env | 9 ++-- resources/views/layouts/sidebar.blade.php | 47 +++++++++++++++++-- .../views/vendor/env-editor/index.blade.php | 5 ++ storage/backups/default_settings | 9 ++-- 4 files changed, 55 insertions(+), 15 deletions(-) diff --git a/.env b/.env index ea17cab..cf00543 100644 --- a/.env +++ b/.env @@ -2,13 +2,16 @@ #=Register_auth either auth or verified. If auth is selected, no verification is required. Default is verified. Register_auth=verified +#Internal notifications=Notify if update is available or and event is happening such as a poll about the future of this project. +Notify_events=false +Notify_updates=true + #App Settings=Changes settings regarding your LittleLink Custom installation. You probably only want to change the App Name setting. #=App_Name changes the displayed name for the App in the title, for example. App_Name="LittleLink Custom" APP_KEY= App_URL= - #Debug Settings=Changes if your page should display a full error description instead of a generic error 500 #=App_debug either true or false. You might want to change this to false after you're done installing, but it's very useful for troubleshooting. App_debug=true @@ -17,11 +20,9 @@ App_env=local Log_channel=stack Log_level=debug - #Database Settings=Should be left alone. If you wish to use mysql you'd have to seed the database again. DB_connection=sqlite - #Mail Settings=LittleLink Custom comes with a free to use built-in SMTP server for sending mail. You can leave this setting as is, if you wish to use this service please read our terms and conditions at llc-mail.tru.io. If you do not wish to use the built-in SMTP server, change the setting below #=Mail_mailer either smtp or built-in. Make sure to change this setting if you want to add a custom SMTP server. Mail_mailer=built-in @@ -33,14 +34,12 @@ Mail_encryption= Mail_from_address= Mail_from_name="${app_name}" - #Cache Settings=Completely optional Memcached_host=127.0.0.1 Redis_host=127.0.0.1 Redis_password=null Redis_port=6379 - #Miscellaneous Settings=Should be left alone if you don't know what you're doing. Broadcast_driver=log Cache_driver=file diff --git a/resources/views/layouts/sidebar.blade.php b/resources/views/layouts/sidebar.blade.php index 811266a..13c3bc2 100755 --- a/resources/views/layouts/sidebar.blade.php +++ b/resources/views/layouts/sidebar.blade.php @@ -35,7 +35,7 @@ @if ($color_scheme == 'dark') - + @else @@ -138,7 +138,7 @@
- + @if(env('Notify_updates') === true) An update is available @endif @endif + @endif Watch Page
- + - + + + @if(env('Notify_events') === true and $EventServerExists == 'true') + + @if(auth()->user()->role == 'admin' and strtotime(date("d-m-Y")) < strtotime($EventJson['enddate'])) + + @endif + @endif + @if(env('Notify_events') === false and auth()->user()->role == 'admin') + + + @endif + @yield('content') @@ -189,4 +226,4 @@ - + \ No newline at end of file diff --git a/resources/views/vendor/env-editor/index.blade.php b/resources/views/vendor/env-editor/index.blade.php index a94ef3a..db411f8 100644 --- a/resources/views/vendor/env-editor/index.blade.php +++ b/resources/views/vendor/env-editor/index.blade.php @@ -27,6 +27,11 @@ + @if(env('Notify_events') === false) +

+You currently have Event Notifications disabled. To get notified about polls, possible security vulnerabilities or important news, change the setting Notify_events below to true. If you enable this and an event is happening, a small text will pop up on your Admin Panel which will only be visible for admins. + @endif +