Files
danbooru/app/views/posts/partials/show/_parent_notice.html.erb
evazion 40711e1d4f posts/show: refactor parent/child notices.
* Convert notices from helpers to partials.
* Eliminate PostSets::PostRelationship class in favor of post_sets/posts template.
* Eliminate COUNT(*) queries when calculating the number of child posts.
* Eliminate redundant parent load and parent exists queries.
2020-01-12 18:38:38 -06:00

15 lines
622 B
Plaintext

This post belongs to a <%= link_to "parent", posts_path(tags: "parent:#{parent.id}") %> <% "(deleted)" if parent.is_deleted? %>
<% children.length.tap do |children_count| %>
<% if children_count > 1 %>
and has <%= link_to pluralize(children_count - 1, "sibling"), posts_path(tags: "parent:#{parent.id}") %>
<% end %>
<% end %>
(<%= link_to_wiki "learn more", "help:post_relationships" %>)
<%= link_to "« hide", "#", id: "has-parent-relationship-preview-link" %>
<div id="has-parent-relationship-preview">
<%= post_previews_html([parent, *children], tags: "parent:#{parent.id}", show_deleted: true) %>
</div>