47 lines
1.8 KiB
Plaintext
47 lines
1.8 KiB
Plaintext
<%= link_to @thread.forum.group, forumgroup_path(@thread.forum.group) %> → <%= link_to @thread.forum, @thread.forum %> → <%=truncate(@thread.title, length: 60, omission: " …") %>
|
|
<h1><%= render partial: "labels/label", locals: {label: @thread.label} %><%= title @thread.title %></h1>
|
|
|
|
<div class="item-group thread with-avatar" id="thread-<%= @thread.id %>">
|
|
<div class="header">
|
|
<%= link_to(@thread.author.avatar(64), @thread.author, title: @thread.author.ign) %>
|
|
<%= render partial: "users/username", locals: { user: @thread.author } %>
|
|
<%= link_to p do %>
|
|
<%= ago @thread.created_at %>
|
|
<% end %>
|
|
<%= link_to "edit", edit_forumthread_path( @thread), class: "editlink" if mod? || @thread.author.is?(current_user) %>
|
|
<div class="clear-right"></div>
|
|
</div>
|
|
<div class="items">
|
|
<% if @thread.edited? %>
|
|
<div class="item edited">
|
|
Last edited <%= ago @thread.updated_at %> by <%= link_to @thread.editor.name, @thread.editor %>.
|
|
</div>
|
|
<% end %>
|
|
<div class="item content">
|
|
<%= render_md(@thread.content).html_safe %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="replies">
|
|
<h3><%= "#{pluralize(@thread.replies.size, 'reply')}." %></h3>
|
|
<% @replies.each do |reply| %>
|
|
<%= render partial: "threadreplies/reply", locals: {reply: reply} %>
|
|
<% end %>
|
|
|
|
<%= paginate @replies %>
|
|
|
|
|
|
<% if @thread.locked? %>
|
|
<div class="lockednote">This thread is locked.</div>
|
|
<% end %>
|
|
|
|
<% if current_user %>
|
|
<% if @thread.can_write?(current_user) %>
|
|
<%= render partial: "threadreplies/new", locals: {reply: Threadreply.new(forumthread: @thread)} %>
|
|
<% 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> |