1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Added view count tracking with personalised lists

This commit is contained in:
Dan Brown
2015-11-21 17:22:14 +00:00
parent 76eb8fc5d7
commit ea55b7f141
18 changed files with 311 additions and 30 deletions

View File

@ -11,6 +11,7 @@ use BookStack\Http\Requests;
use BookStack\Repos\BookRepo;
use BookStack\Repos\ChapterRepo;
use BookStack\Repos\PageRepo;
use Views;
class BookController extends Controller
{
@ -41,7 +42,8 @@ class BookController extends Controller
public function index()
{
$books = $this->bookRepo->getAllPaginated(10);
return view('books/index', ['books' => $books]);
$recents = $this->bookRepo->getRecentlyViewed(10, 0);
return view('books/index', ['books' => $books, 'recents' => $recents]);
}
/**
@ -86,6 +88,7 @@ class BookController extends Controller
public function show($slug)
{
$book = $this->bookRepo->getBySlug($slug);
Views::add($book);
return view('books/show', ['book' => $book, 'current' => $book]);
}