forked from jlapier/Rails-CMS-Wiki-Forum
/
show.html.erb
56 lines (40 loc) · 1.76 KB
/
show.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<h1>
<%= link_to "Forums", forums_path %>:
<% if @forum %>
<%= link_to @forum.title, @forum %>:
<% end -%>
<%= @message_post.subject if @message_post %>
</h1>
<p class="small_text" style="text-align: right;">
<%= link_to_rss feed_forum_message_post_url(@forum, @message_post, current_user.single_access_token, :atom) %>
</p>
<table class="messages" style="margin-bottom:10px;">
<%= render :partial => "whole_message", :locals => { :message => @message_post } %>
</table>
<div style="text-align:center;"><%= will_paginate @child_posts %></div>
<table class="messages">
<% for message_post in @child_posts -%>
<%= render :partial => "whole_message", :locals => { :message => message_post } %>
<% end -%>
</table>
<a name="bottom"></a>
<div style="text-align:center;"><%= will_paginate @child_posts %></div>
<br/>
<h3>Reply to this thread:</h3>
<%= render :partial => "message_form",
:locals => { :message_post => MessagePost.new(:thread => @message_post, :subject => "RE: #{@message_post.subject}"), :followers => [@followers] }
%>
<p class="small_text">
Go to <a href="http://en.gravatar.com/">gravatar.com</a> to upload picture for your account. By doing so your photo will appear next to your discussion posts.
</p>
<% content_for :admin_bar do %>
<%= link_to 'delete this message thread', forum_message_post_path(@forum, @message_post), :method => :delete,
:confirm => 'Are you sure you want to delete this thread and all the messages in it?' %>
<% end %>
<br />
<h3>Following this Thread</h3>
<ul>
<% for user in @followers -%>
<li><%= user.full_name%> <%if user == current_user%>(<%= link_to 'stop following', stop_following_forum_message_post_path(@forum, @message_post), :method => :post %>)<%end%></li>
<% end -%>
</ul>