blob: e838de4088932e0d576cb7bf3eabefeab844a4e9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
<% title "News" %>
<% if current_user %>
<%= link_to "Private Messages (#{Message.where(user_target: current_user).count})", messages_path, class: "btn right blue" %>
<% end %>
<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>
|