Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 416
- Log:
Ticket #276 asks for the forum description to be included in the detail
view for a topic, listing posts. The list of topics within a forum sets
a precedent by putting this information in the sidebar, so I've copied
that mechanism for the posts index view.
- Author:
- rool
- Date:
- Mon Mar 21 22:27:09 +0000 2011
- Size:
- 6162 Bytes
1 | <% @page_title = @topic.title %> |
2 | <% @monitoring = logged_in? && !Monitorship.count(:all, :conditions => ['user_id = ? and topic_id = ? and active = ?', current_user.id, @topic.id, true]).zero? %> |
3 | |
4 | <% content_for :right do -%> |
5 | <% unless @forum.description.blank? %> |
6 | <h3>Description</h3> |
7 | <%= @forum.description_html %> |
8 | <% end %> |
9 | |
10 | <h3>Voices</h3> |
11 | <ul class="flat talking"> |
12 | <% @voices.each do | user | %> |
13 | <li><%= link_to h(user.display_name), user_path(user) %></li> |
14 | <% end %> |
15 | </ul> |
16 | |
17 | |
18 | <% end # right content -%> |
19 | |
20 | <% if logged_in? -%> |
21 | <% form_tag monitorships_path(@forum, @topic) + (@monitoring ? '/destroy' : ''), :style => 'margin-top:0em; float:right;' do -%> |
22 | <div> |
23 | <input id="monitor_checkbox" type="checkbox" <%= "checked='checked'" if @monitoring %> /> |
24 | <label id="monitor_label" for="monitor_checkbox">Watch<%= "ing" if @monitoring %> topic</label> |
25 | <%= submit_tag :Set, :id => 'monitor_submit' %> |
26 | </div> |
27 | <% end -%> |
28 | <% end -%> |
29 | |
30 | |
31 | <div class="crumbs"> |
32 | <%= link_to "Forums", home_path %> <span class="arrow">→</span> |
33 | <%= link_to h(@topic.forum.name), forum_path(@topic.forum) %> <span class="arrow">→</span> |
34 | </div> |
35 | |
36 | <h1 id="topic-title" style="margin-top:0.5em;"<%= %( onmouseover="$('topic_mod').show();" onmouseout="$('topic_mod').hide();") if logged_in? %>> |
37 | |
38 | |
39 | <%= h @topic.title %> |
40 | <% if @topic.locked? %> |
41 | <span>(locked)</span> |
42 | <% end %> |
43 | <% if logged_in? %> |
44 | <% if (current_user.admin? && @topic.editable_by?(current_user)) -%> |
45 | <span id="topic_mod"> |
46 | <%= link_to('edit', edit_topic_path(@forum, @topic), :class => "utility") %> |
47 | <% form_for(:topic, |
48 | { |
49 | :html => { |
50 | :method => :delete, |
51 | :class => 'xdialog', |
52 | :style => 'display:inline', |
53 | :onsubmit => 'return confirm("Delete this topic forever?");' |
54 | }, |
55 | :url => topic_path(@forum, @topic) |
56 | } |
57 | ) do |f| -%> |
58 | <%= submit_tag 'Delete' %> |
59 | <% end -%> |
60 | </span> |
61 | <% end -%> |
62 | <% end %> |
63 | </h1> |
64 | |
65 | <p class="subtitle"> |
66 | <%= feed_icon_tag @topic.title, formatted_topic_path(@forum, @topic, :rss) %> |
67 | <%= pluralize @topic.posts.count, 'post' %>, <%= pluralize @topic.voices, 'voice' %> |
68 | </p> |
69 | |
70 | <% if @post_pages.page_count > 1 -%> |
71 | <p class="pages">Pages: <strong><%= pagination_links @post_pages, :window_size => 10 %></strong></p> |
72 | <% end -%> |
73 | |
74 | <a name="<%= @posts.first.dom_id %>" id="<%= @posts.first.dom_id %>" class="spacer_link"> </a> |
75 | |
76 | <table border="0" cellspacing="0" cellpadding="0" class="posts wide"> |
77 | <% for post in @posts do %> |
78 | <% unless post == @posts.first %> |
79 | <tr class="spacer"> |
80 | <td colspan="2"> |
81 | <a name="<%= post.dom_id %>" id="<%= post.dom_id %>" class="spacer_link"> </a> |
82 | </td> |
83 | </tr> |
84 | <% end %> |
85 | <tr class="post hentry" id="<%= post.dom_id %>-row"> |
86 | <td class="author vcard"> |
87 | <div class="date"> |
88 | <a href="#<%= post.dom_id %>" rel="bookmark"> |
89 | <abbr class="updated" title="<%= post.created_at.xmlschema %>"> |
90 | <%= time_ago_in_words(post.created_at) %> |
91 | </abbr> |
92 | </a> |
93 | </div> |
94 | |
95 | <%= avatar_for post.user %> |
96 | <span class="fn"><%= link_to h(post.user.display_name), user_path(post.user), :class => (post.user == @posts.first.user ? "admin" : nil) %></span> |
97 | <span class="posts"><%= pluralize post.user.posts_count, 'post' %></span> |
98 | |
99 | <% if logged_in? && post.editable_by?(current_user) -%> |
100 | <p> |
101 | <span class="edit"> |
102 | <%= link_to('Edit post', edit_post_path(:forum_id => @forum, :topic_id => @topic, :id => post), :class => "utility") %> |
103 | </span> |
104 | </p> |
105 | <% end -%> |
106 | |
107 | |
108 | </td> |
109 | <td class="body entry-content" id="post-body-<%= post.id %>"> |
110 | <!-- |
111 | <%= link_to_function image_tag('clearbits/comment.gif', :class => 'icon reply'), "$('reply').toggle()" if logged_in? %> |
112 | --> |
113 | <%= post.body_html %> |
114 | </td> |
115 | </tr> |
116 | |
117 | <% end %> |
118 | </table> |
119 | |
120 | <% if @post_pages and @post_pages.current.next %> |
121 | <p style="float:right;"><%= link_to "Next page", { :page => @post_pages.current.next }.merge(params.reject{|k,v| k=="page"}) %></p> |
122 | <% end %> |
123 | |
124 | <% if @post_pages.page_count > 1 -%> |
125 | <p class="pages">Pages: <strong><%= pagination_links @post_pages, :window_size => 10 %></strong></p> |
126 | <% end -%> |
127 | |
128 | <% if logged_in? %> |
129 | <div id="edit"></div> |
130 | <% if @topic.locked? %> |
131 | <p> |
132 | <%= image_tag "clearbits/lock.gif", :class => "icon grey", :title => "Topic locked" %> |
133 | <label> |
134 | This topic is locked.</label> |
135 | </p> |
136 | <% else %> |
137 | |
138 | <script language="JavaScript"> |
139 | function quickRedReference() { |
140 | window.open( |
141 | "http://redcloth.org/hobix.com/textile/quick.html", |
142 | "redRef", |
143 | "height=600,width=550,channelmode=0,dependent=0," + |
144 | "directories=0,fullscreen=0,location=0,menubar=0," + |
145 | "resizable=0,scrollbars=1,status=1,toolbar=0" |
146 | ); |
147 | } |
148 | </script> |
149 | |
150 | <p /> |
151 | <h3>Reply</h3> |
152 | |
153 | <p /> |
154 | <div class="editbox container"> |
155 | <%= content_tag 'p', h(flash[:bad_reply]), :class => 'notice' if flash[:bad_reply] %> |
156 | <% form_for :post, :url => posts_path(:forum_id => @forum, :topic_id => @topic, :page => @topic.last_page) do |f| -%> |
157 | <%= f.text_area :body, :rows => 8 %> |
158 | |
159 | <p /> |
160 | <h5>Formatting Help</h5> |
161 | |
162 | <ul class="help"> |
163 | <li>*bold* _italics_ bq. <span>(quotes)</span></li> |
164 | <li>"IBM":http://www.ibm.com</li> |
165 | <li>* or # <span>(lists)</span></li> |
166 | </ul> |
167 | |
168 | See also the Textile reference <a href="http://redcloth.org/hobix.com/textile/quick.html" target="_blank" onClick="quickRedReference(); return false;">here</a>. |
169 | Don't worry about making mistakes - after adding a reply, you can edit |
170 | your message as many times as you like. |
171 | |
172 | <p align="right"> |
173 | <%= submit_tag "Save Reply" %> |
174 | </p> |
175 | <% end -%> |
176 | </div> |
177 | <% end %> |
178 | <% else %> |
179 | <p /> |
180 | <h3>Reply</h3> |
181 | |
182 | <p /> |
183 | To post replies, please first <a href="/hub/account/login">log in</a>. |
184 | <% end %> |
185 | |
186 | <div class="crumbs" style="margin-top:1.1em;"> |
187 | <%= link_to "Forums", home_path %> <span class="arrow">→</span> |
188 | <%= link_to h(@topic.forum.name), forum_path(@topic.forum) %> <span class="arrow">→</span> |
189 | </div> |