diff --git a/app/actions/tags/index.rb b/app/actions/tags/index.rb new file mode 100644 index 0000000..f321d11 --- /dev/null +++ b/app/actions/tags/index.rb @@ -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 diff --git a/app/views/tags/index.rb b/app/views/tags/index.rb new file mode 100644 index 0000000..d5fa39e --- /dev/null +++ b/app/views/tags/index.rb @@ -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