Some work for the piggy bank show routine [skip ci]

This commit is contained in:
James Cole 2014-08-11 07:28:47 +02:00
parent 41562f8f6d
commit dbcf6613c6
4 changed files with 28 additions and 10 deletions

View File

@ -103,8 +103,9 @@ class PiggybankController extends BaseController
/**
*
*/
public function show()
public function show(Piggybank $piggyBank)
{
return View::make('piggybanks.show')->with('piggyBank',$piggyBank);
}
/**

View File

@ -3,12 +3,12 @@
<form role="form" method="GET" action="{{Request::url()}}">
<?php $r = Session::get('range', '1M'); ?>
<div class="row">
<div class="col-lg-2">
<div class="col-lg-2 col-md-2 col-sm-2">
<button name="action" value="prev" class="btn btn-default @if($r=='1D') btn-info @endif btn-sm"
type="submit">&laquo; Previous {{Config::get('firefly.range_to_text.'.$r)}}
</button>
</div>
<div class="col-lg-3">
<div class="col-lg-3 col-md-3 col-sm-3">
<div class="btn-group btn-group-sm">
<button name="range" value="1D" class="btn btn-default @if($r=='1D') btn-info @endif btn-sm"
type="submit">1D
@ -27,20 +27,20 @@
</button>
</div>
</div>
<div class="col-lg-2">
<div class="col-lg-2 col-md-2 col-sm-2">
<input value="{{Session::get('start')->format('Y-m-d')}}" name="start" type="date"
class="form-control input-sm">
</div>
<div class="col-lg-2">
<div class="col-lg-2 col-md-2 col-sm-2">
<input value="{{Session::get('end')->format('Y-m-d')}}" name="end" type="date"
class="form-control input-sm">
</div>
<div class="col-lg-1">
<div class="col-lg-1 col-md-1 col-sm-1">
<button class="btn btn-default btn-sm @if($r=='custom') btn-info @endif" type="submit" name="range"
value="custom">Custom
</button>
</div>
<div class="col-lg-2" style="text-align:right;">
<div class="col-lg-2 col-md-2 col-sm-2" style="text-align:right;">
<button name="action" value="next" class="btn btn-default @if($r=='1D') btn-info @endif btn-sm"
type="submit">&raquo; Next {{Config::get('firefly.range_to_text.'.$r)}}
</button>
@ -48,7 +48,5 @@
</div>
</form>
</div>
</div>

View File

@ -47,7 +47,7 @@
<h3>Piggy banks</h3>
@foreach($piggybanks as $piggybank)
<h4>{{{$piggybank->name}}} <small>{{mf($piggybank->target)}}</small></h4>
<h4><a href="{{route('piggybanks.show',$piggybank->id)}}">{{{$piggybank->name}}}</a> <small>{{mf($piggybank->target)}}</small></h4>
@if(!is_null($piggybank->targetdate))
<p>
Target date: {{$piggybank->targetdate->format('jS F Y')}}

View File

@ -0,0 +1,19 @@
@extends('layouts.default')
@section('content')
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<h1>Firefly
<small>Piggy bank "{{{$piggyBank->name}}}"</small>
</h1>
<p class="lead">Set targets and save money</p>
<p class="text-info">
Saving money is <em>hard</em>. Piggy banks allow you to group money
from an account together. If you also set a target (and a target date) you
can save towards your goals.
</p>
</div>
</div>
@stop
@section('scripts')
@stop