<% if @topic_view.topic.posts_count < 2 %> <%= link_to(I18n.t('embed.start_discussion'), @topic_view.topic.url, class: 'button', target: '_blank') %> <% elsif @topic_view.topic.posts_count > 10 %> <%= link_to(I18n.t('embed.continue'), @second_post_url, class: 'button', target: '_blank') %> <% end %> <%= I18n.t('embed.replies', count: @topic_view.topic.posts_count - 1) %>
<%- if @topic_view.posts.present? %> <%- @topic_view.posts.each do |post| %>
<%= link_to embed_post_date(post.created_at), post.url, title: post.created_at.strftime("%B %e, %Y %l:%M%P"), class: 'post-date', target: "_blank" %> <%- if post.reply_to_post.present? && !post.cooked.index('aside') %> <%= link_to I18n.t('embed.in_reply_to', username: post.reply_to_post.username), post.reply_to_post.url, 'data-link-to-post' => post.reply_to_post.id.to_s, :class => 'in-reply-to' %> <%- end %>

<%= post.user.username %> <%- if post.user.title.present? %> <%= post.user.title %> <%- end %>

<%= raw post.cooked %> <%- if post.reply_count > 0 %> <%- if post.reply_count == 1 %> <%= link_to I18n.t('embed.replies', count: post.reply_count), post.url, 'data-link-to-post' => post.replies.first.id.to_s, :class => 'post-replies' %> <% else %> <%= link_to I18n.t('embed.replies', count: post.reply_count), post.url, class: 'post-replies', target: "_blank" %> <%- end %> <%- end %>
<%- end %> <% if @topic_view.topic.posts_count > 0 %> <% end %> <% end %>