Add tags index

This commit is contained in:
2023-04-25 20:49:30 +10:00
parent dcaf50569a
commit 5b24bc99c5
2 changed files with 32 additions and 0 deletions

13
app/actions/tags/index.rb Normal file
View 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
View 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