Skip to content

Firefly III: a personal finances manager

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

James Cole5cd2ef4a5e3b
diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php
index 5b2088beab..ff7851dd66 100644
--- a/app/Support/Twig/General.php
+++ b/app/Support/Twig/General.php
@@ -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) {
diff --git a/resources/twig/emails/password.twig b/resources/twig/emails/password.twig
new file mode 100644
index 0000000000..2aba25c1fc
--- /dev/null
+++ b/resources/twig/emails/password.twig
@@ -0,0 +1 @@
+Click here to reset your password: {{ url('password/reset/' . token) }}
diff --git a/resources/twig/emails/registered.twig b/resources/twig/emails/registered.twig
new file mode 100644
index 0000000000..4550f79f9d
--- /dev/null
+++ b/resources/twig/emails/registered.twig
@@ -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!
diff --git a/resources/twig/errors/503.twig b/resources/twig/errors/503.twig
new file mode 100644
index 0000000000..0847a1c967
--- /dev/null
+++ b/resources/twig/errors/503.twig
@@ -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>
diff --git a/resources/twig/list/piggy-banks.twig b/resources/twig/list/piggy-banks.twig
new file mode 100644
index 0000000000..ef6cf6be63
--- /dev/null
+++ b/resources/twig/list/piggy-banks.twig
@@ -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>
\ No newline at end of file
diff --git a/resources/twig/piggy-banks/index.twig b/resources/twig/piggy-banks/index.twig
new file mode 100644
index 0000000000..62c3e1254f
--- /dev/null
+++ b/resources/twig/piggy-banks/index.twig
@@ -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 %}
\ No newline at end of file