From 5afac29693a25ec7b7fe5cf34859b2aa0eed43a5 Mon Sep 17 00:00:00 2001 From: evazion Date: Sun, 17 Nov 2019 22:14:17 -0600 Subject: [PATCH] views: convert /tags to table builder. --- app/views/tags/index.html.erb | 40 ++++++++++++----------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/app/views/tags/index.html.erb b/app/views/tags/index.html.erb index 26012f28c..8afbb16a8 100644 --- a/app/views/tags/index.html.erb +++ b/app/views/tags/index.html.erb @@ -1,32 +1,20 @@
<%= render "search" %> - - - - - - - - - - <% @tags.each do |tag| %> - - - - - - <% end %> - -
CountName
<%= tag.post_count %> - <%= link_to_wiki "?", tag.name %> - <%= link_to(tag.name, posts_path(:tags => tag.name)) %> - - <%= link_to_if tag.editable_by?(CurrentUser.user), "edit", edit_tag_path(tag) %> | - <%= link_to "history", post_versions_path(search: { changed_tags: tag.name }) %> | - <%= link_to "related", related_tag_path(search: { query: tag.name }) %> | - <%= link_to "similar", tags_path(search: { fuzzy_name_matches: tag.name, order: :similarity }) %> -
+ + <%= table_for @tags, class: "striped autofit" do |t| %> + <% t.column :post_count, name: "Count" %> + <% t.column :name, class: "col-expand" do |tag| %> + <%= link_to_wiki "?", tag.name, class: "tag-type-#{tag.category}" %> + <%= link_to tag.name, posts_path(tags: tag.name), class: "tag-type-#{tag.category}" %> + <% end %> + <% t.column do |tag| %> + <%= link_to_if tag.editable_by?(CurrentUser.user), "Edit", edit_tag_path(tag) %> | + <%= link_to "History", post_versions_path(search: { changed_tags: tag.name }) %> | + <%= link_to "Related", related_tag_path(search: { query: tag.name }) %> | + <%= link_to "Similar", tags_path(search: { fuzzy_name_matches: tag.name, order: :similarity }) %> + <% end %> + <% end %> <%= numbered_paginator(@tags) %>