mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-11-02 20:30:37 -06:00
More bread crumbs.
This commit is contained in:
1 parent
0df6c3a8dc
commit
6bb54bfa85
5 files changed
+69
-3
No files matched your search
+65
-2
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
use DaveJamesMiller\Breadcrumbs\Generator;
|
use DaveJamesMiller\Breadcrumbs\Generator;
|
||||||
|
use FireflyIII\Exception\FireflyException;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Back home.
|
* Back home.
|
||||||
@@ -12,6 +13,7 @@ Breadcrumbs::register(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// accounts
|
||||||
Breadcrumbs::register(
|
Breadcrumbs::register(
|
||||||
'accounts.index', function (Generator $breadcrumbs, $what) {
|
'accounts.index', function (Generator $breadcrumbs, $what) {
|
||||||
$breadcrumbs->parent('home');
|
$breadcrumbs->parent('home');
|
||||||
@@ -19,8 +21,69 @@ Breadcrumbs::register(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
Breadcrumbs::register(
|
Breadcrumbs::register(
|
||||||
'accounts.show', function (Generator $breadcrumbs, $what, \Account $account) {
|
'accounts.show', function (Generator $breadcrumbs, \Account $account) {
|
||||||
$breadcrumbs->parent('accounts.index',$what);
|
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->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')
|
@extends('layouts.default')
|
||||||
@section('content')
|
@section('content')
|
||||||
|
{{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $what) }}
|
||||||
{{Form::open(['class' => 'form-horizontal','route' => 'accounts.store'])}}
|
{{Form::open(['class' => 'form-horizontal','route' => 'accounts.store'])}}
|
||||||
{{Form::hidden('what',$what)}}
|
{{Form::hidden('what',$what)}}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@extends('layouts.default')
|
@extends('layouts.default')
|
||||||
@section('content')
|
@section('content')
|
||||||
|
{{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $account) }}
|
||||||
{{Form::open(['class' => 'form-horizontal','url' => route('accounts.destroy',$account->id)])}}
|
{{Form::open(['class' => 'form-horizontal','url' => route('accounts.destroy',$account->id)])}}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-6 col-md-12 col-sm-12">
|
<div class="col-lg-6 col-md-12 col-sm-12">
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@extends('layouts.default')
|
@extends('layouts.default')
|
||||||
@section('content')
|
@section('content')
|
||||||
|
{{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $account) }}
|
||||||
{{Form::model($account, ['class' => 'form-horizontal','url' => route('accounts.update',$account->id)])}}
|
{{Form::model($account, ['class' => 'form-horizontal','url' => route('accounts.update',$account->id)])}}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
@extends('layouts.default')
|
@extends('layouts.default')
|
||||||
@section('content')
|
@section('content')
|
||||||
{{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $what, $account) }}
|
{{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $account) }}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-8 col-md-6 col-sm-12">
|
<div class="col-lg-8 col-md-6 col-sm-12">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
|
|||||||
Reference in new issue
Block a user