Add admin area
This commit is contained in:
7
slices/admin/views/index.rb
Normal file
7
slices/admin/views/index.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
module Admin
|
||||
module Views
|
||||
class Index < Admin::View
|
||||
|
||||
end
|
||||
end
|
||||
end
|
22
slices/admin/views/tags/index.rb
Normal file
22
slices/admin/views/tags/index.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
module Admin
|
||||
module Views
|
||||
module Tags
|
||||
class Index < Admin::View
|
||||
|
||||
include Deps["repos.tag_repo"]
|
||||
|
||||
expose :tags do
|
||||
tag_repo.list.to_a
|
||||
end
|
||||
|
||||
expose :unused_tags do |tags|
|
||||
tags.partition {|t| t.posts.count == 0}.first
|
||||
end
|
||||
|
||||
expose :used_tags do |tags|
|
||||
tags.partition {|t| t.posts.count == 0}.last
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user