Created
June 15, 2012 13:49
-
-
Save almaron/2936562 to your computer and use it in GitHub Desktop.
View template for the Forums#show action
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#show.html.erb | |
<table class="forum_list" cellpadding="0" cellspacing="0"> | |
<tr class="forum_th"> | |
<th colspan="2"><%= t "forum.lines.topics" %></th> | |
<th class="forum_posts"><%= t "forum.lines.posts" %></th> | |
<th class="forum_last_post"><%= t "forum.lines.last_post" %></th> | |
<% if user_in?([:admins, :masters]) || user_permitted?(:moderate) %> | |
<th class="forum_admin"></th> | |
<th class="forum_admin"></th> | |
<% end %> | |
<th class="slide"> | |
<span class="topic_slideToggle t_arr" >⇓</span> | |
<span class="topic_slideToggle t_arr" style="display:none">⇑</span> | |
</th> | |
</tr> | |
<% debugger %> | |
<% if @topics.any? %> | |
<% @topics.each do |topic| %> | |
<tr class="forum_list_line topic_line"> | |
<td class="forum_ico"> | |
<% if current_user && current_user.topic_reads.find_by_topic_id(topic.id) && current_user.topic_reads.find_by_topic_id(topic.id).updated_at > topic.posts.last.created_at %> | |
ico.old | |
<% else %> | |
ico.new | |
<% end %> | |
</td> | |
<td><%= link_to topic.head, forum_topic_path(@forum, topic)%></td> | |
<td class="forum_topics"><%= topic.posts.size %></td> | |
<td class="forum_last_post"> | |
<% unless topic.posts.empty? %> | |
<%= topic.posts.last.char.name %> :: | |
<%= link_to topic.posts.last.created_at.strftime("%d.%m.%Y %H:%M"), forum_topic_last_post_path(@forum, topic) %> | |
<% end %> | |
</td> | |
<% if user_in? :admins %> | |
<td class="forum_admin"> | |
<%= link_to "→".html_safe, edit_forum_topic_path(@forum,topic), :remote => true %> | |
</td> | |
<td class="forum_admin"> | |
<%= link_to "×".html_safe, forum_topic_path(@forum,topic), :method => :delete %> | |
</td> | |
<% end %> | |
<td></td> | |
</tr> | |
<% end %> | |
<% else %> | |
<tr class="forum_noforums topic_line"> | |
<td colspan="<%= user_in?([:admins, :masters]) || user_permitted?(:moderate) ? 7 : 5 %>"> | |
<span> | |
<%= t "forum.lines.notopics" %> | |
</span> | |
</td> | |
</tr> | |
<% end %> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment