Fixed topcis#show
This commit is contained in:
@@ -12,31 +12,33 @@
|
||||
<div>
|
||||
<table>
|
||||
<% @topic.posts.each do |post| %>
|
||||
<tr>
|
||||
<td class="post_author" rowspan="2">
|
||||
<span class="name"><%= post.user.username %></span>
|
||||
<span class="avatar"><%= image_tag post.user.gravatar_url %></span>
|
||||
<span class="info smaller">
|
||||
<p><strong><%= "Administrator" if post.user.admin? %></strong></p>
|
||||
Posts <%= post.user.posts.size %><br />
|
||||
Registered <%=l post.user.created_at %><br />
|
||||
</span>
|
||||
</td>
|
||||
<td class="post_header">
|
||||
<span class="left post_date smaller">Posted <%=l post.created_at %></span>
|
||||
<span class="right controls">
|
||||
<%= link_to "Reply", new_topic_post_path(@topic) if can? :create, @topic.posts.new %>
|
||||
<%= link_to "Quote", new_topic_post_path(@topic, :quote => post) if can? :create, @topic.posts.new %>
|
||||
<%= link_to "Edit", edit_post_path(post) if can? :update, post %>
|
||||
<%= link_to "Delete", post, :confirm => "Are you sure?", :method => :delete if can? :destroy, post %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="post_body">
|
||||
<%= post.body.bbcode_to_html().html_safe %>
|
||||
</td>
|
||||
</tr>
|
||||
<% if !post.user.blank? %>
|
||||
<tr>
|
||||
<td class="post_author" rowspan="2">
|
||||
<span class="name"><%= post.user.username %></span>
|
||||
<span class="avatar"><%= image_tag post.user.gravatar_url %></span>
|
||||
<span class="info smaller">
|
||||
<p><strong><%= "Administrator" if post.user.admin? %></strong></p>
|
||||
Posts <%= post.user.posts_count %><br />
|
||||
Registered <%=l post.user.created_at %><br />
|
||||
</span>
|
||||
</td>
|
||||
<td class="post_header">
|
||||
<span class="left post_date smaller">Posted <%=l post.created_at %></span>
|
||||
<span class="right controls">
|
||||
<%= link_to "Reply", new_topic_post_path(@topic) if can? :create, @topic.posts.new %>
|
||||
<%= link_to "Quote", new_topic_post_path(@topic, :quote => post) if can? :create, @topic.posts.new %>
|
||||
<%= link_to "Edit", edit_post_path(post) if can? :update, post %>
|
||||
<%= link_to "Delete", post, :confirm => "Are you sure?", :method => :delete if can? :destroy, post %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="post_body">
|
||||
<%= post.body.bbcode_to_html().html_safe %>
|
||||
</td>
|
||||
</tr>
|
||||
<%end%>
|
||||
<% end %>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user