discourse/app/views/embed/comments.html.erb

45 lines
1.8 KiB
Plaintext
Raw Normal View History

<header>
<%- if @topic_view.posts.present? %>
2014-01-03 11:52:24 -06:00
<%= link_to(I18n.t('embed.continue'), @second_post_url, class: 'button', target: '_blank') %>
<span class='replies'><%= I18n.t('embed.replies', count: @topic_view.topic.posts_count) %></span>
<%- else %>
<%= link_to(I18n.t('embed.start_discussion'), @topic_view.topic.url, class: 'button', target: '_blank') %>
<%- end if %>
2014-01-02 15:40:54 -06:00
<%= link_to(image_tag(SiteSetting.logo_url, class: 'logo'), Discourse.base_url, target: '_blank') %>
</header>
<%- if @topic_view.posts.present? %>
<%- @topic_view.posts.each do |post| %>
<article class='post<%- if post.trashed? %> deleted<% end %>'>
<%= link_to post.created_at.strftime("%e %b %Y"), post.url, class: 'post-date', target: "_blank" %>
2014-01-03 11:52:24 -06:00
<%- if post.reply_to_post.present? %>
<%= link_to I18n.t('embed.in_reply_to', username: post.reply_to_post.username), post.reply_to_post.url, class: 'in-reply-to', target: "_blank" %>
<%- end %>
<div class='author'>
<img src='<%= post.user.small_avatar_url %>'>
2014-01-03 11:52:24 -06:00
<h3 class='username'><%= post.user.username %></h3>
</div>
2014-01-03 11:52:24 -06:00
<div class='cooked'>
<%= raw post.cooked %>
<%- if post.reply_count > 0 %>
<%= link_to I18n.t('embed.replies', count: post.reply_count), post.url, class: 'post-replies', target: "_blank" %>
<%- end %>
</div>
<div style='clear: both'></div>
</article>
<%- end %>
<footer>
<%= link_to(I18n.t('embed.continue'), @topic_view.topic.last_post_url, class: 'button', target: '_blank') %>
2014-01-03 11:52:24 -06:00
<span class='replies'><%= I18n.t('embed.replies', count: @topic_view.topic.posts_count) %></span>
<%= link_to(image_tag(SiteSetting.logo_url, class: 'logo'), Discourse.base_url, target: '_blank') %>
</footer>
<% end %>