From 95a9742571a80b82410a8628b981f761fd8ec8c0 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 19 Jan 2018 20:43:55 -0800 Subject: [PATCH 1/3] Fixed #4768 - adds dashboard message option to settings --- app/Http/Controllers/SettingsController.php | 1 + ...3121_add_dashboard_message_to_settings.php | 32 +++++++++++++++++++ resources/lang/en/admin/settings/general.php | 2 ++ resources/lang/en/general.php | 1 + resources/views/dashboard.blade.php | 11 +++++++ resources/views/settings/general.blade.php | 24 +++++++++++++- 6 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2018_01_19_203121_add_dashboard_message_to_settings.php diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 4bc9b7444d..807f5466f8 100755 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -317,6 +317,7 @@ class SettingsController extends Controller $setting->full_multiple_companies_support = $request->input('full_multiple_companies_support', '0'); $setting->load_remote = $request->input('load_remote', '0'); $setting->show_archived_in_list = $request->input('show_archived_in_list', '0'); + $setting->dashboard_message = $request->input('dashboard_message'); $setting->email_domain = $request->input('email_domain'); $setting->email_format = $request->input('email_format'); $setting->username_format = $request->input('username_format'); diff --git a/database/migrations/2018_01_19_203121_add_dashboard_message_to_settings.php b/database/migrations/2018_01_19_203121_add_dashboard_message_to_settings.php new file mode 100644 index 0000000000..89e0cd2f2f --- /dev/null +++ b/database/migrations/2018_01_19_203121_add_dashboard_message_to_settings.php @@ -0,0 +1,32 @@ +text('dashboard_message')->nullable()->default(null); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('settings', function (Blueprint $table) { + $table->text('dashboard_message'); + }); + } +} diff --git a/resources/lang/en/admin/settings/general.php b/resources/lang/en/admin/settings/general.php index c68e1d3bb6..76159635b1 100644 --- a/resources/lang/en/admin/settings/general.php +++ b/resources/lang/en/admin/settings/general.php @@ -25,6 +25,8 @@ return array( 'custom_css_help' => 'Enter any custom CSS overrides you would like to use. Do not include the <style></style> tags.', 'custom_forgot_pass_url' => 'Custom Password Reset URL', 'custom_forgot_pass_url_help' => 'This replaces the built-in forgotten password URL on the login screen, useful to direct people to internal or hosted LDAP password reset functionality. It will effectively disable local user forgotten password functionality.', + 'dashboard_message' => 'Dashboard Message', + 'dashboard_message_help' => 'This text will appear on the dashboard for anyone with permission to view the dashboard.', 'default_currency' => 'Default Currency', 'default_eula_text' => 'Default EULA', 'default_language' => 'Default Language', diff --git a/resources/lang/en/general.php b/resources/lang/en/general.php index 94acace65a..f34e34c1d4 100644 --- a/resources/lang/en/general.php +++ b/resources/lang/en/general.php @@ -85,6 +85,7 @@ 'file_name' => 'File', 'file_uploads' => 'File Uploads', 'generate' => 'Generate', + 'github_markdown' => 'This field accepts Github flavored markdown.', 'groups' => 'Groups', 'gravatar_email' => 'Gravatar Email Address', 'history' => 'History', diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index 39f2bcda1b..ba74a49b84 100755 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -10,6 +10,17 @@ {{-- Page content --}} @section('content') +@if ($snipeSettings->dashboard_message!='') +
+
+
+ + {{ $snipeSettings->dashboard_message }} +
+
+
+@endif +
diff --git a/resources/views/settings/general.blade.php b/resources/views/settings/general.blade.php index 85a7de45d6..e547383ccb 100644 --- a/resources/views/settings/general.blade.php +++ b/resources/views/settings/general.blade.php @@ -160,7 +160,7 @@ -
+
{{ Form::label('login_note', trans('admin/settings/general.login_note')) }}
@@ -199,6 +199,28 @@
+ +
+
+ {{ Form::label('dashboard_message', trans('admin/settings/general.dashboard_message')) }} +
+
+ @if (config('app.lock_passwords')) + + + {!! $errors->first('dashboard_message', ':message') !!} +

{{ trans('general.lock_passwords') }}

+ @else + + {!! $errors->first('dashboard_message', ':message') !!} + @endif +

+ {{ trans('admin/settings/general.dashboard_message_help') }} + {!! trans('general.github_markdown') !!}

+
+
+ + From 862251ab368245c8a22ff398766ee4bb26bf0f61 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 19 Jan 2018 20:45:25 -0800 Subject: [PATCH 2/3] Change label to stale --- .github/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/stale.yml b/.github/stale.yml index 51c08752b9..75bc6bad06 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -9,7 +9,7 @@ exemptLabels: - ready for dev - bounty # Label to use when marking an issue as stale -staleLabel: wontfix +staleLabel: stale # Comment to post when marking an issue as stale. Set to `false` to disable markComment: > This issue has been automatically marked as stale because it has not had From 6eb8acf3190594244b1bff633d364f7a028ddb27 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 19 Jan 2018 20:49:02 -0800 Subject: [PATCH 3/3] Swich to panel box for dashboard message --- resources/views/dashboard.blade.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index ba74a49b84..9a1ff51b19 100755 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -13,9 +13,15 @@ @if ($snipeSettings->dashboard_message!='')
-
- - {{ $snipeSettings->dashboard_message }} +
+ +
+
+
+ {!! Parsedown::instance()->text(e($snipeSettings->dashboard_message)) !!} +
+
+