diff --git a/app/controllers/DashComponentController.php b/app/controllers/DashComponentController.php index 19d06e3b..a7a74341 100644 --- a/app/controllers/DashComponentController.php +++ b/app/controllers/DashComponentController.php @@ -11,7 +11,7 @@ class DashComponentController extends Controller { $components = Component::all(); - return View::make('dashboard.components')->with([ + return View::make('dashboard.components.index')->with([ 'pageTitle' => 'Components - Dashboard', 'components' => $components, ]); @@ -26,7 +26,7 @@ class DashComponentController extends Controller */ public function showEditComponent(Component $component) { - return View::make('dashboard.component-edit')->with([ + return View::make('dashboard.components.edit')->with([ 'pageTitle' => 'Editing "'.$component->name.'" Component - Dashboard', 'component' => $component, ]); @@ -54,7 +54,7 @@ class DashComponentController extends Controller */ public function showAddComponent() { - return View::make('dashboard.component-add')->with([ + return View::make('dashboard.components.add')->with([ 'pageTitle' => 'Add Component - Dashboard', ]); } diff --git a/app/controllers/DashIncidentController.php b/app/controllers/DashIncidentController.php index 8ea2a7ac..7fa55bf9 100644 --- a/app/controllers/DashIncidentController.php +++ b/app/controllers/DashIncidentController.php @@ -11,7 +11,7 @@ class DashIncidentController extends Controller { $incidents = Incident::orderBy('created_at', 'desc')->get(); - return View::make('dashboard.incidents')->with([ + return View::make('dashboard.incidents.index')->with([ 'pageTitle' => 'Incidents - Dashboard', 'incidents' => $incidents, ]); @@ -24,7 +24,7 @@ class DashIncidentController extends Controller */ public function showAddIncident() { - return View::make('dashboard.incident-add')->with([ + return View::make('dashboard.incidents.add')->with([ 'pageTitle' => 'Add Incident - Dashboard', ]); } @@ -36,7 +36,7 @@ class DashIncidentController extends Controller */ public function showAddIncidentTemplate() { - return View::make('dashboard.incident-template')->with([ + return View::make('dashboard.incidents.incident-template')->with([ 'pageTitle' => 'Add Incident Template - Dashboard', ]); } diff --git a/app/controllers/DashSettingsController.php b/app/controllers/DashSettingsController.php index a23ff300..f42c5e8b 100644 --- a/app/controllers/DashSettingsController.php +++ b/app/controllers/DashSettingsController.php @@ -47,7 +47,7 @@ class DashSettingsController extends Controller { $this->subMenu['setup']['active'] = true; - return View::make('dashboard.settings-app-setup')->with([ + return View::make('dashboard.settings.app-setup')->with([ 'pageTitle' => 'Application Setup - Dashboard', 'subMenu' => $this->subMenu, ]); @@ -62,7 +62,7 @@ class DashSettingsController extends Controller { $this->subMenu['theme']['active'] = true; - return View::make('dashboard.settings-theme')->with([ + return View::make('dashboard.settings.theme')->with([ 'pageTitle' => 'Theme - Dashboard', 'subMenu' => $this->subMenu, ]); @@ -77,7 +77,7 @@ class DashSettingsController extends Controller { $this->subMenu['security']['active'] = true; - return View::make('dashboard.settings-security')->with([ + return View::make('dashboard.settings.security')->with([ 'pageTitle' => 'Security - Dashboard', 'subMenu' => $this->subMenu, ]); @@ -92,7 +92,7 @@ class DashSettingsController extends Controller { $this->subMenu['stylesheet']['active'] = true; - return View::make('dashboard.settings-stylesheet')->with([ + return View::make('dashboard.settings.stylesheet')->with([ 'pageTitle' => 'Stylesheet - Dashboard', 'subMenu' => $this->subMenu, ]); diff --git a/app/controllers/DashUserController.php b/app/controllers/DashUserController.php index 4e18a0d4..0c09ca8a 100644 --- a/app/controllers/DashUserController.php +++ b/app/controllers/DashUserController.php @@ -9,7 +9,7 @@ class DashUserController extends Controller */ public function showUser() { - return View::make('dashboard.user')->with([ + return View::make('dashboard.user.index')->with([ 'pageTitle' => 'User - Dashboard', ]); } diff --git a/app/controllers/DashboardController.php b/app/controllers/DashboardController.php index 0020feff..ef1fc4f1 100644 --- a/app/controllers/DashboardController.php +++ b/app/controllers/DashboardController.php @@ -24,7 +24,7 @@ class DashboardController extends Controller */ public function showMetrics() { - return View::make('dashboard.metrics')->with([ + return View::make('dashboard.metrics.index')->with([ 'pageTitle' => 'Metrics - Dashboard', ]); } @@ -36,7 +36,7 @@ class DashboardController extends Controller */ public function showNotifications() { - return View::make('dashboard.notifications')->with([ + return View::make('dashboard.notifications.index')->with([ 'pageTitle' => 'Notifications - Dashboard', ]); } diff --git a/app/helpers.php b/app/helpers.php index 0e6a3bc2..d48c5df5 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -23,3 +23,26 @@ if (! function_exists('elixir')) { throw new InvalidArgumentException("File {$file} not defined in asset manifest."); } } + +if (! function_exists('set_active')) { + + /** + * Set active class if request is in path. + * + * @param $path + * @param array $classes + * @param string $active + * + * @return string + */ + function set_active($path, $classes = [], $active = 'active') + { + if (Request::is($path)) { + $classes[] = $active; + } + + $class = implode(' ', $classes); + + return empty($classes) ? '' : "class=\"{$class}\""; + } +} diff --git a/app/views/dashboard/component-add.blade.php b/app/views/dashboard/components/add.blade.php similarity index 100% rename from app/views/dashboard/component-add.blade.php rename to app/views/dashboard/components/add.blade.php diff --git a/app/views/dashboard/component-edit.blade.php b/app/views/dashboard/components/edit.blade.php similarity index 100% rename from app/views/dashboard/component-edit.blade.php rename to app/views/dashboard/components/edit.blade.php diff --git a/app/views/dashboard/components.blade.php b/app/views/dashboard/components/index.blade.php similarity index 100% rename from app/views/dashboard/components.blade.php rename to app/views/dashboard/components/index.blade.php diff --git a/app/views/dashboard/incident-add.blade.php b/app/views/dashboard/incidents/add.blade.php similarity index 100% rename from app/views/dashboard/incident-add.blade.php rename to app/views/dashboard/incidents/add.blade.php diff --git a/app/views/dashboard/incident-template.blade.php b/app/views/dashboard/incidents/incident-template.blade.php similarity index 100% rename from app/views/dashboard/incident-template.blade.php rename to app/views/dashboard/incidents/incident-template.blade.php diff --git a/app/views/dashboard/incidents.blade.php b/app/views/dashboard/incidents/index.blade.php similarity index 100% rename from app/views/dashboard/incidents.blade.php rename to app/views/dashboard/incidents/index.blade.php diff --git a/app/views/dashboard/metrics.blade.php b/app/views/dashboard/metrics/index.blade.php similarity index 100% rename from app/views/dashboard/metrics.blade.php rename to app/views/dashboard/metrics/index.blade.php diff --git a/app/views/dashboard/notifications.blade.php b/app/views/dashboard/notifications/index.blade.php similarity index 100% rename from app/views/dashboard/notifications.blade.php rename to app/views/dashboard/notifications/index.blade.php diff --git a/app/views/dashboard/settings-app-setup.blade.php b/app/views/dashboard/settings/app-setup.blade.php similarity index 100% rename from app/views/dashboard/settings-app-setup.blade.php rename to app/views/dashboard/settings/app-setup.blade.php diff --git a/app/views/dashboard/settings-security.blade.php b/app/views/dashboard/settings/security.blade.php similarity index 100% rename from app/views/dashboard/settings-security.blade.php rename to app/views/dashboard/settings/security.blade.php diff --git a/app/views/dashboard/settings-stylesheet.blade.php b/app/views/dashboard/settings/stylesheet.blade.php similarity index 100% rename from app/views/dashboard/settings-stylesheet.blade.php rename to app/views/dashboard/settings/stylesheet.blade.php diff --git a/app/views/dashboard/settings-theme.blade.php b/app/views/dashboard/settings/theme.blade.php similarity index 100% rename from app/views/dashboard/settings-theme.blade.php rename to app/views/dashboard/settings/theme.blade.php diff --git a/app/views/dashboard/user.blade.php b/app/views/dashboard/user/index.blade.php similarity index 100% rename from app/views/dashboard/user.blade.php rename to app/views/dashboard/user/index.blade.php diff --git a/app/views/partials/dashboard/sidebar.blade.php b/app/views/partials/dashboard/sidebar.blade.php index 9ad165e0..80ad52e7 100644 --- a/app/views/partials/dashboard/sidebar.blade.php +++ b/app/views/partials/dashboard/sidebar.blade.php @@ -24,42 +24,37 @@