Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
More bread crumbs.
James Cole6bb54bfa85cb
diff --git a/app/breadcrumbs.php b/app/breadcrumbs.phpindex 9eaf34cd8b..0e7b720ae2 100644--- a/app/breadcrumbs.php+++ b/app/breadcrumbs.php@@ -1,5 +1,6 @@<?phpuse DaveJamesMiller\Breadcrumbs\Generator;+use FireflyIII\Exception\FireflyException;/** Back home.@@ -12,6 +13,7 @@ Breadcrumbs::register(});+// accountsBreadcrumbs::register('accounts.index', function (Generator $breadcrumbs, $what) {$breadcrumbs->parent('home');@@ -19,8 +21,69 @@ Breadcrumbs::register(});Breadcrumbs::register(- 'accounts.show', function (Generator $breadcrumbs, $what, \Account $account) {- $breadcrumbs->parent('accounts.index',$what);+ 'accounts.show', function (Generator $breadcrumbs, \Account $account) {+ switch ($account->accountType->type) {+ default:+ throw new FireflyException('Cannot handle account type "' . e($account->accountType->type) . '"');+ break;+ case 'Default account':+ case 'Asset account':+ $what = 'asset';+ break;+ case 'Expense account':+ case 'Beneficiary account':+ $what = 'expense';+ break;+ case 'Revenue account':+ $what = 'revenue';+ break;+ }+ $breadcrumbs->parent('accounts.index', $what);$breadcrumbs->push($account->name, route('accounts.show', $account->id));}+);+Breadcrumbs::register(+ 'accounts.delete', function (Generator $breadcrumbs, \Account $account) {+ switch ($account->accountType->type) {+ default:+ throw new FireflyException('Cannot handle account type "' . e($account->accountType->type) . '"');+ break;+ case 'Default account':+ case 'Asset account':+ $what = 'asset';+ break;+ case 'Expense account':+ case 'Beneficiary account':+ $what = 'expense';+ break;+ case 'Revenue account':+ $what = 'revenue';+ break;+ }+ $breadcrumbs->parent('accounts.show', $account);+ $breadcrumbs->push('Delete ' . $account->name, route('accounts.delete', $account->id));+ }+);++Breadcrumbs::register(+ 'accounts.edit', function (Generator $breadcrumbs, \Account $account) {+ switch ($account->accountType->type) {+ default:+ throw new FireflyException('Cannot handle account type "' . e($account->accountType->type) . '"');+ break;+ case 'Default account':+ case 'Asset account':+ $what = 'asset';+ break;+ case 'Expense account':+ case 'Beneficiary account':+ $what = 'expense';+ break;+ case 'Revenue account':+ $what = 'revenue';+ break;+ }+ $breadcrumbs->parent('accounts.show', $account);+ $breadcrumbs->push('Edit ' . $account->name, route('accounts.edit', $account->id));+ });\ No newline at end of filediff --git a/app/views/accounts/create.blade.php b/app/views/accounts/create.blade.phpindex edf174bce6..74fe8fc5db 100644--- a/app/views/accounts/create.blade.php+++ b/app/views/accounts/create.blade.php@@ -1,5 +1,6 @@@extends('layouts.default')@section('content')+{{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $what) }}{{Form::open(['class' => 'form-horizontal','route' => 'accounts.store'])}}{{Form::hidden('what',$what)}}<div class="row">diff --git a/app/views/accounts/delete.blade.php b/app/views/accounts/delete.blade.phpindex 6f2059a15e..5140108559 100644--- a/app/views/accounts/delete.blade.php+++ b/app/views/accounts/delete.blade.php@@ -1,5 +1,6 @@@extends('layouts.default')@section('content')+{{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $account) }}{{Form::open(['class' => 'form-horizontal','url' => route('accounts.destroy',$account->id)])}}<div class="row"><div class="col-lg-6 col-md-12 col-sm-12">diff --git a/app/views/accounts/edit.blade.php b/app/views/accounts/edit.blade.phpindex 47e3ee60c2..c978deeb62 100644--- a/app/views/accounts/edit.blade.php+++ b/app/views/accounts/edit.blade.php@@ -1,5 +1,6 @@@extends('layouts.default')@section('content')+{{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $account) }}{{Form::model($account, ['class' => 'form-horizontal','url' => route('accounts.update',$account->id)])}}<div class="row"><div class="col-lg-6 col-md-6 col-sm-12">diff --git a/app/views/accounts/show.blade.php b/app/views/accounts/show.blade.phpindex adc219990d..9445421f28 100644--- a/app/views/accounts/show.blade.php+++ b/app/views/accounts/show.blade.php@@ -1,6 +1,6 @@@extends('layouts.default')@section('content')-{{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $what, $account) }}+{{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $account) }}<div class="row"><div class="col-lg-8 col-md-6 col-sm-12"><div class="panel panel-default">