Layout updates and extensions. Found a problem I need closures for. Yay! [skip ci]

This commit is contained in:
James Cole
2014-07-28 14:53:04 +02:00
parent 2680cd8b7a
commit b0ddc04a0d
17 changed files with 233 additions and 44 deletions

View File

@@ -0,0 +1,51 @@
@extends('layouts.default')
@section('content')
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<h1>Firefly
<small>Delete "{{{$budget->name}}}"</small>
</h1>
<p class="lead">
Remember that deleting something is permanent.
</p>
</div>
</div>
{{Form::open(['class' => 'form-horizontal','url' => route('budgets.destroy')])}}
{{Form::hidden('id',$budget->id)}}
{{Form::hidden('from',e(Input::get('from')))}}
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
@if($budget->transactionjournals()->count() > 0)
<p class="text-info">
Account "{{{$budget->name}}}" still has {{$budget->transactionjournals()->count()}} transaction(s) associated to it.
These will NOT be deleted but will lose their connection to the budget.
</p>
@endif
<p class="text-danger">
Press "Delete permanently" If you are sure you want to delete "{{{$budget->name}}}".
</p>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="form-group">
<div class="col-sm-8">
<button type="submit" class="btn btn-default btn-danger">Delete permanently</button>
@if(Input::get('from') == 'date')
<a href="{{route('budgets.index')}}" class="btn-default btn">Cancel</a>
@else
<a href="{{route('budgets.index.budget')}}" class="btn-default btn">Cancel</a>
@endif
</div>
</div>
</div>
</div>
{{Form::close()}}
@stop

View File

@@ -0,0 +1,51 @@
@extends('layouts.default')
@section('content')
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<h1>Firefly
<small>Edit budget "{{{$budget->name}}}"</small>
</h1>
<p class="lead">Use budgets to organize and limit your expenses.</p>
</div>
</div>
{{Form::open(['class' => 'form-horizontal','url' => route('budgets.update')])}}
{{Form::hidden('id',$budget->id)}}
{{Form::hidden('from',e(Input::get('from')))}}
<div class="row">
<div class="col-lg-6 col-md-12 col-sm-6">
<h4>Mandatory fields</h4>
<div class="form-group">
<label for="name" class="col-sm-4 control-label">Name</label>
<div class="col-sm-8">
<input type="text" name="name" class="form-control" id="name" value="{{Input::old('name') ?: $budget->name}}" placeholder="Name">
@if($errors->has('name'))
<p class="text-danger">{{$errors->first('name')}}</p>
@else
<span class="help-block">For example: groceries, bills</span>
@endif
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-12 col-sm-6">
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<button type="submit" class="btn btn-default btn-success">Update the budget</button>
</div>
</div>
</div>
</div>
{{Form::close()}}
@stop

View File

@@ -74,11 +74,7 @@
</div>
<div class="col-sm-3">
<small>
@if($limit->repeat_freq == 'monthly')
{{$rep->startdate->format('F Y')}}
@else
NO FORMAT
@endif
CLOSURE TODO
</small>
</div>
@if($limit->repeats == 1)
@@ -104,8 +100,8 @@
</td>
<td>
<div class="btn-group btn-group-sm">
<a href="#" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span></a>
<a href="#" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span></a>
<a href="{{route('budgets.edit',$budget->id)}}?from=budget" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span></a>
<a href="{{route('budgets.delete',$budget->id)}}?from=budget" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span></a>
</div>
</td>

View File

@@ -48,8 +48,8 @@
<tr>
<td>
<div class="btn-group">
<a title="Edit budget {{{$repetition->limit->budget->name}}}" href="{{route('budgets.edit',$repetition->limit->budget->id)}}" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a>
<a title="Delete budget {{{$repetition->limit->budget->name}}}" href="{{route('budgets.delete',$repetition->limit->budget->id)}}" class="btn btn-xs btn-danger"><span class="glyphicon glyphicon-trash"></span></a>
<a title="Edit budget {{{$repetition->limit->budget->name}}}" href="{{route('budgets.edit',$repetition->limit->budget->id)}}?from=date" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a>
<a title="Delete budget {{{$repetition->limit->budget->name}}}" href="{{route('budgets.delete',$repetition->limit->budget->id)}}?from=date" class="btn btn-xs btn-danger"><span class="glyphicon glyphicon-trash"></span></a>
</div>
</td>
<td>