related tags: add AI tags to related tags section.
Add a Suggested tags list to the Related Tags box. The suggested tags are just the AI tags for the post. Suggested tags are currently hidden in CSS for beta testing. Use custom CSS to unhide them.
This commit is contained in:
@@ -49,5 +49,5 @@
|
||||
<%= f.submit "Submit" %>
|
||||
</div>
|
||||
|
||||
<%= render "related_tags/container" %>
|
||||
<%= render "related_tags/container", media_asset: post.media_asset %>
|
||||
<% end %>
|
||||
|
||||
18
app/views/related_tags/_ai_tags_column.html.erb
Normal file
18
app/views/related_tags/_ai_tags_column.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<div class="tag-column ai-tags-related-tags-column hidden">
|
||||
<h3 class="flex items-center space-x-1">
|
||||
<input type="checkbox" class="invisible">
|
||||
<span>Suggested</span>
|
||||
</h3>
|
||||
|
||||
<ul class="tag-list simple-tag-list">
|
||||
<% ai_tags.each do |t| %>
|
||||
<li class="flex items-center space-x-1">
|
||||
<input type="checkbox" tabindex="-1">
|
||||
<span>
|
||||
<%= link_to t.pretty_name, posts_path(tags: t.name), class: "search-tag tag-type-#{t.category}", "data-tag-name": t.name %>
|
||||
<%= tag.span "#{t.score}%", class: "text-muted text-xs" %>
|
||||
</span>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -1,4 +1,4 @@
|
||||
<div id="related-tags-container" class="visible">
|
||||
<div id="related-tags-container" class="visible" data-media-asset-id="<%= media_asset.id %>">
|
||||
<h3>
|
||||
Related Tags
|
||||
<a href="#" id="show-related-tags-link">»</a>
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
<% if related_tags.present? %>
|
||||
<%= render "related_tags/tag_column", tags: related_tags.recent_tags, class: "recent-related-tags-column", title: "Recent" %>
|
||||
<%= render "related_tags/tag_column", tags: related_tags.favorite_tags, class: "frequent-related-tags-column", title: "Frequent" %>
|
||||
<%= render "related_tags/ai_tags_column", ai_tags: related_tags.ai_tags %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -92,6 +92,6 @@
|
||||
<%= f.input :is_pending, as: :boolean, label: "Upload for approval", wrapper_html: { class: "inline-block" }, input_html: { checked: post.is_pending? } %>
|
||||
<% end %>
|
||||
|
||||
<%= render "related_tags/container" %>
|
||||
<%= render "related_tags/container", media_asset: media_asset %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user