Add tags index
This commit is contained in:
13
app/actions/tags/index.rb
Normal file
13
app/actions/tags/index.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
module Adamantium
|
||||
module Actions
|
||||
module Tags
|
||||
class Index < Action
|
||||
include Deps["views.tags.index"]
|
||||
|
||||
def handle(req, res)
|
||||
res.render index
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
19
app/views/tags/index.rb
Normal file
19
app/views/tags/index.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
module Adamantium
|
||||
module Views
|
||||
module Tags
|
||||
class Index < View
|
||||
include Deps["repos.tag_repo"]
|
||||
|
||||
expose :tag_groups do
|
||||
tag_repo
|
||||
.list
|
||||
.group_by { |tag|
|
||||
grouper = tag.label.strip[0].downcase
|
||||
/[a-z]/.match?(grouper) ? grouper : "#"
|
||||
}
|
||||
.sort
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user