Also implement #595 for the no-cat view.

This commit is contained in:
James Cole
2017-03-10 19:34:46 +01:00
parent 0c52d54d7d
commit ecbd7ca95b
7 changed files with 315 additions and 28 deletions

View File

@@ -354,12 +354,27 @@ Breadcrumbs::register(
);
Breadcrumbs::register(
'categories.no-category', function (BreadCrumbGenerator $breadcrumbs, $subTitle) {
'categories.no-category', function (BreadCrumbGenerator $breadcrumbs, string $moment, Carbon $start, Carbon $end) {
$breadcrumbs->parent('categories.index');
$breadcrumbs->push($subTitle, route('categories.no-category'));
$breadcrumbs->push(trans('firefly.journals_without_category'), route('categories.no-category'));
// push when is all:
if ($moment === 'all') {
$breadcrumbs->push(trans('firefly.all_journals_without_category'), route('categories.no-category', ['all']));
}
// when is specific period:
if (strlen($moment) > 0 && $moment !== 'all') {
$title = trans('firefly.without_category_between', ['start' => $start->formatLocalized(strval(trans('config.month_and_day'))),
'end' => $end->formatLocalized(strval(trans('config.month_and_day')))]
);
$breadcrumbs->push($title, route('categories.no-category', [$moment]));
}
}
);
/**
* CURRENCIES
*/