From 43cfef389c5f87198224d2cefa1e29fce6f0a890 Mon Sep 17 00:00:00 2001 From: Joseph Cohen Date: Sun, 18 Jan 2015 15:53:43 -0600 Subject: [PATCH] Added welcome modal --- app/assets/sass/main.scss | 1 + app/assets/sass/partials/_modals.scss | 55 +++++++++++++++ app/lang/de/dashboard.php | 15 +++++ app/lang/en/dashboard.php | 15 +++++ app/lang/fr/dashboard.php | 15 +++++ app/views/dashboard/index.blade.php | 8 +++ .../dashboard/welcome-modal.blade.php | 67 +++++++++++++++++++ src/Http/Controllers/SetupController.php | 3 + 8 files changed, 179 insertions(+) create mode 100644 app/assets/sass/partials/_modals.scss create mode 100644 app/views/partials/dashboard/welcome-modal.blade.php diff --git a/app/assets/sass/main.scss b/app/assets/sass/main.scss index 7d05a46bf..d4fe98a4b 100644 --- a/app/assets/sass/main.scss +++ b/app/assets/sass/main.scss @@ -19,6 +19,7 @@ html, body { @import "partials/navbar"; @import "partials/sidebar"; @import "partials/content"; +@import "partials/modals"; // Styles for specific page @import "pages/login"; diff --git a/app/assets/sass/partials/_modals.scss b/app/assets/sass/partials/_modals.scss new file mode 100644 index 000000000..6c6f8ee1a --- /dev/null +++ b/app/assets/sass/partials/_modals.scss @@ -0,0 +1,55 @@ +#welcome-modal .modal-dialog { + margin-top: 65px; +} + +#welcome-modal .modal-content .modal-header { + border-bottom: 0; +} + +#welcome-modal .modal-content .modal-body { + padding-bottom: 50px; +} + +#welcome-modal .modal-content .modal-body header { + text-align: center; + font-weight: 600; + font-size: 22px; + color: #444; + margin-bottom: 23px; +} + +#welcome-modal .modal-content .modal-body p { + font-size: 13px; + color: #555; + margin: 0 auto; + width: 80%; + text-align: center; + line-height: 20px; +} + +#welcome-modal .modal-content .modal-body .get-started { + margin-top: 40px; +} + +#welcome-modal .modal-content .modal-body .get-started .col-md-4 { + text-align: center; + padding-bottom: 50px; +} + +#welcome-modal .modal-content .modal-body .get-started .col-md-4 i { + font-size: 38px; + color: $cachet-gray-darker; +} + +#welcome-modal .modal-content .modal-body .get-started .col-md-4 a { + color: $cachet-gray-darker; + display: block; + margin-top: 12px; + font-size: 13px; +} + +#welcome-modal .modal-content .modal-body .go-dashboard { + text-align: center; + display: block; + margin-top: 10px; +} diff --git a/app/lang/de/dashboard.php b/app/lang/de/dashboard.php index 3b6a2d357..11d0dac78 100644 --- a/app/lang/de/dashboard.php +++ b/app/lang/de/dashboard.php @@ -128,4 +128,19 @@ return [ 'whoops' => 'Oops.', ], + // Welcome modal + 'welcome' => [ + 'welcome' => 'Welcome to Cachet', + 'message' => 'Your status page is almost ready! You might want to configure these extra settings', + 'close' => 'Just go straight to my dashboard', + 'steps' => [ + 'component' => 'Create components', + 'incident' => 'Create incidents', + 'customize' => 'Customize your Cachet Status Page.', + 'team' => 'Add users to your team.', + 'api' => 'Generate API token.', + 'two-factor' => 'Enable Two Factor Authetication.', + ], + ], + ]; diff --git a/app/lang/en/dashboard.php b/app/lang/en/dashboard.php index 8695ba3d0..15e8f1b0d 100644 --- a/app/lang/en/dashboard.php +++ b/app/lang/en/dashboard.php @@ -135,4 +135,19 @@ return [ 'whoops' => 'Whoops.', ], + // Welcome modal + 'welcome' => [ + 'welcome' => 'Welcome to Cachet', + 'message' => 'Your status page is almost ready! You might want to configure these extra settings', + 'close' => 'Just go straight to my dashboard', + 'steps' => [ + 'component' => 'Create components', + 'incident' => 'Create incidents', + 'customize' => 'Customize your Cachet Status Page.', + 'team' => 'Add users to your team.', + 'api' => 'Generate API token.', + 'two-factor' => 'Enable Two Factor Authetication.', + ], + ], + ]; diff --git a/app/lang/fr/dashboard.php b/app/lang/fr/dashboard.php index fff5d6d39..e7778c793 100644 --- a/app/lang/fr/dashboard.php +++ b/app/lang/fr/dashboard.php @@ -134,4 +134,19 @@ return [ 'whoops' => 'Oups.', ], + // Welcome modal + 'welcome' => [ + 'welcome' => 'Welcome to Cachet', + 'message' => 'Your status page is almost ready! You might want to configure these extra settings', + 'close' => 'Just go straight to my dashboard', + 'steps' => [ + 'component' => 'Create components', + 'incident' => 'Create incidents', + 'customize' => 'Customize your Cachet Status Page.', + 'team' => 'Add users to your team.', + 'api' => 'Generate API token.', + 'two-factor' => 'Enable Two Factor Authetication.', + ], + ], + ]; diff --git a/app/views/dashboard/index.blade.php b/app/views/dashboard/index.blade.php index 467c8c9f7..b5533372d 100644 --- a/app/views/dashboard/index.blade.php +++ b/app/views/dashboard/index.blade.php @@ -44,4 +44,12 @@ + @if(Session::get('setup.done')) + @include('partials.dashboard.welcome-modal') + + @endif @stop diff --git a/app/views/partials/dashboard/welcome-modal.blade.php b/app/views/partials/dashboard/welcome-modal.blade.php new file mode 100644 index 000000000..f7ad14788 --- /dev/null +++ b/app/views/partials/dashboard/welcome-modal.blade.php @@ -0,0 +1,67 @@ + + diff --git a/src/Http/Controllers/SetupController.php b/src/Http/Controllers/SetupController.php index ac22bb9d2..f2094375b 100644 --- a/src/Http/Controllers/SetupController.php +++ b/src/Http/Controllers/SetupController.php @@ -10,6 +10,7 @@ use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\Request; use Illuminate\Support\Facades\Response; +use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\View; @@ -104,6 +105,8 @@ class SetupController extends Controller ]); } + Session::flash('setup.done', true); + if (Request::ajax()) { return Response::json(['status' => 1]); }