diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php index 3f0410e7ab..cf9c8cef88 100644 --- a/app/Support/Twig/General.php +++ b/app/Support/Twig/General.php @@ -71,6 +71,12 @@ class General extends Twig_Extension } ); + $functions[] = new Twig_SimpleFunction( + 'getCurrencySymbol', function () { + return App::make('amount')->getCurrencySymbol(); + } + ); + $functions[] = new Twig_SimpleFunction( 'phpdate', function ($str) { return date($str); diff --git a/resources/twig/budgets/index.twig b/resources/twig/budgets/index.twig new file mode 100644 index 0000000000..383e71f74d --- /dev/null +++ b/resources/twig/budgets/index.twig @@ -0,0 +1,192 @@ +{% extends "./layout/default.twig" %} +{% block content %} + {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName) }} +
+ {% if budget.currentRep %} + + {% else %} + + {% endif %} +
+ ++ + + {% if budget.currentRep %} + + Budgeted: + + + {% if budget.currentRep.amount > budget.spent %} + {{ getCurrencySymbol() }} + {% else %} + {{ getCurrencySymbol() }} + {% endif %} + + {% else %} + No budget + + + {% endif %} + + +
+ ++ Spent: {{ budget.spent|formatAmount }} +
+