mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Improved tag view [skip ci]
This commit is contained in:
@@ -178,9 +178,24 @@ class TagController extends Controller
|
||||
$title = 'Tags';
|
||||
$mainTitleIcon = 'fa-tags';
|
||||
$helpHidden = $helpHiddenPref->data;
|
||||
$tags = Auth::user()->tags()->get();
|
||||
|
||||
return view('tags.index', compact('title', 'mainTitleIcon', 'helpHidden', 'tags'));
|
||||
// group years.
|
||||
$types = ['nothing','balancingAct', 'advancePayment'];
|
||||
|
||||
// loop each types and get the tags, group them by year.
|
||||
$collection = [];
|
||||
foreach ($types as $type) {
|
||||
$tags = Auth::user()->tags()->where('tagMode', $type)->orderBy('date','ASC')->get();
|
||||
/** @var Tag $tag */
|
||||
foreach ($tags as $tag) {
|
||||
$year = is_null($tag->date) ? trans('firefly.no_year') : $tag->date->year;
|
||||
$month = is_null($tag->date) ? trans('firefly.no_month') : $tag->date->formatLocalized($this->monthFormat);
|
||||
$collection[$type][$year][$month][] = $tag;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return view('tags.index', compact('title', 'mainTitleIcon','types', 'helpHidden', 'collection'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -193,7 +208,7 @@ class TagController extends Controller
|
||||
$subTitle = $tag->tag;
|
||||
$subTitleIcon = 'fa-tag';
|
||||
|
||||
return view('tags.show', compact('tag', 'subTitle', 'subTitleIcon'));
|
||||
return view('tags.show', compact('tag', 'subTitle','types', 'subTitleIcon'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user