mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-16 18:25:00 -06:00
More bread crumbs.
This commit is contained in:
parent
0df6c3a8dc
commit
6bb54bfa85
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
use DaveJamesMiller\Breadcrumbs\Generator;
|
||||
use FireflyIII\Exception\FireflyException;
|
||||
|
||||
/*
|
||||
* Back home.
|
||||
@ -12,6 +13,7 @@ Breadcrumbs::register(
|
||||
}
|
||||
);
|
||||
|
||||
// accounts
|
||||
Breadcrumbs::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));
|
||||
}
|
||||
);
|
@ -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">
|
||||
|
@ -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">
|
||||
|
@ -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">
|
||||
|
@ -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">
|
||||
|
Loading…
Reference in New Issue
Block a user