This repository has been archived on 2024-08-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
redstoner.com/app/views/blogposts/index.html.erb
2014-11-15 21:02:30 +01:00

29 lines
950 B
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 %>
<%= ago p.created_at %>
<% 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 %>
<%= paginate @posts %>
</div>