2014-05-09 14:14:00 -05:00
<header class='embedded'>
2014-01-23 11:58:52 -06:00
<% if @topic_view.topic.posts_count < 2 %>
2014-01-13 09:59:28 -06:00
<%= link_to(I18n.t('embed.start_discussion'), @topic_view.topic.url, class: 'button', target: '_blank') %>
2014-01-14 15:06:04 -06:00
<% elsif @topic_view.topic.posts_count > 10 %>
2014-01-03 11:52:24 -06:00
<%= link_to(I18n.t('embed.continue'), @second_post_url, class: 'button', target: '_blank') %>
2014-01-13 09:59:28 -06:00
<% end %>
2014-01-13 13:15:48 -06:00
<span class='replies'><%= I18n.t('embed.replies', count: @topic_view.topic.posts_count - 1) %></span>
2013-12-31 13:37:43 -06:00
</header>
<%- if @topic_view.posts.present? %>
<%- @topic_view.posts.each do |post| %>
2014-01-03 13:45:22 -06:00
<article class='post<%- if post.trashed? %> deleted<% end %>' id='post-<%= post.id.to_s %>'>
2014-03-23 14:22:02 -05:00
<%= 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" %>
2014-03-20 13:02:21 -05:00
<%- if post.reply_to_post.present? && !post.cooked.index('aside') %>
2014-01-03 13:45:22 -06:00
<%= 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' %>
2014-01-03 11:52:24 -06:00
<%- end %>
2013-12-31 13:37:43 -06:00
<div class='author'>
2014-03-20 15:12:41 -05:00
<a href='/users/<%= post.username %>' target="_blank"><img src='<%= post.user.small_avatar_url %>'></a>
2014-05-09 14:14:00 -05:00
</div>
<div class='cooked'>
2014-03-20 15:04:50 -05:00
<h3 class='username'>
<a href='/users/<%= post.username %>' target="_blank" class='<% if post.user.staff? %>staff<% end %><% if post.user.new_user? %>new-user<% end %>'><%= post.user.username %></a>
2014-05-09 14:14:00 -05:00
<%- if post.user.title.present? %>
<span class='title'><%= post.user.title %></span>
<%- end %>
2014-03-20 15:04:50 -05:00
</h3>
2014-01-03 11:52:24 -06:00
<%= raw post.cooked %>
<%- if post.reply_count > 0 %>
2014-01-03 13:45:22 -06:00
<%- 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 %>
2014-01-03 11:52:24 -06:00
<%- end %>
</div>
2013-12-31 13:37:43 -06:00
<div style='clear: both'></div>
</article>
<%- end %>
2014-01-13 09:59:28 -06:00
<% if @topic_view.topic.posts_count > 0 %>
2014-01-07 14:48:26 -06:00
<footer>
<%= link_to(I18n.t('embed.continue'), @topic_view.posts.last.url, class: 'button', target: '_blank') %>
<%- if @posts_left > 0 %>
<span class='replies'><%= I18n.t('embed.more_replies', count: @posts_left) %></span>
<%- end %>
<%= link_to(image_tag(SiteSetting.logo_url, class: 'logo'), Discourse.base_url, target: '_blank') %>
</footer>
<% end %>
2013-12-31 13:37:43 -06:00
<% end %>