mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-17 21:49:01 +01:00
Preparing a SetupController
This commit is contained in:
parent
8d4bf3f5ea
commit
e5a70aef0b
7
app/controllers/SetupController.php
Normal file
7
app/controllers/SetupController.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
class SetupController extends Controller {
|
||||
public function showSetup() {
|
||||
return View::make('setup');
|
||||
}
|
||||
}
|
@ -1,26 +1,6 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application & Route Filters
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Below you will find the "before" and "after" events for the application
|
||||
| which may be used to do any work before or after a request into your
|
||||
| application. Here you may also register your custom route filters.
|
||||
|
|
||||
*/
|
||||
|
||||
App::before(function($request)
|
||||
{
|
||||
//
|
||||
});
|
||||
|
||||
|
||||
App::after(function($request, $response)
|
||||
{
|
||||
//
|
||||
});
|
||||
Route::filter('no_setup', 'NoSetupFilter');
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
10
app/filters/NoSetupFilter.php
Normal file
10
app/filters/NoSetupFilter.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
class NoSetupFilter {
|
||||
public function filter($route, $request, $settingName) {
|
||||
$setting = Setting::get($settingName);
|
||||
if ($setting === null) {
|
||||
return Response::make('Unauthorized', 401);
|
||||
}
|
||||
}
|
||||
}
|
@ -2,3 +2,7 @@
|
||||
|
||||
Route::get('/', 'HomeController@showIndex');
|
||||
Route::get('/incident/{incident}', 'HomeController@showIncident');
|
||||
|
||||
Route::group(['before' => 'no_setup:app_name'], function() {
|
||||
Route::get('/setup', 'SetupController@showSetup');
|
||||
});
|
||||
|
@ -17,6 +17,7 @@ ClassLoader::addDirectories(array(
|
||||
app_path().'/controllers',
|
||||
app_path().'/models',
|
||||
app_path().'/database/seeds',
|
||||
app_path().'/filterss',
|
||||
|
||||
));
|
||||
|
||||
|
15
app/views/setup.blade.php
Normal file
15
app/views/setup.blade.php
Normal file
@ -0,0 +1,15 @@
|
||||
@extends('layout.master')
|
||||
|
||||
@section('content')
|
||||
<div class='page-header'>
|
||||
<ul class='list-group components'>
|
||||
@foreach(Component::get() as $component)
|
||||
<li class='list-group-item component '>
|
||||
<!-- <span class='badge badge-{{ $component->color }}'><i class='glyphicon glyphicon-stop'></i></span> -->
|
||||
<h4>{{ $component->name }} <small class='{{ $component->color }}'>{{ $component->humanStatus }}</small></h4>
|
||||
<p>{{ $component->description }}</p>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@stop
|
@ -15,7 +15,8 @@
|
||||
"app/models",
|
||||
"app/database/migrations",
|
||||
"app/database/seeds",
|
||||
"app/tests/TestCase.php"
|
||||
"app/tests/TestCase.php",
|
||||
"app/filters"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user