From c7d3ef6a97b3e88818c8b2038d1c6bac708ac06b Mon Sep 17 00:00:00 2001 From: Sander Dorigo Date: Mon, 7 Jul 2014 19:33:17 +0200 Subject: [PATCH] Some small changes in the account display. --- app/controllers/AccountController.php | 4 ++- app/views/accounts/create.blade.php | 4 +-- app/views/accounts/index.blade.php | 46 +++++++++++++++------------ 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index 888b6e3b37..9dfc4f81ff 100644 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -26,8 +26,10 @@ class AccountController extends \BaseController 'initial' => [], 'cash' => [] ]; + $total = $all->count(); foreach ($all as $account) { + switch ($account->accounttype->description) { case 'Default account': $list['personal'][] = $account; @@ -45,7 +47,7 @@ class AccountController extends \BaseController } } - return View::make('accounts.index')->with('accounts', $list); + return View::make('accounts.index')->with('accounts', $list)->with('total',$total); } // // diff --git a/app/views/accounts/create.blade.php b/app/views/accounts/create.blade.php index 0be135e733..63b499ced8 100644 --- a/app/views/accounts/create.blade.php +++ b/app/views/accounts/create.blade.php @@ -2,7 +2,7 @@ @section('content')
-

Firefly
+

Firefly Add a new account

@@ -15,7 +15,7 @@ a positive balance).

- Your first account should be a checking or savings account. Enter its name and if relevant + If this is your first account, it should be a checking or savings account. Enter its name and if relevant the current balance. Check your bank statements for the last current balance you can find.

{{Form::open(['class' => 'form-horizontal','url' => route('accounts.store')])}} diff --git a/app/views/accounts/index.blade.php b/app/views/accounts/index.blade.php index a829ee1346..9ed88a043b 100644 --- a/app/views/accounts/index.blade.php +++ b/app/views/accounts/index.blade.php @@ -15,33 +15,37 @@
-

Your accounts

-

- These are your personal accounts. -

+ @if($total > 0) +

Your accounts

+

+ These are your personal accounts. +

- @include('accounts.list',['accounts' => $accounts['personal']]) + @include('accounts.list',['accounts' => $accounts['personal']]) -

Beneficiaries

-

- These are beneficiaries; places where you spend money or people who pay you. -

+

Beneficiaries

+

+ These are beneficiaries; places where you spend money or people who pay you. +

- @include('accounts.list',['accounts' => $accounts['beneficiaries']]) + @include('accounts.list',['accounts' => $accounts['beneficiaries']]) -

Initial balances

-

- These are system accounts; created to add balance to the books when you add a personal account - which already has money in it. That money has to come from somewhere. -

- @include('accounts.list',['accounts' => $accounts['initial']]) +

Initial balances

+

+ These are system accounts; created to add balance to the books when you add a personal account + which already has money in it. That money has to come from somewhere. +

+ @include('accounts.list',['accounts' => $accounts['initial']]) -

Cash

-

- This is a system account. When you don't specify a beneficiary or draw many from an ATM (or put cash in your - personal accounts) it gets added or drawn from this account. -

+

Cash

+

+ This is a system account. When you don't specify a beneficiary or draw many from an ATM (or put cash in your + personal accounts) it gets added or drawn from this account. +

@include('accounts.list',['accounts' => $accounts['cash']]) + @else + Create a new account + @endif