27 lines
1.1 KiB
Plaintext
27 lines
1.1 KiB
Plaintext
<h1><%= @post.title %></h1>
|
|
<span class="post-info"><%= link_to @post.user.name, @post.user %> on <%= @post.created_at.strftime("%e. %b %Y") %>
|
|
<% if current_user.rank >= Tools.rank_to_int(:mod) %>
|
|
- <%= link_to "edit", edit_blogpost_path(@post.id) %>
|
|
<% end %>
|
|
</span>
|
|
<div id="post-content">
|
|
<%= RbbCode.new.convert(@post.text).html_safe %>
|
|
</div>
|
|
<div id="comments">
|
|
<% @post.comments.each do |c| %>
|
|
<div class="comment">
|
|
<span class="comment-info"><%= link_to c.user.name, c.user %> on <%= c.created_at.strftime("%e. %b %Y") %>
|
|
<% if current_user.rank >= Tools.rank_to_int(:mod) %>
|
|
- <%= link_to "edit", edit_blogpost_comment_path(c.id) %>
|
|
<% end %>
|
|
</span>
|
|
<div class="comment-content"><%= c.text %></div>
|
|
</div>
|
|
<% end %>
|
|
<% if current_user && current_user.rank >= Tools.rank_to_int(:visitor) %>
|
|
<h3>New comment</h3>
|
|
<%= simple_form_for [@post, @comment] do |f| %>
|
|
<%= f.input :text, :label => false, :as => "text", :placeholder => "Comment" %><%= f.submit %>
|
|
<% end %>
|
|
<% end %>
|
|
</div> |