mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-17 21:49:01 +01:00
Basic output of incidents
This commit is contained in:
parent
ba6892e858
commit
fab38a766d
@ -155,6 +155,7 @@ return array(
|
||||
'Auth' => 'Illuminate\Support\Facades\Auth',
|
||||
'Blade' => 'Illuminate\Support\Facades\Blade',
|
||||
'Cache' => 'Illuminate\Support\Facades\Cache',
|
||||
'Carbon' => 'Carbon\Carbon',
|
||||
'ClassLoader' => 'Illuminate\Support\ClassLoader',
|
||||
'Config' => 'Illuminate\Support\Facades\Config',
|
||||
'Controller' => 'Illuminate\Routing\Controller',
|
||||
|
@ -1,23 +1,7 @@
|
||||
<?php
|
||||
|
||||
class HomeController extends BaseController {
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Home Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may wish to use controllers instead of, or in addition to, Closure
|
||||
| based routes. That's great! Here is an example controller method to
|
||||
| get you started. To route to this controller, just add the route:
|
||||
|
|
||||
| Route::get('/', 'HomeController@showWelcome');
|
||||
|
|
||||
*/
|
||||
|
||||
public function showWelcome()
|
||||
{
|
||||
return View::make('hello');
|
||||
class HomeController extends BaseController {
|
||||
public function showIndex() {
|
||||
return View::make('index');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
<?php
|
||||
|
||||
Route::get('/', function() {
|
||||
return View::make('hello');
|
||||
});
|
||||
Route::get('/', 'HomeController@showIndex');
|
||||
|
19
app/views/incident.blade.php
Normal file
19
app/views/incident.blade.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
$incidentDate = Carbon::now()->subDays($i);
|
||||
$incidents = Incident::where('created_at', $incidentDate)->get()
|
||||
?>
|
||||
<li>
|
||||
<h1>{{ $incidentDate->format('jS M, Y') }}</h1>
|
||||
<ul>
|
||||
@if($incidents->count() === 0)
|
||||
<li>No incidents reported.</li>
|
||||
@else
|
||||
@foreach($incidents as $incident)
|
||||
<li>
|
||||
<h2>{{ $incident->name }}</h2>
|
||||
<p>{{ $incident->message }}</p>
|
||||
</li>
|
||||
@endforeach
|
||||
@endif
|
||||
</ul>
|
||||
</li>
|
9
app/views/index.blade.php
Normal file
9
app/views/index.blade.php
Normal file
@ -0,0 +1,9 @@
|
||||
@extends('layout.master')
|
||||
|
||||
@section('content')
|
||||
<ul>
|
||||
@for ($i=0; $i <= 7; $i++)
|
||||
@include('incident', array('i', $i))
|
||||
@endfor
|
||||
</ul>
|
||||
@stop
|
10
app/views/layout/master.blade.php
Normal file
10
app/views/layout/master.blade.php
Normal file
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Cachet</title>
|
||||
</head>
|
||||
<body>
|
||||
@section('content')
|
||||
@show
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user