79 lines
3.4 KiB
Plaintext
Executable File
79 lines
3.4 KiB
Plaintext
Executable File
<div class="right controls">
|
|
<ul class="breadcrumb">
|
|
<li>< <%= link_to @topic.forum.category.title, :root %> <span class="divider">/</span></li>
|
|
<li><%= link_to @topic.forum.title, forum_path(@topic.forum) %> <span class="divider">/</span></li>
|
|
<li class="active"><%= @topic.title %></li>
|
|
</ul>
|
|
</div>
|
|
<div class="module">
|
|
<div class="module_header">
|
|
<% if @topic.sticky %>
|
|
<span class="label label-info">Sticky</span>
|
|
<% end %>
|
|
<% if @topic.locked %>
|
|
<span class="label label-important">Locked</span>
|
|
<% end %>
|
|
<%= @topic.title %>
|
|
<span class="right controls">
|
|
<%= link_to "Edit", edit_topic_path(@topic) if can? :manage, @topic %>
|
|
<%= link_to "Delete", @topic, :confirm => "Are you sure?", :method => :delete if can? :manage, @topic %>
|
|
<%= link_to @topic.sticky ? "Unstick" : "Sticky", {:controller => 'topics', :action => 'update', :topic => {:sticky => @topic.sticky ? "false" : "true" }}, :method => :put if can? :moderate, @topic %>
|
|
<%= link_to @topic.locked ? "Unlock" : "Lock", {:controller => 'topics', :action => 'update', :topic => {:locked => @topic.locked ? "false" : "true" }}, :method => :put if can? :moderate, @topic %>
|
|
</span>
|
|
</div>
|
|
<div>
|
|
<% i = 0 %>
|
|
<% i += (params[:page].to_i - 1 ) * 10 if params[:page] %>
|
|
<table>
|
|
<% @posts.each do |post| %>
|
|
<% i += 1 %>
|
|
<% 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>
|
|
<% if post.user.admin? %>
|
|
<span class="label label-inverse">Administrator</span>
|
|
<% end %>
|
|
<% if post.user.moderator? %>
|
|
<span class="label label-warning">Moderator</span>
|
|
<% end %>
|
|
<% if post.user.banned? %>
|
|
<span class="label label-important">Banned</span>
|
|
<% end %>
|
|
</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">
|
|
<a name="<%= post.id %>"> <%= link_to ("#"+ i.to_s ), post %> </a>
|
|
Posted <%=l post.created_at %></span>
|
|
<span class="right controls">
|
|
<% if !@topic.locked %>
|
|
<%= 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 %>
|
|
<% end %>
|
|
<%= 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(@my_blockquote).html_safe %>
|
|
</td>
|
|
</tr>
|
|
<%end%>
|
|
<% end %>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div style="text-align: center">
|
|
<%= paginate(@posts)%>
|
|
</div>
|
|
<div class="right controls"><p><%= link_to "Back to Forum", forum_path(@topic.forum) %></p></div>
|