Add “more” page
This commit is contained in:
8
app/views/more/index.rb
Normal file
8
app/views/more/index.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
module Adamantium
|
||||
module Views
|
||||
module More
|
||||
class Index < View
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
21
app/views/posts/archive.rb
Normal file
21
app/views/posts/archive.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
module Adamantium
|
||||
module Views
|
||||
module Posts
|
||||
class Archive < View
|
||||
include Deps["repos.post_repo"]
|
||||
|
||||
expose :year do |year:|
|
||||
year
|
||||
end
|
||||
|
||||
expose :posts do |year:|
|
||||
post_repo.by_year(year: year).map { |post| Decorators::Posts::Decorator.new(post) }
|
||||
end
|
||||
|
||||
expose :post_years do
|
||||
post_repo.post_years.map { |py| py[:year].to_i }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@@ -9,6 +9,10 @@ module Adamantium
|
||||
Decorators::Posts::Decorator.new(post)
|
||||
end
|
||||
end
|
||||
|
||||
expose :post_years do
|
||||
post_repo.post_years.map { |py| py[:year].to_i }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user