Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 174
- Log:
The start of modifications required for site integration. This check-in
focuses on basic template and style issues.
- Author:
- rool
- Date:
- Fri Mar 02 16:00:22 +0000 2007
- Size:
- 6072 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 | |
6 | <h5>Voices</h5> |
7 | <ul class="flat talking"> |
8 | <% @voices.each do | user | %> |
9 | <li><%= link_to h(user.display_name), user_path(user) %></li> |
10 | <% end %> |
11 | </ul> |
12 | |
13 | |
14 | <% end # right content -%> |
15 | |
16 | <% if logged_in? %> |
17 | |
18 | <% form_tag monitorships_path(@forum, @topic), :style => 'margin-top:0em; float:right;' do -%> |
19 | <div> |
20 | <input id="monitor_checkbox" type="checkbox" <%= "checked='checked'" if @monitoring %> |
21 | onclick="if (this.checked) {<%= remote_function :url => monitorships_path(@forum, @topic) %>} else {<%= remote_function :url => monitorships_path(@forum, @topic), :method => :delete %>}" /> |
22 | <label id="monitor_label" for="monitor_checkbox">Watch<%= "ing" if @monitoring %> topic</label> |
23 | <%= hidden_field_tag '_method', 'delete' if @monitoring %> |
24 | <%= submit_tag :Set, :id => 'monitor_submit' %> |
25 | </div> |
26 | <% end -%> |
27 | |
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 | <span style="display:none;" id="topic_mod"> |
45 | <% if @topic.editable_by?(current_user) -%> |
46 | <%= link_to('edit', edit_topic_path(@forum, @topic), :class => "utility") %> | |
47 | <%= link_to('delete', topic_path(@forum, @topic), :class => "utility", :method => :delete, :confirm => "Delete this topic forever?") %> |
48 | <% end -%> |
49 | </span> |
50 | <% end %> |
51 | </h1> |
52 | |
53 | <p class="subtitle"> |
54 | <%= feed_icon_tag @topic.title, formatted_topic_path(@forum, @topic, :rss) %> |
55 | <%= pluralize @topic.posts.count, 'post' %>, <%= pluralize @topic.voices, 'voice' %> |
56 | </p> |
57 | |
58 | <% if @post_pages.page_count > 1 -%> |
59 | <p class="pages">Pages: <strong><%= pagination_links @post_pages, :window_size => 10 %></strong></p> |
60 | <% end -%> |
61 | |
62 | <a name="<%= @posts.first.dom_id %>" id="<%= @posts.first.dom_id %>" class="spacer_link"> </a> |
63 | |
64 | <table border="0" cellspacing="0" cellpadding="0" class="posts wide"> |
65 | <% for post in @posts do %> |
66 | <% unless post == @posts.first %> |
67 | <tr class="spacer"> |
68 | <td colspan="2"> |
69 | <a name="<%= post.dom_id %>" id="<%= post.dom_id %>" class="spacer_link"> </a> |
70 | </td> |
71 | </tr> |
72 | <% end %> |
73 | <tr class="post hentry" id="<%= post.dom_id %>-row"> |
74 | <td class="author vcard"> |
75 | <div class="date"> |
76 | <a href="#<%= post.dom_id %>" rel="bookmark"> |
77 | <abbr class="updated" title="<%= post.created_at.xmlschema %>"> |
78 | <%= time_ago_in_words(post.created_at) %> |
79 | </abbr> |
80 | </a> |
81 | </div> |
82 | |
83 | <%= avatar_for post.user %> |
84 | <span class="fn"><%= link_to truncate(h(post.user.display_name), 15), user_path(post.user), :class => (post.user == @posts.first.user ? "admin" : nil) %></span> |
85 | <span class="posts"><%= pluralize post.user.posts_count, 'post' %></span> |
86 | |
87 | <% if logged_in? && post.editable_by?(current_user) -%> |
88 | <p> |
89 | <span class="edit"> |
90 | <%= ajax_spinner_for "edit-post-#{post.id}", "spinner_bounce.gif" %> |
91 | <%= link_to_remote('Edit post', |
92 | {:url => edit_post_path(:forum_id => @forum, :topic_id => @topic, :id => post), :method => :get, |
93 | :before => "EditForm.init(#{post.id});", :condition => "!EditForm.isEditing(#{post.id})" }, |
94 | {:href => edit_post_path(:forum_id => @forum, :topic_id => @topic, :id => post, :page => params[:page]), :class => "utility"}) %> |
95 | </span> |
96 | </p> |
97 | <% end -%> |
98 | |
99 | |
100 | </td> |
101 | <td class="body entry-content" id="post-body-<%= post.id %>"> |
102 | <!-- |
103 | <%= link_to_function image_tag('clearbits/comment.gif', :class => 'icon reply'), "$('reply').toggle()" if logged_in? %> |
104 | --> |
105 | <%= post.body_html %> |
106 | </td> |
107 | </tr> |
108 | |
109 | <% end %> |
110 | </table> |
111 | |
112 | <% if @post_pages and @post_pages.current.next %> |
113 | <p style="float:right;"><%= link_to "Next page", { :page => @post_pages.current.next }.merge(params.reject{|k,v| k=="page"}) %></p> |
114 | <% end %> |
115 | |
116 | <% if @post_pages.page_count > 1 -%> |
117 | <p class="pages">Pages: <strong><%= pagination_links @post_pages, :window_size => 10 %></strong></p> |
118 | <% end -%> |
119 | |
120 | <% if logged_in? %> |
121 | <div id="edit"></div> |
122 | <% if @topic.locked? %> |
123 | <p> |
124 | <%= image_tag "clearbits/lock.gif", :class => "icon grey", :title => "Topic locked" %> |
125 | <label> |
126 | This topic is locked.</label> |
127 | </p> |
128 | <% else %> |
129 | |
130 | <p><%= link_to_function "Reply to topic", "ReplyForm.init()", :class => "utility" %></p> |
131 | |
132 | <div id="reply" class="editbox"> |
133 | <div class="container"> |
134 | <%= content_tag 'p', h(flash[:bad_reply]), :class => 'notice' if flash[:bad_reply] %> |
135 | <% form_for :post, :url => posts_path(:forum_id => @forum, :topic_id => @topic, :page => @topic.last_page) do |f| -%> |
136 | <table width="100%" border="0" cellpadding="0" cellspacing="0"> |
137 | <tr> |
138 | <td rowspan="2" width="70%"> |
139 | <%= f.text_area :body, :rows => 8 %> |
140 | </td> |
141 | <td valign="top"> |
142 | |
143 | |
144 | <h5>Formatting Help</h5> |
145 | |
146 | <ul class="help"> |
147 | <li>*bold* |
148 | |
149 | _italics_ |
150 | <br /> |
151 | bq. <span>(quotes)</span></li> |
152 | <li>"IBM":http://www.ibm.com</li> |
153 | <li>* or # <span>(lists)</span></li> |
154 | </ul> |
155 | |
156 | </td> |
157 | </tr> |
158 | <tr> |
159 | <td valign="bottom" style="padding-bottom:15px;"> |
160 | <%= submit_tag "Save Reply" %><span class="button_or">or <%= link_to_function 'cancel', "$('reply').hide()" %></span> |
161 | </td> |
162 | </tr> |
163 | </table> |
164 | <% end -%> |
165 | </div> |
166 | </div> |
167 | <%= javascript_tag "$('reply').hide();"%> |
168 | <% end %> |
169 | <% end %> |
170 | |
171 | <div class="crumbs" style="margin-top:1.1em;"> |
172 | <%= link_to "Forums", home_path %> <span class="arrow">→</span> |
173 | <%= link_to h(@topic.forum.name), forum_path(@topic.forum) %> <span class="arrow">→</span> |
174 | </div> |