20 lines
686 B
Plaintext
20 lines
686 B
Plaintext
<div id="posts">
|
|
<% @posts.each do |p| %>
|
|
<div class="post">
|
|
<div class="post-title">
|
|
<h2><%= link_to truncate(p.title, length: 60, omission: " …"), p %></h2>
|
|
<span class="comment-counter">
|
|
<%= link_to pluralize(p.comments.count, "Comment"), p %>
|
|
</span>
|
|
</div>
|
|
<div class="post-info">
|
|
by <%= link_to p.author.name, p.author %> on <%= p.created_at.strftime("%e. %b %Y") %>
|
|
</div>
|
|
<div class="post-content">
|
|
<%= Sanitize.clean(GitHub::Markdown.render_gfm(p.content), Sanitize::Config::RELAXED).html_safe %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<%= button_to 'Make new Post', new_blogpost_path, method: "get" if mod? %>
|
|
</div>
|