Add Markdown editor to admin area
This commit is contained in:
21
slices/admin/views/posts/new.rb
Normal file
21
slices/admin/views/posts/new.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
module Admin
|
||||
module Views
|
||||
module Posts
|
||||
class New < Admin::View
|
||||
include Deps["repos.post_repo"]
|
||||
|
||||
expose :published_posts do |posts|
|
||||
posts[0]
|
||||
end
|
||||
|
||||
expose :unpublished_posts do |posts|
|
||||
posts[1]
|
||||
end
|
||||
|
||||
expose :posts do
|
||||
post_repo.list.partition { |p| p.published_at }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user