25 lines
1.0 KiB
Plaintext
25 lines
1.0 KiB
Plaintext
<% title "News" %>
|
|
|
|
<h1>News</h1>
|
|
<%= link_to 'Make new Post', new_blogpost_path, class: "btn blue" if mod? %>
|
|
<div id="posts">
|
|
<% @posts.each do |p| %>
|
|
<div class="item-group with-avatar" id="post-<%= p.id %>">
|
|
<div class="header">
|
|
<%= link_to(p.author.avatar(64), p.author, title: p.author.ign) %>
|
|
<%= render partial: "users/username", locals: { user: p.author } %> <%= link_to p do %><time title="<%= p.created_at.strftime("%e %b %Y, %H:%M") %>" datetime="<%= p.created_at.to_datetime.rfc3339 %>"><%= p.created_at.strftime("%e %b %Y, %H:%M") %></time><% end %>
|
|
<span class="comment-counter">
|
|
<%= link_to pluralize(p.comments.count, "Comment"), p %>
|
|
</span>
|
|
<div class="clear-right"></div>
|
|
</div>
|
|
<div class="items">
|
|
<div class="item content post">
|
|
<h2 class="headline"><%= link_to truncate(p.title, length: 60, omission: " …"), p %></h2>
|
|
<%= render_md(p.content).html_safe %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|