From 600e75e324c8005f8fe940801743647e7619bfff Mon Sep 17 00:00:00 2001 From: evazion Date: Sun, 11 Sep 2022 23:41:52 -0500 Subject: [PATCH] /tags: update tag actions menu. Replace the "Edit | History | Related | Similar" links on the /tags index with a popup menu containing more actions, including links to the tag's version history, links to the tag's aliases and implications, links to comments and forum discussions mentioning the tag, and links to find untagged and mistagged posts using AI tags. --- app/views/tags/index.html.erb | 66 ++++++++++++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 5 deletions(-) diff --git a/app/views/tags/index.html.erb b/app/views/tags/index.html.erb index 4a99de931..df34990c5 100644 --- a/app/views/tags/index.html.erb +++ b/app/views/tags/index.html.erb @@ -16,13 +16,69 @@ <%= tag.span humanized_number(t.post_count), class: "post-count", title: t.post_count %> <% end %> + <% t.column column: "control" do |tag| %> - <% if policy(tag).update? %> - <%= link_to "Edit", edit_tag_path(tag) %> | + <%= render PopupMenuComponent.new do |menu| %> + <% if policy(tag).update? %> + <% menu.item do %> + <%= link_to "Edit", edit_tag_path(tag) %> + <% end %> + <% end %> + + <% menu.item do %> + <%= link_to "Tag history", tag_versions_path(search: { tag_id: tag.id }) %> + <% end %> + + <% menu.item do %> + <%= link_to "Post history", post_versions_path(search: { changed_tags: tag.name }) %> + <% end %> + + <% menu.item do %> +
+ <% end %> + + <% menu.item do %> + <%= link_to "Related tags", related_tag_path(search: { query: tag.name }) %> + <% end %> + + <% menu.item do %> + <%= link_to "Similar tags", tags_path(search: { fuzzy_name_matches: tag.name, order: :similarity }) %> + <% end %> + + <% menu.item do %> +
+ <% end %> + + <% menu.item do %> + <%= link_to "Aliases", tag_aliases_path(search: { name_matches: tag.name }) %> + <% end %> + + <% menu.item do %> + <%= link_to "Implications", tag_implications_path(search: { name_matches: tag.name }) %> + <% end %> + + <% menu.item do %> + <%= link_to "Comments", comments_path(search: { post_tags_match: tag.name }) %> + <% end %> + + <% menu.item do %> + <%= link_to "Discussions", forum_posts_path(search: { linked_to: tag.name }) %> + <% end %> + + <% if !tag.meta? %> + <% menu.item do %> +
+ <% end %> + + <% menu.item do %> + <%= link_to "Untagged posts", ai_tags_path(search: { tag_name: tag.name, post_tags_match: "-#{tag.name}", is_posted: true, order: "score_desc" }) %> + <% end %> + + <% menu.item do %> + <%= link_to "Mistagged posts", posts_path(tags: "#{tag.name} ai:#{tag.name},0%") %> + <% end %> + <% end %> <% end %> - <%= 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 %>