From 1ce7f3d56950ff673ef4b1827dc58dd119e8f8de Mon Sep 17 00:00:00 2001 From: Michael Mollick Date: Mon, 19 Oct 2015 00:41:19 -0400 Subject: [PATCH 1/8] Seperated application settings into three pages --- .../Dashboard/SettingsController.php | 44 +++++++ app/Http/Routes/DashboardRoutes.php | 8 ++ app/Providers/ComposerServiceProvider.php | 2 +- resources/lang/en/dashboard.php | 6 + .../dashboard/settings/analytics.blade.php | 66 ++++++++++ .../dashboard/settings/app-setup.blade.php | 118 +++--------------- .../dashboard/settings/localization.blade.php | 91 ++++++++++++++ 7 files changed, 234 insertions(+), 101 deletions(-) create mode 100644 resources/views/dashboard/settings/analytics.blade.php create mode 100644 resources/views/dashboard/settings/localization.blade.php diff --git a/app/Http/Controllers/Dashboard/SettingsController.php b/app/Http/Controllers/Dashboard/SettingsController.php index eff77855..43d9d3db 100644 --- a/app/Http/Controllers/Dashboard/SettingsController.php +++ b/app/Http/Controllers/Dashboard/SettingsController.php @@ -35,6 +35,18 @@ class SettingsController extends Controller 'icon' => 'ion-gear-b', 'active' => false, ], + 'analytics' => [ + 'title' => trans('dashboard.settings.analytics.analytics'), + 'url' => route('dashboard.settings.analytics'), + 'icon' => 'ion-stats-bars', + 'active' => false, + ], + 'localization' => [ + 'title' => trans('dashboard.settings.localization.localization'), + 'url' => route('dashboard.settings.localization'), + 'icon' => 'ion-earth', + 'active' => false, + ], 'security' => [ 'title' => trans('dashboard.settings.security.security'), 'url' => route('dashboard.settings.security'), @@ -76,6 +88,38 @@ class SettingsController extends Controller ->withSubMenu($this->subMenu); } + /** + * Shows the settings analytics view. + * + * @return \Illuminate\View\View + */ + public function showAnalyticsView() + { + $this->subMenu['analytics']['active'] = true; + + Session::flash('redirect_to', $this->subMenu['analytics']['url']); + + return View::make('dashboard.settings.analytics') + ->withPageTitle('Analytics - Dashboard') + ->withSubMenu($this->subMenu); + } + + /** + * Shows the settings localization view. + * + * @return \Illuminate\View\View + */ + public function showLocalizationView() + { + $this->subMenu['localization']['active'] = true; + + Session::flash('redirect_to', $this->subMenu['localization']['url']); + + return View::make('dashboard.settings.localization') + ->withPageTitle('Localization - Dashboard') + ->withSubMenu($this->subMenu); + } + /** * Shows the settings theme view. * diff --git a/app/Http/Routes/DashboardRoutes.php b/app/Http/Routes/DashboardRoutes.php index 6cd756e3..2022a29f 100644 --- a/app/Http/Routes/DashboardRoutes.php +++ b/app/Http/Routes/DashboardRoutes.php @@ -218,6 +218,14 @@ class DashboardRoutes 'as' => 'setup', 'uses' => 'SettingsController@showSetupView', ]); + $router->get('analytics', [ + 'as' => 'analytics', + 'uses' => 'SettingsController@showAnalyticsView', + ]); + $router->get('localization', [ + 'as' => 'localization', + 'uses' => 'SettingsController@showLocalizationView', + ]); $router->get('security', [ 'as' => 'security', 'uses' => 'SettingsController@showSecurityView', diff --git a/app/Providers/ComposerServiceProvider.php b/app/Providers/ComposerServiceProvider.php index a8ee4234..d6e410fd 100644 --- a/app/Providers/ComposerServiceProvider.php +++ b/app/Providers/ComposerServiceProvider.php @@ -36,7 +36,7 @@ class ComposerServiceProvider extends ServiceProvider $factory->composer(['index', 'incident', 'subscribe'], StatusPageComposer::class); $factory->composer(['index', 'incident', 'subscribe', 'dashboard.settings.theme'], ThemeComposer::class); $factory->composer('dashboard.*', DashboardComposer::class); - $factory->composer(['setup', 'dashboard.settings.app-setup'], TimezoneLocaleComposer::class); + $factory->composer(['setup', 'dashboard.settings.localization'], TimezoneLocaleComposer::class); } /** diff --git a/resources/lang/en/dashboard.php b/resources/lang/en/dashboard.php index 5fe4d771..8ff17fa3 100755 --- a/resources/lang/en/dashboard.php +++ b/resources/lang/en/dashboard.php @@ -163,6 +163,12 @@ return [ 'images-only' => 'Only images may be uploaded.', 'too-big' => 'The file you uploaded is too big. Upload an image smaller than :size', ], + 'analytics' => [ + 'analytics' => 'Analytics' + ], + 'localization' => [ + 'localization' => 'Localization' + ], 'security' => [ 'security' => 'Security', 'two-factor' => 'Users without two-factor authentication', diff --git a/resources/views/dashboard/settings/analytics.blade.php b/resources/views/dashboard/settings/analytics.blade.php new file mode 100644 index 00000000..e9d85228 --- /dev/null +++ b/resources/views/dashboard/settings/analytics.blade.php @@ -0,0 +1,66 @@ +@extends('layout.dashboard') + +@section('content') +
+ @if(isset($sub_menu)) + @include('dashboard.partials.sub-sidebar') + @endif +
+
+ + {{ trans('dashboard.settings.localization.localization') }} + +
+
+
+
+ + @include('dashboard.partials.errors') +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+ +
+
+
+
+
+
+
+
+@stop diff --git a/resources/views/dashboard/settings/app-setup.blade.php b/resources/views/dashboard/settings/app-setup.blade.php index 414bd320..7a77bcb6 100644 --- a/resources/views/dashboard/settings/app-setup.blade.php +++ b/resources/views/dashboard/settings/app-setup.blade.php @@ -43,94 +43,6 @@ -
-
-
- - -
-
-
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
-
-
- - -
-
-
@@ -141,28 +53,34 @@
-
- - - +
+
-
- - - +
+
-
- - - +
+
diff --git a/resources/views/dashboard/settings/localization.blade.php b/resources/views/dashboard/settings/localization.blade.php new file mode 100644 index 00000000..2a99a6a7 --- /dev/null +++ b/resources/views/dashboard/settings/localization.blade.php @@ -0,0 +1,91 @@ +@extends('layout.dashboard') + +@section('content') +
+ @if(isset($sub_menu)) + @include('dashboard.partials.sub-sidebar') + @endif +
+
+ + {{ trans('dashboard.settings.localization.localization') }} + +
+
+
+
+ + @include('dashboard.partials.errors') +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+
+@stop From c832aba80ae62bc75be144cc40d115dcbb2911ed Mon Sep 17 00:00:00 2001 From: Michael Mollick Date: Tue, 20 Oct 2015 20:38:33 -0400 Subject: [PATCH 2/8] Segmented the language files --- resources/lang/en/forms.php | 14 +++++++++----- .../views/dashboard/settings/analytics.blade.php | 10 +++++----- .../dashboard/settings/localization.blade.php | 8 ++++---- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/resources/lang/en/forms.php b/resources/lang/en/forms.php index bd006f5b..fb6c5d87 100755 --- a/resources/lang/en/forms.php +++ b/resources/lang/en/forms.php @@ -93,20 +93,24 @@ return [ 'app-setup' => [ 'site-name' => 'Site Name', 'site-url' => 'Site URL', - 'site-timezone' => 'Site Timezone', - 'site-locale' => 'Site Language', - 'date-format' => 'Date Format', - 'incident-date-format' => 'Incident Timestamp Format', 'display-graphs' => 'Display graphs on status page?', 'about-this-page' => 'About this page', 'days-of-incidents' => 'How many days of incidents to show?', 'banner' => 'Banner Image', 'banner-help' => "It's recommended that you upload files no bigger than 930px wide .", + 'subscribers' => 'Allow people to signup to email notifications?', + ], + 'analytics' => [ 'analytics_google' => 'Google Analytics code', 'analytics_gosquared' => 'GoSquared Analytics code', 'analytics_piwik_url' => 'URL of your Piwik instance (without http(s)://)', 'analytics_piwik_siteid' => 'Piwik\'s site id', - 'subscribers' => 'Allow people to signup to email notifications?', + ], + 'localization' => [ + 'site-timezone' => 'Site Timezone', + 'site-locale' => 'Site Language', + 'date-format' => 'Date Format', + 'incident-date-format' => 'Incident Timestamp Format', ], 'security' => [ 'allowed-domains' => 'Allowed domains', diff --git a/resources/views/dashboard/settings/analytics.blade.php b/resources/views/dashboard/settings/analytics.blade.php index e9d85228..72f2845c 100644 --- a/resources/views/dashboard/settings/analytics.blade.php +++ b/resources/views/dashboard/settings/analytics.blade.php @@ -8,7 +8,7 @@
- {{ trans('dashboard.settings.localization.localization') }} + {{ trans('dashboard.settings.analytics.analytics') }}
@@ -20,7 +20,7 @@
- +
@@ -28,7 +28,7 @@
- +
@@ -36,7 +36,7 @@
- +
@@ -44,7 +44,7 @@
- +
diff --git a/resources/views/dashboard/settings/localization.blade.php b/resources/views/dashboard/settings/localization.blade.php index 2a99a6a7..a88b64fd 100644 --- a/resources/views/dashboard/settings/localization.blade.php +++ b/resources/views/dashboard/settings/localization.blade.php @@ -20,7 +20,7 @@
- + @@ -51,7 +51,7 @@
@@ -61,7 +61,7 @@
- + +
+
From 4771a134c4620ef1ef3693edf5f369802c8f3ac4 Mon Sep 17 00:00:00 2001 From: Michael Mollick Date: Tue, 20 Oct 2015 21:09:52 -0400 Subject: [PATCH 5/8] Notify subscribers checkbox is now a single line, removed optional indicator --- resources/views/dashboard/schedule/add.blade.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/resources/views/dashboard/schedule/add.blade.php b/resources/views/dashboard/schedule/add.blade.php index 9dbefc05..8259afaa 100644 --- a/resources/views/dashboard/schedule/add.blade.php +++ b/resources/views/dashboard/schedule/add.blade.php @@ -43,10 +43,11 @@
-
- - - {{ trans('forms.optional') }} +
+
From 1480385c04a2c1ecfc83ea123f4e10431ef29164 Mon Sep 17 00:00:00 2001 From: Michael Mollick Date: Tue, 20 Oct 2015 21:13:09 -0400 Subject: [PATCH 6/8] Display chart on status page is now on a single line --- resources/views/dashboard/metrics/add.blade.php | 10 ++++++---- resources/views/dashboard/metrics/edit.blade.php | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/resources/views/dashboard/metrics/add.blade.php b/resources/views/dashboard/metrics/add.blade.php index 7ff9d76a..a85793ff 100644 --- a/resources/views/dashboard/metrics/add.blade.php +++ b/resources/views/dashboard/metrics/add.blade.php @@ -46,10 +46,12 @@
-
- - - +
+
diff --git a/resources/views/dashboard/metrics/edit.blade.php b/resources/views/dashboard/metrics/edit.blade.php index 7fd624b4..05c66745 100644 --- a/resources/views/dashboard/metrics/edit.blade.php +++ b/resources/views/dashboard/metrics/edit.blade.php @@ -46,10 +46,12 @@
-
- - - display_chart ? 'checked' : null }}> +
+
From 5860678eb51fc05c3bcd51295a51efc7c70db8be Mon Sep 17 00:00:00 2001 From: Michael Mollick Date: Tue, 20 Oct 2015 21:19:57 -0400 Subject: [PATCH 7/8] Notify subscribers is now one line, optional indicator appears after label --- resources/views/dashboard/incidents/add.blade.php | 12 ++++++------ resources/views/dashboard/incidents/edit.blade.php | 3 +-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/resources/views/dashboard/incidents/add.blade.php b/resources/views/dashboard/incidents/add.blade.php index 00f4ef45..a06ded8a 100644 --- a/resources/views/dashboard/incidents/add.blade.php +++ b/resources/views/dashboard/incidents/add.blade.php @@ -104,14 +104,14 @@
- + {{ trans('forms.optional') }} - {{ trans('forms.optional') }}
-
- - - {{ trans('forms.optional') }} +
+
diff --git a/resources/views/dashboard/incidents/edit.blade.php b/resources/views/dashboard/incidents/edit.blade.php index ae458f46..d76236ad 100644 --- a/resources/views/dashboard/incidents/edit.blade.php +++ b/resources/views/dashboard/incidents/edit.blade.php @@ -77,9 +77,8 @@
- + {{ trans('forms.optional') }} - {{ trans('forms.optional') }}
From e8a5926dfeeedd89197b0fac91d8a8af8ae674ce Mon Sep 17 00:00:00 2001 From: Michael Mollick Date: Tue, 20 Oct 2015 22:13:52 -0400 Subject: [PATCH 8/8] Applied StyleCI changes --- app/Http/Routes/DashboardRoutes.php | 4 ++-- resources/lang/da/dashboard.php | 4 ++-- resources/lang/de/dashboard.php | 4 ++-- resources/lang/en-UD/dashboard.php | 4 ++-- resources/lang/en/dashboard.php | 4 ++-- resources/lang/es/dashboard.php | 4 ++-- resources/lang/fr/dashboard.php | 4 ++-- resources/lang/id/dashboard.php | 4 ++-- resources/lang/it/dashboard.php | 4 ++-- resources/lang/ko/dashboard.php | 4 ++-- resources/lang/nl/dashboard.php | 4 ++-- resources/lang/pl/dashboard.php | 4 ++-- resources/lang/pt-BR/dashboard.php | 4 ++-- resources/lang/ru/dashboard.php | 4 ++-- resources/lang/zh-CN/dashboard.php | 4 ++-- 15 files changed, 30 insertions(+), 30 deletions(-) diff --git a/app/Http/Routes/DashboardRoutes.php b/app/Http/Routes/DashboardRoutes.php index 2022a29f..da7c938e 100644 --- a/app/Http/Routes/DashboardRoutes.php +++ b/app/Http/Routes/DashboardRoutes.php @@ -219,11 +219,11 @@ class DashboardRoutes 'uses' => 'SettingsController@showSetupView', ]); $router->get('analytics', [ - 'as' => 'analytics', + 'as' => 'analytics', 'uses' => 'SettingsController@showAnalyticsView', ]); $router->get('localization', [ - 'as' => 'localization', + 'as' => 'localization', 'uses' => 'SettingsController@showLocalizationView', ]); $router->get('security', [ diff --git a/resources/lang/da/dashboard.php b/resources/lang/da/dashboard.php index abf08995..8107671e 100755 --- a/resources/lang/da/dashboard.php +++ b/resources/lang/da/dashboard.php @@ -164,10 +164,10 @@ return [ 'too-big' => 'Filen du prøvede at uploade er for stort, billet skal være mindre end :size', ], 'analytics' => [ - 'analytics' => 'Analytics' + 'analytics' => 'Analytics', ], 'localization' => [ - 'localization' => 'Localization' + 'localization' => 'Localization', ], 'security' => [ 'security' => 'Sikkerhed', diff --git a/resources/lang/de/dashboard.php b/resources/lang/de/dashboard.php index 47c98912..fc82e734 100755 --- a/resources/lang/de/dashboard.php +++ b/resources/lang/de/dashboard.php @@ -164,10 +164,10 @@ return [ 'too-big' => 'Die von Ihnen hochgeladene Datei ist zu groß. Laden Sie ein Bild welches kleiner als :size ist hoch', ], 'analytics' => [ - 'analytics' => 'Analytics' + 'analytics' => 'Analytics', ], 'localization' => [ - 'localization' => 'Localization' + 'localization' => 'Localization', ], 'security' => [ 'security' => 'Sicherheit', diff --git a/resources/lang/en-UD/dashboard.php b/resources/lang/en-UD/dashboard.php index e910fb20..1dc2e99b 100755 --- a/resources/lang/en-UD/dashboard.php +++ b/resources/lang/en-UD/dashboard.php @@ -164,10 +164,10 @@ return [ 'too-big' => 'crwdns347:0crwdne347:0', ], 'analytics' => [ - 'analytics' => 'Analytics' + 'analytics' => 'Analytics', ], 'localization' => [ - 'localization' => 'Localization' + 'localization' => 'Localization', ], 'security' => [ 'security' => 'crwdns348:0crwdne348:0', diff --git a/resources/lang/en/dashboard.php b/resources/lang/en/dashboard.php index 8ff17fa3..a6555f1d 100755 --- a/resources/lang/en/dashboard.php +++ b/resources/lang/en/dashboard.php @@ -164,10 +164,10 @@ return [ 'too-big' => 'The file you uploaded is too big. Upload an image smaller than :size', ], 'analytics' => [ - 'analytics' => 'Analytics' + 'analytics' => 'Analytics', ], 'localization' => [ - 'localization' => 'Localization' + 'localization' => 'Localization', ], 'security' => [ 'security' => 'Security', diff --git a/resources/lang/es/dashboard.php b/resources/lang/es/dashboard.php index 5f093471..e09c9737 100755 --- a/resources/lang/es/dashboard.php +++ b/resources/lang/es/dashboard.php @@ -116,10 +116,10 @@ return [ 'too-big' => 'El archivo subido es demasiado grande. Sube una imagen con tamaño menor a: tamaño', ], 'analytics' => [ - 'analytics' => 'Analytics' + 'analytics' => 'Analytics', ], 'localization' => [ - 'localization' => 'Localization' + 'localization' => 'Localization', ], 'security' => [ 'security' => 'Seguridad', diff --git a/resources/lang/fr/dashboard.php b/resources/lang/fr/dashboard.php index 0bda3a84..825cc877 100755 --- a/resources/lang/fr/dashboard.php +++ b/resources/lang/fr/dashboard.php @@ -164,10 +164,10 @@ return [ 'too-big' => 'Le fichier déposé est trop grand. Déposer une image d\'une taille inférieur à :size', ], 'analytics' => [ - 'analytics' => 'Analytics' + 'analytics' => 'Analytics', ], 'localization' => [ - 'localization' => 'Localization' + 'localization' => 'Localization', ], 'security' => [ 'security' => 'Sécurité', diff --git a/resources/lang/id/dashboard.php b/resources/lang/id/dashboard.php index 3d786cbc..a635a600 100755 --- a/resources/lang/id/dashboard.php +++ b/resources/lang/id/dashboard.php @@ -164,10 +164,10 @@ return [ 'too-big' => 'Berkas yang anda unggah terlalu besar. Mohon unggah gambar dengan ukuran tidak lebih dari :size', ], 'analytics' => [ - 'analytics' => 'Analytics' + 'analytics' => 'Analytics', ], 'localization' => [ - 'localization' => 'Localization' + 'localization' => 'Localization', ], 'security' => [ 'security' => 'Keamanan', diff --git a/resources/lang/it/dashboard.php b/resources/lang/it/dashboard.php index 27f4637f..12682e8c 100644 --- a/resources/lang/it/dashboard.php +++ b/resources/lang/it/dashboard.php @@ -160,10 +160,10 @@ return [ 'too-big' => 'Il file che hai caricato è troppo grande. Carica un\'immagine più piccola di :size', ], 'analytics' => [ - 'analytics' => 'Analytics' + 'analytics' => 'Analytics', ], 'localization' => [ - 'localization' => 'Localization' + 'localization' => 'Localization', ], 'security' => [ 'security' => 'Sicurezza', diff --git a/resources/lang/ko/dashboard.php b/resources/lang/ko/dashboard.php index 6592cdc0..ab30e87e 100755 --- a/resources/lang/ko/dashboard.php +++ b/resources/lang/ko/dashboard.php @@ -143,10 +143,10 @@ return [ 'too-big' => '업로드 한 파일이 너무 큽니다. :size 보다 작은 이미지를 올려주세요.', ], 'analytics' => [ - 'analytics' => 'Analytics' + 'analytics' => 'Analytics', ], 'localization' => [ - 'localization' => 'Localization' + 'localization' => 'Localization', ], 'security' => [ 'security' => '보안', diff --git a/resources/lang/nl/dashboard.php b/resources/lang/nl/dashboard.php index 2450cbc6..59ca271b 100755 --- a/resources/lang/nl/dashboard.php +++ b/resources/lang/nl/dashboard.php @@ -164,10 +164,10 @@ return [ 'too-big' => 'Het bestand dat u heeft geüpload is te groot. Upload een afbeelding kleiner dan :size', ], 'analytics' => [ - 'analytics' => 'Analytics' + 'analytics' => 'Analytics', ], 'localization' => [ - 'localization' => 'Localization' + 'localization' => 'Localization', ], 'security' => [ 'security' => 'Beveiliging', diff --git a/resources/lang/pl/dashboard.php b/resources/lang/pl/dashboard.php index 905ada06..d74fb150 100755 --- a/resources/lang/pl/dashboard.php +++ b/resources/lang/pl/dashboard.php @@ -143,10 +143,10 @@ return [ 'too-big' => 'Wgrany plik jest zbyt duży. Wgraj plik mnijeszy niż :size', ], 'analytics' => [ - 'analytics' => 'Analytics' + 'analytics' => 'Analytics', ], 'localization' => [ - 'localization' => 'Localization' + 'localization' => 'Localization', ], 'security' => [ 'security' => 'Bezpieczeństwo', diff --git a/resources/lang/pt-BR/dashboard.php b/resources/lang/pt-BR/dashboard.php index f2d901b0..2906bddd 100755 --- a/resources/lang/pt-BR/dashboard.php +++ b/resources/lang/pt-BR/dashboard.php @@ -164,10 +164,10 @@ return [ 'too-big' => 'O arquivo que você carregou é muito grande. Envie uma imagem inferior à :size', ], 'analytics' => [ - 'analytics' => 'Analytics' + 'analytics' => 'Analytics', ], 'localization' => [ - 'localization' => 'Localization' + 'localization' => 'Localization', ], 'security' => [ 'security' => 'Segurança', diff --git a/resources/lang/ru/dashboard.php b/resources/lang/ru/dashboard.php index e9b005a0..4b83868c 100644 --- a/resources/lang/ru/dashboard.php +++ b/resources/lang/ru/dashboard.php @@ -143,10 +143,10 @@ return [ 'too-big' => 'Загруженный вами файл слишком большой. Загрузите картинку меньше чем :size', ], 'analytics' => [ - 'analytics' => 'Analytics' + 'analytics' => 'Analytics', ], 'localization' => [ - 'localization' => 'Localization' + 'localization' => 'Localization', ], 'security' => [ 'security' => 'Безопасность', diff --git a/resources/lang/zh-CN/dashboard.php b/resources/lang/zh-CN/dashboard.php index 8b43f89f..2e4f76fc 100755 --- a/resources/lang/zh-CN/dashboard.php +++ b/resources/lang/zh-CN/dashboard.php @@ -143,10 +143,10 @@ return [ 'too-big' => '你上传的文件太大了。上传的图像大小应小于:size', ], 'analytics' => [ - 'analytics' => 'Analytics' + 'analytics' => 'Analytics', ], 'localization' => [ - 'localization' => 'Localization' + 'localization' => 'Localization', ], 'security' => [ 'security' => '安全',