Skip to content

Firefly III: a personal finances manager

Added a subtitle to the category view.

James Cole72b5895217ef
diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php
index 10725adce6..29c82ef1f6 100644
--- a/app/Http/Controllers/CategoryController.php
+++ b/app/Http/Controllers/CategoryController.php
@@ -150,20 +150,21 @@ class CategoryController extends Controller
*/
public function showWithDate(CategoryRepositoryInterface $repository, Category $category, $date)
{
- $carbon = new Carbon($date);
- $range = Preferences::get('viewRange', '1M')->data;
- $start = Navigation::startOfPeriod($carbon, $range);
- $end = Navigation::endOfPeriod($carbon, $range);
+ $carbon = new Carbon($date);
+ $range = Preferences::get('viewRange', '1M')->data;
+ $start = Navigation::startOfPeriod($carbon, $range);
+ $end = Navigation::endOfPeriod($carbon, $range);
+ $subTitle = $category->name;
$hideCategory = true; // used in list.
$page = intval(Input::get('page'));
- $set = $repository->getJournalsInRange($category, $page, $start, $end);
- $count = $repository->countJournalsInRange($category, $start, $end);
- $journals = new LengthAwarePaginator($set, $count, 50, $page);
+ $set = $repository->getJournalsInRange($category, $page, $start, $end);
+ $count = $repository->countJournalsInRange($category, $start, $end);
+ $journals = new LengthAwarePaginator($set, $count, 50, $page);
$journals->setPath('categories/show/' . $category->id . '/' . $date);
- return view('categories.show_with_date', compact('category', 'journals', 'hideCategory'));
+ return view('categories.show_with_date', compact('category', 'journals', 'hideCategory', 'subTitle'));
}
/**
@@ -180,6 +181,7 @@ class CategoryController extends Controller
$count = $repository->countJournals($category);
$totalSum = $repository->journalsSum($category);
$periodSum = $repository->journalsSum($category, Session::get('start'), Session::get('end'));
+ $subTitle = $category->name;
$journals = new LengthAwarePaginator($set, $count, 50, $page);
$journals->setPath('categories/show/' . $category->id);
@@ -219,7 +221,7 @@ class CategoryController extends Controller
$cache->store($entries);
}
- return view('categories.show', compact('category', 'journals', 'entries', 'hideCategory', 'totalSum', 'periodSum'));
+ return view('categories.show', compact('category', 'journals', 'entries', 'hideCategory', 'totalSum', 'periodSum', 'subTitle'));
}
/**