From b0828588667c6330fe6f98a8d6347e03daee5f37 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 9 Oct 2016 10:58:54 +0200 Subject: [PATCH] Removed unused blocks from the front page. Savings and piggy banks. --- app/Http/Controllers/HomeController.php | 10 +-- resources/views/index.twig | 111 ------------------------ 2 files changed, 1 insertion(+), 120 deletions(-) diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index bb13eb2fea..bc1586f7cc 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -142,14 +142,6 @@ class HomeController extends Controller $end = session('end', Carbon::now()->endOfMonth()); $showTour = Preferences::get('tour', true)->data; $accounts = $crud->getAccountsById($frontPage->data); - $savings = $repository->getSavingsAccounts($start, $end); - $piggyBankAccounts = $repository->getPiggyBankAccounts($start, $end); - - - $savingsTotal = '0'; - foreach ($savings as $savingAccount) { - $savingsTotal = bcadd($savingsTotal, Steam::balance($savingAccount, $end)); - } foreach ($accounts as $account) { $set = $repository->journalsInPeriod(new Collection([$account]), [], $start, $end); @@ -161,7 +153,7 @@ class HomeController extends Controller } return view( - 'index', compact('count', 'showTour', 'title', 'savings', 'subTitle', 'mainTitleIcon', 'transactions', 'savingsTotal', 'piggyBankAccounts') + 'index', compact('count', 'showTour', 'title','subTitle', 'mainTitleIcon', 'transactions') ); } diff --git a/resources/views/index.twig b/resources/views/index.twig index 64a8e1d873..e7356da910 100644 --- a/resources/views/index.twig +++ b/resources/views/index.twig @@ -103,117 +103,6 @@ -
-
- -
-
-

{{ 'savings'|_ }}

- -
-
- {% if savings|length == 0 %} -

{{ 'markAsSavingsToContinue'|_ }}

- {% else %} - {% for account in savings %} - -
- -
{{ account.startBalance|formatAmount }}
- -
- {% if account.difference < 0 %} - -
-
- {% if account.percentage >= 20 %} - {{ account.difference|formatAmountPlain }} - {% endif %} -
-
- {% if account.percentage < 20 %} - {{ account.difference|formatAmountPlain }} - {% endif %} -
-
- {% else %} - -
-
- {% if account.percentage >= 20 %} - {{ account.difference|formatAmountPlain }} - {% endif %} -
-
- {% if account.percentage < 20 %} - {{ account.difference|formatAmountPlain }} - {% endif %} -
-
- {% endif %} - -
- -
{{ account.endBalance|formatAmount }}
-
- {% endfor %} - {% endif %} -
- -
-
-
- -
-
-

{{ 'piggyBanks'|_ }}

- -
-
- {% if piggyBankAccounts|length == 0 %} -

{{ 'createPiggyToContinue'|_ }}

- {% else %} - {% for account in piggyBankAccounts %} - -
- -
{{ account.startBalance|formatAmount }}
- -
- -
-
- {% if account.percentage >= 20 %} - {{ account.piggyBalance|formatAmountPlain }} {{ 'divided'|_ }} - {% endif %} -
-
- {% if account.percentage < 20 %} - {{ account.difference|formatAmountPlain }} {{ 'toDivide'|_ }} - {% endif %} -
-
-
- -
{{ account.piggyBalance|formatAmount }}
-
- {% endfor %} - {% endif %} -
-
-
-
- {% endblock %} {% block scripts %}