2015-08-12 15:41:15 -04:00
<header class='discourse'>
2014-01-23 12:58:52 -05:00
<% if @topic_view.topic.posts_count < 2 %>
2014-01-13 10:59:28 -05:00
<%= link_to(I18n.t('embed.start_discussion'), @topic_view.topic.url, class: 'button', target: '_blank') %>
2014-01-14 16:06:04 -05:00
<% elsif @topic_view.topic.posts_count > 10 %>
2014-01-03 12:52:24 -05:00
<%= link_to(I18n.t('embed.continue'), @second_post_url, class: 'button', target: '_blank') %>
2014-01-13 10:59:28 -05:00
<% end %>
2015-11-20 13:05:45 -05:00
<span class='replies'><%= I18n.t('embed.replies', count: @reply_count) %></span>
2013-12-31 14:37:43 -05:00
</header>
<%- if @topic_view.posts.present? %>
<%- @topic_view.posts.each do |post| %>
2014-01-03 14:45:22 -05:00
<article class='post<%- if post.trashed? %> deleted<% end %>' id='post-<%= post.id.to_s %>'>
2016-01-12 12:38:49 -05:00
<%= link_to embed_post_date(post.created_at), post.full_url, title: post.created_at.strftime("%B %e, %Y %l:%M%P"), class: 'post-date', target: "_blank" %>
2014-03-20 14:02:21 -04:00
<%- if post.reply_to_post.present? && !post.cooked.index('aside') %>
2016-01-12 12:38:49 -05:00
<%= link_to I18n.t('embed.in_reply_to', username: post.reply_to_post.username), post.reply_to_post.full_url, 'data-link-to-post' => post.reply_to_post.id.to_s, :class => 'in-reply-to' %>
2014-01-03 12:52:24 -05:00
<%- end %>
2013-12-31 14:37:43 -05:00
<div class='author'>
2017-03-28 14:27:54 -04:00
<a href='<%= Discourse.base_url %>/u/<%= post.username %>' target="_blank"><img src='<%= post.user.small_avatar_url %>' alt=''></a>
2014-05-09 15:14:00 -04:00
</div>
<div class='cooked'>
2014-03-20 16:04:50 -04:00
<h3 class='username'>
2017-03-28 14:27:54 -04:00
<a href='<%= Discourse.base_url %>/u/<%= 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 15:14:00 -04:00
<%- if post.user.title.present? %>
<span class='title'><%= post.user.title %></span>
<%- end %>
2014-03-20 16:04:50 -04:00
</h3>
2018-05-09 13:24:44 -04:00
<%= get_html(post) %>
2014-01-03 12:52:24 -05:00
2018-03-20 15:13:41 -04:00
<%- if post.reply_count > 0 && post.replies.exists? %>
2014-01-03 14:45:22 -05:00
<%- if post.reply_count == 1 %>
2016-01-12 12:38:49 -05:00
<%= link_to I18n.t('embed.replies', count: post.reply_count), post.full_url, 'data-link-to-post' => post.replies.first.id.to_s, :class => 'post-replies button' %>
2014-01-03 14:45:22 -05:00
<% else %>
2016-01-12 12:38:49 -05:00
<%= link_to I18n.t('embed.replies', count: post.reply_count), post.full_url, class: 'post-replies button', target: "_blank" %>
2014-01-03 14:45:22 -05:00
<%- end %>
2014-01-03 12:52:24 -05:00
<%- end %>
</div>
2013-12-31 14:37:43 -05:00
</article>
<%- end %>
2014-01-13 10:59:28 -05:00
<% if @topic_view.topic.posts_count > 0 %>
2015-09-18 16:12:41 -04:00
<footer class="clearfix">
<%= link_to(image_tag(SiteSetting.logo_url, class: 'logo'), Discourse.base_url, target: '_blank') %>
2016-01-12 12:38:49 -05:00
<%= link_to(I18n.t('embed.continue'), @topic_view.posts.last.full_url, class: 'button', target: '_blank') %>
2014-01-07 15:48:26 -05:00
<%- if @posts_left > 0 %>
<span class='replies'><%= I18n.t('embed.more_replies', count: @posts_left) %></span>
<%- end %>
</footer>
2015-09-18 16:12:41 -04:00
<div class="clearfix"></div>
2014-01-07 15:48:26 -05:00
<% end %>
2013-12-31 14:37:43 -05:00
<% end %>