mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 19:01:58 +00:00
Enable inactive budgets.
This commit is contained in:
@@ -73,7 +73,4 @@ Some stuff has been removed:
|
|||||||
## Current state
|
## Current state
|
||||||
I have the basics up and running. Test coverage is currently coming, slowly.
|
I have the basics up and running. Test coverage is currently coming, slowly.
|
||||||
|
|
||||||
Although I have not checked extensively, some forms and views have CSRF vulnerabilities. This is because not all
|
|
||||||
views escape all characters by default. Will be fixed.
|
|
||||||
|
|
||||||
Questions, ideas or other things to contribute? [Let me know](https://github.com/JC5/firefly-iii/issues/new)!
|
Questions, ideas or other things to contribute? [Let me know](https://github.com/JC5/firefly-iii/issues/new)!
|
||||||
|
@@ -98,7 +98,8 @@ class BudgetController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index(BudgetRepositoryInterface $repository)
|
public function index(BudgetRepositoryInterface $repository)
|
||||||
{
|
{
|
||||||
$budgets = Auth::user()->budgets()->get();
|
$budgets = Auth::user()->budgets()->where('active',1)->get();
|
||||||
|
$inactive = Auth::user()->budgets()->where('active',0)->get();
|
||||||
|
|
||||||
// loop the budgets:
|
// loop the budgets:
|
||||||
$budgets->each(
|
$budgets->each(
|
||||||
@@ -117,7 +118,7 @@ class BudgetController extends Controller
|
|||||||
$budgetMax = Preferences::get('budgetMaximum', 1000);
|
$budgetMax = Preferences::get('budgetMaximum', 1000);
|
||||||
$budgetMaximum = $budgetMax->data;
|
$budgetMaximum = $budgetMax->data;
|
||||||
|
|
||||||
return view('budgets.index', compact('budgetMaximum', 'budgets', 'spent', 'spentPCT', 'overspent', 'amount'));
|
return view('budgets.index', compact('budgetMaximum','inactive', 'budgets', 'spent', 'spentPCT', 'overspent', 'amount'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -64,6 +64,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -142,6 +143,25 @@
|
|||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<a href="{{route('budgets.create')}}" class="btn btn-success"><i class="fa fa-fw fa-plus"></i> Create new budget</a>
|
<a href="{{route('budgets.create')}}" class="btn btn-success"><i class="fa fa-fw fa-plus"></i> Create new budget</a>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-lg-3 col-sm-4 col-md-6">
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<i class="fa fa-fw fa-minus-circle"></i>
|
||||||
|
Inactive budgets
|
||||||
|
</div>
|
||||||
|
<div class="panel-body">
|
||||||
|
@foreach($inactive as $index => $budget)
|
||||||
|
@if($index != count($inactive)-1)
|
||||||
|
<a href="{{route('budgets.show',$budget->id)}}">{{$budget->name}}</a>,
|
||||||
|
@else
|
||||||
|
<a href="{{route('budgets.show',$budget->id)}}">{{$budget->name}}</a>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user