% @page_title = @topic.title %>
<% @monitoring = logged_in? && !Monitorship.count(:all, :conditions => ['user_id = ? and topic_id = ? and active = ?', current_user.id, @topic.id, true]).zero? %>
<% content_for :right do -%>
<% unless @forum.description.blank? %>
Description
<%= @forum.description_html %>
<% end %>
Voices
<% @voices.each do | user | %>
- <%= link_to h(user.display_name), user_path(user) %>
<% end %>
<% end # right content -%>
<% if logged_in? -%>
<% form_tag monitorships_path(@forum, @topic) + (@monitoring ? '/destroy' : ''), :style => 'margin-top:0em; float:right;' do -%>
/>
<%= submit_tag :Set, :id => 'monitor_submit' %>
<% end -%>
<% end -%>
<%= link_to "Forums", home_path %> →
<%= link_to h(@topic.forum.name), forum_path(@topic.forum) %> →
>
<%= h @topic.title %>
<% if @topic.locked? %>
(locked)
<% end %>
<% if logged_in? %>
<% if (current_user.admin? && @topic.editable_by?(current_user)) -%>
<%= link_to('edit', edit_topic_path(@forum, @topic), :class => "utility") %>
<% form_for(:topic,
{
:html => {
:method => :delete,
:class => 'xdialog',
:style => 'display:inline',
:onsubmit => 'return confirm("Delete this topic forever?");'
},
:url => topic_path(@forum, @topic)
}
) do |f| -%>
<%= submit_tag 'Delete' %>
<% end -%>
<% end -%>
<% end %>
<%= feed_icon_tag @topic.title, formatted_topic_path(@forum, @topic, :rss) %>
<%= pluralize @topic.posts.count, 'post' %>, <%= pluralize @topic.voices, 'voice' %>
<% if @post_pages.page_count > 1 -%>
<% form_tag( @posts, { :method => 'get' } ) do %>
<%= hidden_field_tag(:q, params[:q] ) if params.has_key?(:q) %>
Posts per page:
<%=
select_tag(
'posts_per_page',
options_for_select(
['25', '50', '100'],
params[:posts_per_page]
),
:id => nil
)
%>
<%= submit_tag( 'Change', { :name => 'posts_per_page_change', :style => 'font-size: 9pt' } ) %>
<% end %>
Pages: <%= topicshelp_pagination_links_for( @post_pages ) %>
<% end -%>
<% for post in @posts do %>
<% unless post == @posts.first %>
|
<% end %>
<%= avatar_for post.user %>
<%= link_to h(post.user.display_name), user_path(post.user), :class => (post.user == @posts.first.user ? "admin" : nil) %>
<%= pluralize post.user.posts_count, 'post' %>
<% if logged_in? && post.editable_by?(current_user) -%>
<%= link_to('Edit post', edit_post_path(:forum_id => @forum, :topic_id => @topic, :id => post, :page => @post_pages.current, :posts_per_page => params[:posts_per_page]), :class => "utility") %>
<% end -%>
|
<%= post.body_html %>
|
<% end %>
<% if @post_pages and @post_pages.current.next %>
<%= link_to "Next page", { :page => @post_pages.current.next }.merge(params.reject{|k,v| k=="page"}) %>
<% end %>
<% if @post_pages.page_count > 1 -%>
Pages: <%= topicshelp_pagination_links_for( @post_pages ) %>
<% end -%>
<% if logged_in? %>
<% if @topic.locked? %>
<%= image_tag "clearbits/lock.gif", :class => "icon grey", :title => "Topic locked" %>
<% else %>
Reply
<%= content_tag 'p', h(flash[:bad_reply]), :class => 'notice' if flash[:bad_reply] %>
<% form_for :post, :url => posts_path(:forum_id => @forum, :topic_id => @topic, :page => @topic.last_page(params[:posts_per_page])) do |f| -%>
<%= f.text_area :body, :rows => 8 %>
Formatting Help
- *bold* _italics_ bq. (quotes)
- "IBM":http://www.ibm.com
- * or # (lists)
See also the Textile reference
here.
Don't worry about making mistakes - after adding a reply, you can edit
your message as many times as you like.
<%= apphelp_pagination_fields() %>
<%= submit_tag "Save Reply" %>
<% end -%>
<% end %>
<% else %>
Reply
To post replies, please first log in.
<% end %>
<%= link_to "Forums", home_path %> →
<%= link_to h(@topic.forum.name), forum_path(@topic.forum) %> →