Bookshelf
This commit is contained in:
@@ -4,8 +4,24 @@ module Adamantium
|
||||
class Index < Adamantium::View
|
||||
include Deps["repos.post_repo"]
|
||||
|
||||
expose :books do
|
||||
post_repo.books_listing.map do |book|
|
||||
private_expose :books do
|
||||
post_repo.books_listing.group_by { |book| book.book_status }
|
||||
end
|
||||
|
||||
expose :read do |books|
|
||||
books["read"].map do |book|
|
||||
Decorators::Books::Decorator.new book
|
||||
end
|
||||
end
|
||||
|
||||
expose :to_read do |books|
|
||||
books["to-read"].map do |book|
|
||||
Decorators::Books::Decorator.new book
|
||||
end
|
||||
end
|
||||
|
||||
expose :reading do |books|
|
||||
books["reading"].map do |book|
|
||||
Decorators::Books::Decorator.new book
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user