mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-09 23:41:10 +00:00
Some basic fixes for the transaction controller [skip ci]
This commit is contained in:
@@ -28,10 +28,10 @@
|
||||
<td>
|
||||
@foreach($journal->components as $component)
|
||||
@if($component->class == 'Budget')
|
||||
<a href="#budget-overview"><span class="glyphicon glyphicon-tasks" title="Budget: {{{$component->name}}}"></span></a>
|
||||
<a href="#budget-overview-in-month"><span class="glyphicon glyphicon-tasks" title="Budget: {{{$component->name}}}"></span></a>
|
||||
@endif
|
||||
@if($component->class == 'Category')
|
||||
<a href="#category-overview"><span class="glyphicon glyphicon-tag" title="Category: {{{$component->name}}}"></span></a>
|
||||
<a href="#category-overview-in-month"><span class="glyphicon glyphicon-tag" title="Category: {{{$component->name}}}"></span></a>
|
||||
@endif
|
||||
@endforeach
|
||||
</td>
|
||||
|
||||
45
app/views/piggybanks/delete.blade.php
Normal file
45
app/views/piggybanks/delete.blade.php
Normal file
@@ -0,0 +1,45 @@
|
||||
@extends('layouts.default')
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<h1>Firefly
|
||||
<small>Delete piggy bank</small>
|
||||
</h1>
|
||||
<p class="lead">Remember that deleting something is permanent.</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{Form::open(['class' => 'form-horizontal','url' => route('piggybanks.destroy',$piggybank->id)])}}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<h4> </h4>
|
||||
<p class="text-info">
|
||||
This form allows you to delete the piggy bank "{{{$piggybank->name}}}".
|
||||
</p>
|
||||
<p class="text-info">
|
||||
Destroying an envelope does not remove any transactions or accounts.
|
||||
</p>
|
||||
<p class="text-danger">
|
||||
Are you sure?
|
||||
</p>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-8">
|
||||
<input type="submit" name="submit" value="Remove piggy bank" class="btn btn-danger" />
|
||||
@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
|
||||
105
app/views/piggybanks/edit.blade.php
Normal file
105
app/views/piggybanks/edit.blade.php
Normal file
@@ -0,0 +1,105 @@
|
||||
@extends('layouts.default')
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<h1>Firefly
|
||||
<small>Edit piggy bank "{{{$piggybank->name}}}"</small>
|
||||
</h1>
|
||||
<p class="lead">Use piggy banks to make saving money easier</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>
|
||||
|
||||
{{Form::open(['class' => 'form-horizontal','url' => route('piggybanks.update')])}}
|
||||
{{Form::hidden('id',$piggybank->id)}}
|
||||
<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') ?: $piggybank->name}}}" placeholder="Name">
|
||||
@if($errors->has('name'))
|
||||
<p class="text-danger">{{$errors->first('name')}}</p>
|
||||
@else
|
||||
<span class="help-block">For example: new bike, new camera</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('target', 'Target amount', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">€</span>
|
||||
{{Form::input('number','target', Input::old('target') ?: $piggybank->target, ['step' => 'any', 'min' => '1', 'class' => 'form-control'])}}
|
||||
</div>
|
||||
|
||||
@if($errors->has('target'))
|
||||
<p class="text-danger">{{$errors->first('target')}}</p>
|
||||
@else
|
||||
<span class="help-block">How much money do you need to save?</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="account_id" class="col-sm-4 control-label">
|
||||
Saving account
|
||||
</label>
|
||||
<div class="col-sm-8">
|
||||
{{Form::select('account_id',$accounts,Input::old('account_id') ?: $piggybank->account_id,['class' => 'form-control'])}}
|
||||
@if($errors->has('account_id'))
|
||||
<p class="text-danger">{{$errors->first('account_id')}}</p>
|
||||
@else
|
||||
<span class="help-block">Indicate on which account you've got your savings.</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-12 col-sm-6">
|
||||
<h4>Optional fields</h4>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('targetdate', 'Target date', ['class' => 'col-sm-4 control-label'])}}
|
||||
<div class="col-sm-8">
|
||||
{{ Form::input('date','targetdate', Input::old('targetdate') ?: $piggybank->targetdate, ['class'
|
||||
=> 'form-control']) }}
|
||||
@if($errors->has('targetdate'))
|
||||
<p class="text-danger">{{$errors->first('targetdate')}}</p>
|
||||
@else
|
||||
<span class="help-block">
|
||||
If you want to, set a target date. This will inform you how much money you should save to
|
||||
get to the target amount.
|
||||
</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">Create the piggy bank</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{Form::close()}}
|
||||
|
||||
|
||||
@stop
|
||||
@@ -28,12 +28,14 @@
|
||||
<th>Account</th>
|
||||
<th>Current balance</th>
|
||||
<th>Left for (other) piggy banks</th>
|
||||
<th>Total target</th>
|
||||
</tr>
|
||||
@foreach($accounts as $account)
|
||||
<tr>
|
||||
<td>{{{$account->name}}}</td>
|
||||
<td id="account_{{$account->id}}_total" data-raw="{{$account->balance}}">{{mf($account->balance)}}</td>
|
||||
<td id="account_{{$account->id}}_left" data-raw="{{$account->left}}">{{mf($account->left)}}</td>
|
||||
<td>{{mf($account->total)}}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@@ -46,6 +48,11 @@
|
||||
|
||||
@foreach($piggybanks as $piggybank)
|
||||
<h4>{{{$piggybank->name}}} <small>{{mf($piggybank->target)}}</small></h4>
|
||||
@if(!is_null($piggybank->targetdate))
|
||||
<p>
|
||||
Target date: {{$piggybank->targetdate->format('jS F Y')}}
|
||||
</p>
|
||||
@endif
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td style="width:15%;">
|
||||
@@ -56,6 +63,12 @@
|
||||
</td>
|
||||
<td><input type="range" data-account="{{$piggybank->account_id}}" name="piggy_{{$piggybank->id}}" min="0" max="{{$piggybank->target}}" step="any" value="{{$piggybank->amount}}" /></td>
|
||||
<td style="width: 10%;"><span id="piggy_{{$piggybank->id}}_pct">{{$piggybank->pct}}</span></td>
|
||||
<td style="width:8%;">
|
||||
<div class="btn-group btn-group-xs">
|
||||
<a href="{{route('piggybanks.edit',$piggybank->id)}}" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a>
|
||||
<a href="{{route('piggybanks.delete',$piggybank->id)}}" class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-trash"></span></a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@endforeach
|
||||
|
||||
@@ -82,6 +82,9 @@
|
||||
<label for="account_from_id" class="col-sm-4 control-label">Account from</label>
|
||||
<div class="col-sm-8">
|
||||
{{Form::select('account_from_id',$accounts,Input::old('account_from_id'),['class' => 'form-control'])}}
|
||||
@if($errors->has('account_from_id'))
|
||||
<p class="text-danger">{{$errors->first('account_from_id')}}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -89,6 +92,9 @@
|
||||
<label for="account_to_id" class="col-sm-4 control-label">Account to</label>
|
||||
<div class="col-sm-8">
|
||||
{{Form::select('account_to_id',$accounts,Input::old('account_to_id'),['class' => 'form-control'])}}
|
||||
@if($errors->has('account_to_id'))
|
||||
<p class="text-danger">{{$errors->first('account_to_id')}}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@@ -108,6 +114,9 @@
|
||||
</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="number" name="amount" min="0.01" value="{{Input::old('amount')}}" step="any" class="form-control" />
|
||||
@if($errors->has('amount'))
|
||||
<p class="text-danger">{{$errors->first('amount')}}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
38
app/views/transactions/delete.blade.php
Normal file
38
app/views/transactions/delete.blade.php
Normal file
@@ -0,0 +1,38 @@
|
||||
@extends('layouts.default')
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<h1>Firefly
|
||||
<small>Delete transaction</small>
|
||||
</h1>
|
||||
<p class="lead">Remember that deleting something is permanent.</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{Form::open(['class' => 'form-horizontal','url' => route('transactions.destroy',$journal->id)])}}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<p class="text-info">
|
||||
This form allows you to delete the transaction labelled "{{{$journal->description}}}".
|
||||
</p>
|
||||
<p class="text-danger">
|
||||
Are you sure?
|
||||
</p>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-8">
|
||||
<input type="submit" name="submit" value="Delete transaction" class="btn btn-danger" />
|
||||
<a href="{{route('transactions.index')}}" class="btn-default btn">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{{Form::close()}}
|
||||
|
||||
@stop
|
||||
@@ -1,6 +1,8 @@
|
||||
@extends('layouts.default')
|
||||
@section('content')
|
||||
Bla bla TODO
|
||||
|
||||
@include('paginated.transactions')
|
||||
|
||||
|
||||
@stop
|
||||
|
||||
|
||||
Reference in New Issue
Block a user