Routing tidy up
This commit is contained in:
@@ -2,23 +2,12 @@
|
||||
|
||||
// Prevent access until the app is setup.
|
||||
Route::group(['before' => 'has_setting:app_name'], function() {
|
||||
Route::get('/', 'HomeController@showIndex');
|
||||
Route::get('/', ['as' => 'status-page', 'uses' => 'HomeController@showIndex']);
|
||||
Route::get('/incident/{incident}', 'HomeController@showIncident');
|
||||
|
||||
Route::get('/auth/login', 'AuthController@showLogin')->before('guest');
|
||||
Route::post('/auth/login', 'AuthController@postLogin')->before('guest|csrf');
|
||||
});
|
||||
|
||||
Route::group(['before' => 'no_setup:app_name'], function() {
|
||||
Route::controller('/setup', 'SetupController');
|
||||
});
|
||||
|
||||
Route::group(['before' => 'auth'], function() {
|
||||
// Dashboard/Management Panel etc.
|
||||
Route::get('/dashboard', 'DashboardController@showDashboard');
|
||||
|
||||
// Authorization stuff.
|
||||
Route::get('/auth/logout', 'AuthController@logoutAction');
|
||||
});
|
||||
|
||||
Route::get('/rss', 'RSSController@feedAction');
|
||||
|
||||
8
app/routes/auth.php
Normal file
8
app/routes/auth.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
Route::group(['before' => 'has_setting:app_name'], function() {
|
||||
Route::get('/auth/login', ['before' => 'guest', 'as' => 'login', 'uses' => 'AuthController@showLogin']);
|
||||
Route::post('/auth/login', ['before' => 'guest|csrf', 'as' => 'logout', 'uses' => 'AuthController@postLogin']);
|
||||
});
|
||||
|
||||
Route::get('/auth/logout', ['before' => 'auth', 'as' => 'logout', 'uses' => 'AuthController@logoutAction']);
|
||||
10
app/routes/dashboard.php
Normal file
10
app/routes/dashboard.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
Route::group(['before' => 'auth', 'prefix' => 'dashboard'], function() {
|
||||
Route::get('/', ['as' => 'dashboard', 'uses' => 'DashboardController@showDashboard']);
|
||||
Route::get('components', ['as' => 'dashboard.components', 'uses' => 'DashboardController@showDashboard']);
|
||||
Route::get('incidents', ['as' => 'dashboard.incidents', 'uses' => 'DashboardController@showDashboard']);
|
||||
Route::get('metrics', ['as' => 'dashboard.metrics', 'uses' => 'DashboardController@showDashboard']);
|
||||
Route::get('status-page', ['as' => 'dashboard.status-page', 'uses' => 'DashboardController@showDashboard']);
|
||||
Route::get('settings', ['as' => 'dashboard.settings', 'uses' => 'DashboardController@showDashboard']);
|
||||
});
|
||||
@@ -14,9 +14,9 @@
|
||||
</head>
|
||||
|
||||
<body class="dashboard">
|
||||
@include('partials.dashboard-nav')
|
||||
@include('partials.dashboard.nav')
|
||||
<div class="wrapper active">
|
||||
@include('partials.dashboard-sidebar')
|
||||
@include('partials.dashboard.sidebar')
|
||||
<div class="content">
|
||||
@yield('content')
|
||||
</div>
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
<div class="sidebar">
|
||||
<div class="profile">
|
||||
<div class="avatar pull-left">
|
||||
<a href="{{ URL::to('settings') }}">
|
||||
<img src="{{ Auth::user()->gravatar }}" alt="">
|
||||
</a>
|
||||
</div>
|
||||
<div class="profile pull-left">
|
||||
<div class="username">{{ Auth::user()->username }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul>
|
||||
<li><a href="{{ URL::to('dashboard') }}"><i class="fa fa-dashboard"></i> {{ Lang::get('cachet.dashboard.dashboard') }}</a></li>
|
||||
<li><a href="{{ URL::to('components') }}"><i class="fa fa-list-ul"></i> {{ Lang::get('cachet.dashboard.components') }}</a></li>
|
||||
<li class="active"><a href="{{ URL::to('incidents') }}"><i class="fa fa-exclamation-triangle"></i> {{ Lang::get('cachet.dashboard.incidents') }}</a></li>
|
||||
<li><a href="{{ URL::to('metrics') }}"><i class="fa fa-area-chart"></i> {{ Lang::get('cachet.dashboard.metrics') }}</a></li>
|
||||
<li><a href="{{ URL::to('status-page') }}"><i class="fa fa-exclamation-circle"></i> {{ Lang::get('cachet.dashboard.status_page') }}</a></li>
|
||||
<li><a href="{{ URL::to('settings') }}"><i class="fa fa-cogs"></i> {{ Lang::get('cachet.dashboard.settings') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -12,8 +12,8 @@
|
||||
|
||||
<div class="collapse navbar-collapse" id="menu">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a href="{{ URL::to('/') }}"><i class="fa fa-exclamation-circle"></i> {{ Lang::get('cachet.dashboard.status_page') }}</a></li>
|
||||
<li><a href="{{ URL::to('auth/logout') }}"><i class="fa fa-sign-out"></i> {{ Lang::get('cachet.logout') }}</a></li>
|
||||
<li><a href="{{ URL::route('status-page') }}"><i class="fa fa-exclamation-circle"></i> {{ Lang::get('cachet.dashboard.status_page') }}</a></li>
|
||||
<li><a href="{{ URL::route('logout') }}"><i class="fa fa-sign-out"></i> {{ Lang::get('cachet.logout') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
44
app/views/partials/dashboard/sidebar.blade.php
Normal file
44
app/views/partials/dashboard/sidebar.blade.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<div class="sidebar">
|
||||
<div class="profile">
|
||||
<div class="avatar pull-left">
|
||||
<a href="{{ URL::to('settings') }}">
|
||||
<img src="{{ Auth::user()->gravatar }}" alt="">
|
||||
</a>
|
||||
</div>
|
||||
<div class="profile pull-left">
|
||||
<div class="username">{{ Auth::user()->username }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="{{ Request::is('dashboard') ? 'active' : '' }}">
|
||||
<a href="{{ URL::route('dashboard') }}">
|
||||
<i class="fa fa-dashboard"></i> {{ Lang::get('cachet.dashboard.dashboard') }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="{{ Request::is('dashboard/components') ? 'active' : '' }}">
|
||||
<a href="{{ URL::route('dashboard.components') }}">
|
||||
<i class="fa fa-list-ul"></i> {{ Lang::get('cachet.dashboard.components') }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="{{ Request::is('dashboard/incidents') ? 'active' : '' }}">
|
||||
<a href="{{ URL::route('dashboard.incidents') }}">
|
||||
<i class="fa fa-exclamation-triangle"></i> {{ Lang::get('cachet.dashboard.incidents') }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="{{ Request::is('dashboard/metrics') ? 'active' : '' }}">
|
||||
<a href="{{ URL::route('dashboard.metrics') }}">
|
||||
<i class="fa fa-area-chart"></i> {{ Lang::get('cachet.dashboard.metrics') }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="{{ Request::is('dashboard/status-page') ? 'active' : '' }}">
|
||||
<a href="{{ URL::route('dashboard.status-page') }}">
|
||||
<i class="fa fa-exclamation-circle"></i> {{ Lang::get('cachet.dashboard.status_page') }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="{{ Request::is('dashboard/settings') ? 'active' : '' }}">
|
||||
<a href="{{ URL::route('dashboard.settings') }}">
|
||||
<i class="fa fa-cogs"></i> {{ Lang::get('cachet.dashboard.settings') }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
Reference in New Issue
Block a user