1 <% @page_title = @topic.title %>
2 <% @monitoring = logged_in? && !Monitorship.count(:id, :conditions => ['user_id = ? and topic_id = ? and active = ?', current_user.id, @topic.id, true]).zero? %>
4 <% content_for :right do -%>
6 <h5><%= 'Voices'[:voices_title] %></h5>
7 <ul class="flat talking">
8 <% @topic.voices.each do | user | %>
9 <li><%= link_to h(user.display_name), user_path(user) %></li>
14 <% end # right content -%>
18 <% form_tag monitorship_path(@forum, @topic), :style => 'margin-top:0em; float:right;' do -%>
20 <input id="monitor_checkbox" type="checkbox" <%= "checked='checked'" if @monitoring %>
21 onclick="if (this.checked) {<%= remote_function :url => monitorship_path(@forum, @topic) %>} else {<%= remote_function :url => monitorship_path(@forum, @topic), :method => :delete %>}" />
22 <label id="monitor_label" for="monitor_checkbox"><%= @monitoring ? 'Monitoring topic'[] : 'Monitor topic'[] %></label>
23 <%= hidden_field_tag '_method', 'delete' if @monitoring %>
24 <%= submit_tag :Set, :id => 'monitor_submit' %>
32 <%= link_to "Forums"[:forums_title], home_path %> <span class="arrow">→</span>
33 <%= link_to h(@topic.forum.name), forum_path(@topic.forum) %>
35 page=session[:forum_page] ? session[:forum_page][@topic.forum.id] : nil
36 if page and page!=1 %>
37 <small style="color:#ccc">
38 (<%= link_to 'page {page}'[:page, page], forum_path(:id => @topic.forum, :page => page) %>)
41 <span class="arrow">→</span>
44 <h1 id="topic-title" style="margin-top:0.5em;"<%= %( onmouseover="$('topic_mod').show();" onmouseout="$('topic_mod').hide();") if logged_in? %>>
48 <% if @topic.locked? %>
49 <span>(<%= 'locked'[] %>)</span>
52 <span style="display:none;" id="topic_mod">
53 <% if @topic.editable_by?(current_user) -%>
54 <%= link_to('edit'[], edit_topic_path(@forum, @topic), :class => "utility") %> |
55 <%= link_to('delete'[], topic_path(@forum, @topic), :class => "utility", :method => :delete, :confirm => 'Delete this topic forever?'[:delete_topic_conf]) %>
62 <%= feed_icon_tag @topic.title, formatted_topic_path(@forum, @topic, :rss) %>
63 <%= '{count} post(s)'[(count=@topic.posts.size)==1 ? :post_count : :posts_count, number_with_delimiter(count)] %>,
64 <%= '{count} voice(s)'[(count=@topic.voices.size)==1 ? :voice_count : :voices_count, number_with_delimiter(count)] %>
67 <%= pagination @posts %>
69 <a name="<%= dom_id @posts.first %>" id="<%= dom_id @posts.first %>"> </a>
71 <table border="0" cellspacing="0" cellpadding="0" class="posts wide">
72 <% for post in @posts do %>
73 <% unless post == @posts.first %>
76 <a name="<%= dom_id post %>" id="<%= dom_id post %>"> </a>
80 <tr class="post hentry" id="<%= dom_id post %>-row">
81 <td class="author vcard">
83 <a href="#<%= dom_id post %>" rel="bookmark">
84 <abbr class="updated" title="<%= post.created_at.xmlschema %>">
85 <%= time_ago_in_words(post.created_at) %>
90 <%= avatar_for post.user %>
91 <span class="fn"><%= link_to truncate(h(post.user.display_name), 15), user_path(post.user), :class => (post.user == @posts.first.user ? "threadauthor" : nil) %></span>
92 <% if post.user.admin? or post.forum.moderators.include?(post.user) %>
94 <% if post.user.admin? %>
95 <%= 'Administator'[:administrator_title] %>
96 <% elsif post.forum.moderators.include?(post.user) %>
97 <%= 'Moderator'[:moderator_title] %>
101 <span class="posts"><%= '{count} post(s)'[(count=post.user.posts.size)==1 ? :post_count : :posts_count, number_with_delimiter(count)] %></span>
104 <% if logged_in? && post.editable_by?(current_user) -%>
107 <%= ajax_spinner_for "edit-post-#{post.id}", "spinner_bounce.gif" %>
108 <%= link_to_remote('Edit post'[],
109 {:url => edit_post_path(:forum_id => @forum, :topic_id => @topic, :id => post), :method => :get,
110 :before => "EditForm.init(#{post.id});", :condition => "!EditForm.isEditing(#{post.id})" },
111 {:href => edit_post_path(:forum_id => @forum, :topic_id => @topic, :id => post, :page => params[:page]), :class => "utility"}) %>
118 <td class="body entry-content" id="post-body-<%= post.id %>">
120 <%= link_to_function image_tag('clearbits/comment.gif', :class => 'icon reply'), "$('reply').toggle()" if logged_in? %>
122 <%= post.body_html %>
129 <%= next_page @posts %>
130 <%= pagination @posts %>
133 <div id="edit"></div>
134 <% if @topic.locked? %>
136 <%= image_tag "clearbits/lock.gif", :class => "icon grey", :title => "Topic locked"[:topic_locked_title] %>
138 <%= 'This topic is locked'[:locked_topic] %>.</label>
142 <p><%= link_to_function 'Reply to topic'[], "ReplyForm.init()", :class => "utility" %></p>
144 <div id="reply" class="editbox">
145 <div class="container">
146 <%= content_tag 'p', h(flash[:bad_reply]), :class => 'notice' if flash[:bad_reply] %>
147 <% form_for :post, :url => posts_path(:forum_id => @forum, :topic_id => @topic, :page => @topic.last_page) do |f| -%>
148 <table width="100%" border="0" cellpadding="0" cellspacing="0">
150 <td rowspan="2" width="70%">
151 <%= f.text_area :body, :rows => 8 %>
156 <h5><%= 'Formatting Help'[] %></h5>
159 <li><%= '*bold*'[:formatting_bold] %>
161 <%= '_italics_'[:formatting_italics] %>
162 <br />
163 <%= 'bq. <span>(quotes)</span>'[:formatting_blockquote] %></li>
164 <li>"IBM":http://www.ibm.com</li>
165 <li><%= '* or # <span>(lists)</span>'[:formatting_list] %></li>
171 <td valign="bottom" style="padding-bottom:15px;">
172 <%= submit_tag "Save Reply"[] %><span class="button_or">or <%= link_to_function 'cancel'[], "$('reply').hide()" %></span>
179 <%= javascript_tag "$('reply').hide();"%>
183 <div class="crumbs" style="margin-top:1.1em;">
184 <%= link_to "Forums"[:forums_title], home_path %> <span class="arrow">→</span>
185 <%= link_to h(@topic.forum.name), forum_path(@topic.forum) %> <span class="arrow">→</span>