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/forums/show.html.erb
2014-06-16 00:05:09 +02:00

35 lines
1.7 KiB
Plaintext

<% title @forum.name %>
<%= link_to @forum.group, forumgroup_path(@forum.group) %> → <%= link_to @forum %>
<h1><%= @forum %></h1>
<% if @forum.can_write?(current_user) %>
<p><%= link_to "New thread", new_forumthread_path(forum: @forum), class: "btn blue" %></p>
<% end %>
<div id="forum_groups">
<% @threads.each do |thread| %>
<div class="item-group 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 thread do %><time title="<%= thread.created_at.strftime("%e %b %Y, %H:%M") %>" datetime="<%= thread.created_at.to_datetime.rfc3339 %>"><%= thread.created_at.strftime("%e %b %Y, %H:%M") %></time><% end %>
<span class="comment-counter">
<%= link_to pluralize(thread.replies.count, "Reply"), thread %>
</span>
<div class="clear-right"></div>
</div>
<div class="items bold">
<div class="item <%= "#{"locked" if thread.locked}#{"sticky" if thread.sticky}" %>">
<%= link_to thread.title, forumthread_path(thread) %>
<div class="item-info">
<% if rpl = thread.replies.last %>
<%= rpl.author.name %> <%= link_to "replied", forumthread_path(thread) + "#reply-#{rpl.id}" %> <time title="<%= rpl.created_at.strftime("%e %b %Y, %H:%M") %>" datetime="<%= rpl.created_at.to_datetime.rfc3339 %>"><%= rpl.created_at.strftime("%e %b %Y, %H:%M") %></time>.
<% else %>
No replies yet.
<% end %>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<% end %>
</div>