ai tags: default to showing only posts, not media assets.

Change the /ai_tags page to show only posts by default, not both posts
and unposted media assets mixed together. Showing media assets tended to
confuse users about why they couldn't add tags to these images. It also
distracted from the page's primary use case, which is gardening posts.
This commit is contained in:
evazion
2022-06-26 15:39:46 -05:00
parent 8f2774075a
commit efe0e8a6bd
2 changed files with 1 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ class AITagsController < ApplicationController
limit = params[:limit].presence || CurrentUser.user.per_page
@mode = params.fetch(:mode, "gallery")
@preview_size = params[:size].presence || cookies[:post_preview_size].presence || MediaAssetGalleryComponent::DEFAULT_SIZE
params[:search][:is_posted] ||= "true" if request.format.html?
@ai_tags = authorize AITag.visible(CurrentUser.user).paginated_search(params, limit: limit, count_pages: false)
@ai_tags = @ai_tags.includes(:media_asset, :tag, :post) if request.format.html?

View File

@@ -14,7 +14,6 @@
<% end %>
<div class="border-b mb-4 flex flex-wrap gap-4">
<%= link_to "All", current_page_path(search: search_params.to_h.without("is_posted")), class: ["inline-block p-1 pb-2", (search_params[:is_posted].nil? ? "border-current border-b-2 -mb-px" : "inactive-link")] %>
<%= link_to "Posted", current_page_path(search: search_params.merge(is_posted: true)), class: ["inline-block p-1 pb-2", (search_params[:is_posted].to_s.truthy? ? "border-current border-b-2 -mb-px" : "inactive-link")] %>
<%= link_to "Unposted", current_page_path(search: search_params.merge(is_posted: false)), class: ["inline-block p-1 pb-2", (search_params[:is_posted].to_s.falsy? ? "border-current border-b-2 -mb-px" : "inactive-link")] %>
<span class="flex-grow-1"></span>