beast rev 2066
[beast-modified.git] / app / views / forums / show.html.erb
blob4e0139b3e192fe494494d8b6f5cb6f62c5278bdf
1 <% content_for :right do %>
3 <% unless @forum.description.blank? %>
4 <%= @forum.description_html %>
5 <hr />
6 <% end %>
8 <h5 style="margin-bottom:1.0em;"><%= 'Moderators'[:moderators] %></h5>
10 <% if @forum.moderators.any? -%>
11 <ul class="flat" style="margin-top:1em;">
12 <% @forum.moderators.each do |user| -%>
13   <li><%= link_to user.display_name, user_path(user) %></li>
14 <% end -%>
15 </ul>
16 <% else -%>
17 <p><%= 'This forum is currently unmoderated.'[:forum_is_unmoderated] %></p>
18 <p><%= 'Please always be courteous.'[:please_be_courteous] %></p>
19 <% end -%>
21 <% end %>
23 <% @page_title = @forum.name %>
25 <div class="crumbs">
26 <%= link_to 'Forums'[:forums_title], home_path %> <span class="arrow">&rarr;</span>
27 </div>
28 <h1 style="margin-top:0.5em">
29   <%= h @forum.name %>
30 </h1>
32 <p class="subtitle">
33   <%= feed_icon_tag @forum.name, formatted_forum_posts_path(@forum, :rss) %> 
34   <%= '{count} topic(s)'[(count=@forum.topics.size)==1 ? :topic_count : :topics_count, number_with_delimiter(count)] %>, 
35   <%= '{count} post(s)'[(count=@forum.posts.size)==1 ? :post_count : :posts_count, number_with_delimiter(count)] %>
36 </p>
38 <% if @topics.page_count > 1 -%>
39 <% if logged_in? %>
40 <p style="float:right; margin-top:0;"><%= link_to 'New topic'[], new_topic_path(@forum), :class => "utility" %></p>
41 <% end %>
42 <%= pagination @topics %>
43 <% end -%>
45 <table border="0" cellspacing="0" cellpadding="0" class="wide topics">
46 <tr>
47   <th class="la" colspan="2"><%= 'Topic'[:topic_title] %></th>
48   <th width="1%"><%= 'Posts'[:posts_title] %></th>
49   <th width="1%"><%= 'Views'[:views_title] %></th>
50   <th class="la"><%= 'Last post'[:last_post] %></th>
51 </tr>
52 <% for topic in @topics %>
53 <tr class="hentry">
54   <td style="padding:5px; width:16px;" class="c1">
55     <% 
56     icon = "comment"
57     color = ""
58     if topic.locked?
59       icon = "lock"
60       post = ", this topic is locked."[:comma_locked_topic]
61       color = "darkgrey"
62     end
63     %>
64     <% if recent_topic_activity(topic) %>
65     <%= image_tag "clearbits/#{icon}.gif", :class => "icon green", :title => "Recent activity"[]+"#{post}" %>
66     <% else %>
67       <%= image_tag "clearbits/#{icon}.gif", :class => "icon grey #{color}", :title => "No recent activity"[]+"#{post}" %>
68     <% end %>
69   </td>
70   <td class="c2">
71     <%= "Sticky"[:sticky_title]+": <strong>" if topic.sticky? %>
72     <%= topic_title_link (topic), :class => "entry-title", :rel => "bookmark" %>
73     <%#= link_to h(topic.title), topic_path(@forum, topic), :class => "entry-title", :rel => "bookmark" %>
74     <%= "</strong>" if topic.sticky? %>
75     <% if topic.paged? -%>
76     <small><%= link_to 'last'[], topic_path(:forum_id => @forum, :id => topic, :page => topic.last_page) %></small>
77     <% end -%>
78   </td>
79   <td class="ca inv stat"><%= topic.posts.size %></td>
80   <td class="ca inv stat"><%= number_with_delimiter(topic.views) %></td>
81   <td class="lp">
82     <abbr class="updated" title="<%= topic.replied_at.xmlschema %>"><%= time_ago_in_words(topic.replied_at) %></abbr>
83     <%= 'by {user}'[:by_user, "<span class=\"author\"><strong class=\"fn\">#{h(topic.replied_by_user.display_name)}</strong></span>"] %>
84     <span><%= link_to 'view'[], topic_path(:forum_id => @forum, :id => topic, :page => topic.last_page, :anchor => "posts-#{topic.last_post_id}") %></span>
85   </td>
86 </tr>
87 <% end %>
88 </table>
90 <%= next_page @topics %>
91 <%= pagination @topics %>
93 <% if logged_in? %>
94 <p><%= link_to 'New topic'[:new_topic], new_topic_path(@forum), :class => "utility" %></p>
95 <% end%>