Some generic templates and the first piggy bank ones [skip ci]

This commit is contained in:
James Cole 2015-05-02 10:53:54 +02:00
parent 466c2a68c2
commit 5cd2ef4a5e
6 changed files with 170 additions and 0 deletions

View File

@ -31,6 +31,11 @@ class General extends Twig_Extension
return App::make('amount')->format($string);
}, ['is_safe' => ['html']]
);
$filters[] = new Twig_SimpleFilter(
'formatAmountPlain', function ($string) {
return App::make('amount')->format($string, false);
}
);
$filters[] = new Twig_SimpleFilter(
'formatJournal', function ($journal) {

View File

@ -0,0 +1 @@
Click here to reset your password: {{ url('password/reset/' . token) }}

View File

@ -0,0 +1,5 @@
Hey there!
Welkome to Firefly III. Your registration has made it, and this email is here to confirm it.
Thanks for using Firefly!

View File

@ -0,0 +1,41 @@
<html>
<head>
<link href='https://fonts.googleapis.com/css?family=Lato:100' rel='stylesheet' type='text/css'>
<style>
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
color: #B0BEC5;
display: table;
font-weight: 100;
font-family: 'Lato';
}
.container {
text-align: center;
display: table-cell;
vertical-align: middle;
}
.content {
text-align: center;
display: inline-block;
}
.title {
font-size: 72px;
margin-bottom: 40px;
}
</style>
</head>
<body>
<div class="container">
<div class="content">
<div class="title">Be right back.</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,56 @@
<table class="table table-striped" id="sortable">
<tbody>
{% for piggyBank in piggyBanks %}
<tr data-id="{{ piggyBank.id }}">
<td style="width:60px;">
<i class="fa fa-fw fa-bars handle"></i>
<i class="loadSpin"></i>
</td>
<td style="width:100px;">
<div class="btn-group btn-group-xs">
<a href="{{ route('piggy-banks.edit', piggyBank.id)}}" class="btn btn-default btn-xs"><i class="fa fa-pencil fa-fw"></i></a>
<a href="{{ route('piggy-banks.delete', piggyBank.id)}}" class="btn btn-default btn-xs"><i class="fa fa-trash fa-fw"></i></a>
</div>
</td>
<td>
<a href="{{ route('piggy-banks.show', piggyBank.id) }}" title="{{ piggyBank.order }}">{{ piggyBank.name }}</a>
</td>
<td>
<span title="Saved so far">{{piggyBank.savedSoFar|formatAmountPlain }}</span>
</td>
<td style="text-align:right;width:40px;">
{% 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 %}
</td>
<td>
<div class="progress progress-striped" style="margin-bottom:0;">
<div
{% if piggyBank.percentage == 100 %}
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 }}%;">
{{ piggyBank.percentage }}%
</div>
</div>
</td>
<td style="width:40px;">
{% 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 %}
</td>
<td style="width:200px;">
<span title="Target amount">{{ piggyBank.targetamount|formatAmount }}</span>
{% if piggyBank.leftToSave > 0 %}
<span title="Left to save">({{ piggyBank.leftToSave|formatAmount }})</span>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>

View File

@ -0,0 +1,62 @@
{% extends "./layout/default.twig" %}
{% block content %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName) }}
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<p>
<i class="fa fa-sort-amount-asc fa-fw"></i> <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">Piggy banks</div>
{% include 'list/piggy-banks.twig' %}
</div>
</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>
{% for id,info in accounts %}
<tr>
<td><a href="{{ route('accounts.show',id) }}">{{ info.name }}</a></td>
<td>{{ info.balance|formatAmount }}</td>
<td>{{ info.leftForPiggyBanks|formatAmount }}</td>
<td>{{ info.sumOfTargets|formatAmount }}</td>
<td>{{ info.sumOfSaved|formatAmount }}</td>
<td>{{ info.leftToSave|formatAmount }}</td>
</tr>
{% endfor %}
</table>
</div>
</div>
</div>
<!-- this is the modal for the add/remove money routine: -->
<div class="modal fade" id="moneyManagementModal">
</div><!-- /.modal -->
{% endblock %}
{% block scripts %}
<script src="js/jquery-ui.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/piggy-banks.js"></script>
{% endblock %}