Added a subtitle to the category view.

This commit is contained in:
James Cole
2015-09-25 16:25:17 +02:00
parent 0a8f4017bd
commit 72b5895217

View File

@@ -154,6 +154,7 @@ class CategoryController extends Controller
$range = Preferences::get('viewRange', '1M')->data; $range = Preferences::get('viewRange', '1M')->data;
$start = Navigation::startOfPeriod($carbon, $range); $start = Navigation::startOfPeriod($carbon, $range);
$end = Navigation::endOfPeriod($carbon, $range); $end = Navigation::endOfPeriod($carbon, $range);
$subTitle = $category->name;
$hideCategory = true; // used in list. $hideCategory = true; // used in list.
$page = intval(Input::get('page')); $page = intval(Input::get('page'));
@@ -163,7 +164,7 @@ class CategoryController extends Controller
$journals = new LengthAwarePaginator($set, $count, 50, $page); $journals = new LengthAwarePaginator($set, $count, 50, $page);
$journals->setPath('categories/show/' . $category->id . '/' . $date); $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); $count = $repository->countJournals($category);
$totalSum = $repository->journalsSum($category); $totalSum = $repository->journalsSum($category);
$periodSum = $repository->journalsSum($category, Session::get('start'), Session::get('end')); $periodSum = $repository->journalsSum($category, Session::get('start'), Session::get('end'));
$subTitle = $category->name;
$journals = new LengthAwarePaginator($set, $count, 50, $page); $journals = new LengthAwarePaginator($set, $count, 50, $page);
$journals->setPath('categories/show/' . $category->id); $journals->setPath('categories/show/' . $category->id);
@@ -219,7 +221,7 @@ class CategoryController extends Controller
$cache->store($entries); $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'));
} }
/** /**