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/show.html.erb
2015-04-02 10:30:15 +02:00

39 lines
1.3 KiB
Plaintext

<% title "#{@post.title}" %>
<%= link_to "News", blogposts_path %> → <%= @post.title %>
<h1><%= truncate(@post.title, length: 60, omission: " …") %></h1>
<div class="item-group post with-avatar" id="post-<%= @post.id %>">
<div class="header">
<%= link_to(@post.author.avatar(64), @post.author, title: @post.author.ign) %>
<%= render partial: "users/username", locals: { user: @post.author } %>
<%= link_to p do %>
<%= ago @post.created_at %>
<% end %>
<%= link_to "edit", edit_blogpost_path(@post.id), class: "editlink" if mod? %>
<div class="clear-right"></div>
</div>
<div class="items">
<div class="item content">
<%= render_md(@post.content).html_safe %>
</div>
</div>
</div>
<div id="comments">
<h3><%= "#{pluralize(@post.comments.size, 'comment')}." %></h3>
<% @comments.each do |c| %>
<%= render "comments/comment", c: c %>
<% end %>
<%= paginate @comments %>
<% if current_user %>
<% if @post.can_comment? current_user %>
<%= render "comments/new" %>
<% else %>
<p>You don't have the required permission to reply here.</p>
<% end %>
<% else %>
<p>Please <%= link_to "Log in", login_path(return_path: request.env['PATH_INFO']), action: "new" %> to post a reply.</p>
<% end %>
</div>