%= tag.article id: "post_#{post.id}", **article_attrs do -%>
<%= link_to polymorphic_path(link_target, q: tags), class: "post-preview-link", draggable: "false" do -%>
<% if is_animated? || has_sound? %>
<% if is_animated? %>
<%= duration_to_hhmmss(duration) %>
<% end %>
<% if has_sound? %>
<%= sound_icon(class: "h-3 mx-0.5") -%>
<% end %>
<% end %>
<% if media_asset.is_flash? %>
<%= tag.img src: "/images/flash-preview.png", class: "post-preview-image", title: tooltip, alt: "post ##{post.id}", draggable: "false" -%>
<% else %>
<% unless save_data %>
<% case size %>
<% when "150", "180" %>
<%= tag.source type: "image/jpeg", srcset: "#{media_asset.variant("180x180").file_url} 1x, #{media_asset.variant("360x360").file_url} 2x" %>
<% when "225", "225w", "270", "270w", "360" %>
<%= tag.source type: "image/webp", srcset: "#{media_asset.variant("360x360").file_url} 1x, #{media_asset.variant("720x720").file_url} 2x" %>
<% end %>
<% end %>
<%= tag.img src: variant.file_url, width: variant.width, height: variant.height, class: "post-preview-image", title: tooltip, alt: "post ##{post.id}", draggable: "false" -%>
<% end %>
<% end -%>
<% if pool -%>
<%= link_to pool.pretty_name.truncate(80), pool %>
<% elsif similarity -%>
<% if post.source =~ %r!\Ahttps?://!i %>
<%= external_link_to post.normalized_source, post.source_domain %>
(<%= time_ago_in_words_tagged(post.created_at, compact: true) %>)
<% else %>
<%= time_ago_in_words_tagged(post.created_at, compact: true) %>
<% end %>
<%= link_to "#{number_to_human_size(file_size)} .#{file_ext}", post.file_url %>
(<%= post.image_width %>x<%= post.image_height %>)
<%= link_to "#{similarity}%", iqdb_queries_path(post_id: post.id) %> similarity
<% elsif show_size -%>
<%= link_to "#{number_to_human_size(file_size)} .#{file_ext}", post.file_url %>
(<%= post.image_width %>x<%= post.image_height %>)
<% elsif recommended -%>
<%= link_to recommended_posts_path(search: { post_id: post.id }), class: "more-recommended-posts", "data-post-id": post.id do %>
<%= post.fav_count %>
<%= empty_heart_icon(class: "fa-xs") %>
more ยป
<% end %>
<% elsif show_votes -%>
<%= render_post_votes post, current_user: current_user %>
<% end -%>
<% end -%>