firefly-iii/resources/views/piggy-banks/index.blade.php

136 lines
6.0 KiB
PHP
Raw Normal View History

2015-02-24 14:10:25 -06:00
@extends('layouts.default')
@section('content')
{!! Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName()) !!}
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<p>
<a href="{{route('piggy-banks.create')}}" class="btn btn-success">Create new piggy bank</a>
</p>
</div>
</div>
2015-03-15 12:00:33 -05:00
<div class="row" id="sortable">
2015-03-03 02:15:28 -06:00
@foreach($piggyBanks as $piggyBank)
2015-03-15 12:00:33 -05:00
<div class="col-lg-3 col-md-4 col-sm-12 col-xs-12" data-id="{{$piggyBank->id}}">
2015-02-24 14:10:25 -06:00
<div class="panel panel-default">
<div class="panel-heading">
2015-03-15 12:00:33 -05:00
<i class="loadSpin"></i>
2015-03-15 12:02:40 -05:00
<i class="fa fa-fw fa-bars handle"></i> <a href="{{route('piggy-banks.show',$piggyBank->id)}}" title="{{{$piggyBank->order}}}">{{{$piggyBank->name}}}</a>
2015-02-24 14:10:25 -06:00
<!-- ACTIONS MENU -->
<div class="pull-right">
<div class="btn-group">
<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
Actions
<span class="caret"></span>
</button>
<ul class="dropdown-menu pull-right" role="menu">
<li><a href="{{route('piggy-banks.edit',$piggyBank->id)}}"><i class="fa fa-pencil fa-fw"></i> Edit</a></li>
<li><a href="{{route('piggy-banks.delete',$piggyBank->id)}}"><i class="fa fa-trash fa-fw"></i> Delete</a></li>
</ul>
</div>
</div>
</div>
<div class="panel-body">
<div class="row">
2015-03-03 02:15:28 -06:00
<!-- One block (remove money) -->
<div class="col-lg-2 col-md-2 col-sm-4 col-xs-4">
2015-03-03 02:35:06 -06:00
@if($piggyBank->savedSoFar > 0)
<a href="{{route('piggy-banks.removeMoney',$piggyBank->id)}}" class="btn btn-default btn-xs removeMoney" data-id="{{{$piggyBank->id}}}"><span data-id="{{{$piggyBank->id}}}" class="glyphicon glyphicon-minus"></span></a>
@endif
2015-02-24 14:10:25 -06:00
</div>
2015-03-03 02:15:28 -06:00
<!-- Some blocks (bar) -->
<div class="col-lg-8 col-md-8 col-sm-4 col-xs-4">
2015-02-24 14:10:25 -06:00
<div class="progress progress-striped">
<div
@if($piggyBank->percentage == 100)
2015-03-03 02:15:28 -06:00
class="progress-bar progress-bar-success"
@else
class="progress-bar progress-bar-info"
@endif
role="progressbar" aria-valuenow="{{$piggyBank->percentage}}" aria-valuemin="0" aria-valuemax="100" style="min-width: 40px;width: {{$piggyBank->percentage}}%;">
2015-02-24 14:10:25 -06:00
{{$piggyBank->percentage}}%
</div>
</div>
</div>
2015-03-03 02:15:28 -06:00
<!-- One block (add money) -->
<div class="col-lg-2 col-md-2 col-sm-4 col-xs-4">
@if($piggyBank->leftToSave > 0)
<a href="{{route('piggy-banks.addMoney',$piggyBank->id)}}" class="btn btn-default btn-xs addMoney" data-id="{{{$piggyBank->id}}}"><span data-id="{{{$piggyBank->id}}}" class="glyphicon glyphicon-plus"></span></a>
@endif
</div>
</div>
<div class="row">
2015-03-15 08:23:26 -05:00
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
2015-03-03 02:15:28 -06:00
<span title="Saved so far">{!! Amount::format($piggyBank->savedSoFar,true) !!}</span>
</div>
2015-03-15 08:24:25 -05:00
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4" style="text-align: center;">
2015-03-03 02:15:28 -06:00
<span title="Target amount">{!! Amount::format($piggyBank->targetamount,true) !!}</span>
</div>
2015-03-15 08:24:25 -05:00
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4" style="text-align: right;">
2015-03-03 02:15:28 -06:00
@if($piggyBank->leftToSave > 0)
<span title="Left to save">{!! Amount::format($piggyBank->leftToSave) !!}</span>
@endif
2015-02-24 14:10:25 -06:00
</div>
</div>
</div>
</div>
</div>
@endforeach
2015-03-03 02:15:28 -06:00
</div>
2015-02-24 14:10:25 -06:00
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<p>
<a href="{{route('piggy-banks.create')}}" class="btn btn-success">Create new piggy bank</a>
</p>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-fw fa-money"></i> Account status
</div>
<table class="table table-striped">
<tr>
<th>Account</th>
<th>Balance</th>
<th>Left for piggy banks</th>
<th>Sum of piggy banks</th>
<th>Saved so far</th>
<th>Left to save</th>
</tr>
@foreach($accounts as $id => $info)
<tr>
<td><a href="{{route('accounts.show',$id)}}">{{{$info['name']}}}</a></td>
<td>{!! Amount::format($info['balance']) !!}</td>
<td>{!! Amount::format($info['leftForPiggyBanks']) !!}</td>
<td>{!! Amount::format($info['sumOfTargets']) !!}</td>
<td>{!! Amount::format($info['sumOfSaved']) !!}</td>
<td>{!! Amount::format($info['leftToSave']) !!}</td>
</tr>
@endforeach
</table>
</div>
</div>
</div>
<!-- this is the modal for the add/remove money routine: -->
<div class="modal fade" id="moneyManagementModal">
2015-02-24 14:10:25 -06:00
</div><!-- /.modal -->
@stop
@section('scripts')
2015-04-28 01:12:12 -05:00
<script src="js/jquery-ui.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/piggy-banks.js"></script>
2015-02-24 14:10:25 -06:00
@stop