##// END OF EJS Templates
Messages on a Board can now be sorted by the number of replies....
Eric Davis -
r1749:6db8fa8ef762
parent child
Show More
@@ -1,61 +1,61
1 <%= breadcrumb link_to(l(:label_board_plural), {:controller => 'boards', :action => 'index', :project_id => @project}) %>
1 <%= breadcrumb link_to(l(:label_board_plural), {:controller => 'boards', :action => 'index', :project_id => @project}) %>
2
2
3 <div class="contextual">
3 <div class="contextual">
4 <%= link_to_if_authorized l(:label_message_new),
4 <%= link_to_if_authorized l(:label_message_new),
5 {:controller => 'messages', :action => 'new', :board_id => @board},
5 {:controller => 'messages', :action => 'new', :board_id => @board},
6 :class => 'icon icon-add',
6 :class => 'icon icon-add',
7 :onclick => 'Element.show("add-message"); return false;' %>
7 :onclick => 'Element.show("add-message"); return false;' %>
8 <%= watcher_tag(@board, User.current) %>
8 <%= watcher_tag(@board, User.current) %>
9 </div>
9 </div>
10
10
11 <div id="add-message" style="display:none;">
11 <div id="add-message" style="display:none;">
12 <h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> &#187; <%= l(:label_message_new) %></h2>
12 <h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> &#187; <%= l(:label_message_new) %></h2>
13 <% form_for :message, @message, :url => {:controller => 'messages', :action => 'new', :board_id => @board}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
13 <% form_for :message, @message, :url => {:controller => 'messages', :action => 'new', :board_id => @board}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
14 <%= render :partial => 'messages/form', :locals => {:f => f} %>
14 <%= render :partial => 'messages/form', :locals => {:f => f} %>
15 <p><%= submit_tag l(:button_create) %>
15 <p><%= submit_tag l(:button_create) %>
16 <%= link_to_remote l(:label_preview),
16 <%= link_to_remote l(:label_preview),
17 { :url => { :controller => 'messages', :action => 'preview', :board_id => @board },
17 { :url => { :controller => 'messages', :action => 'preview', :board_id => @board },
18 :method => 'post',
18 :method => 'post',
19 :update => 'preview',
19 :update => 'preview',
20 :with => "Form.serialize('message-form')",
20 :with => "Form.serialize('message-form')",
21 :complete => "Element.scrollTo('preview')"
21 :complete => "Element.scrollTo('preview')"
22 }, :accesskey => accesskey(:preview) %> |
22 }, :accesskey => accesskey(:preview) %> |
23 <%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-message")' %></p>
23 <%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-message")' %></p>
24 <% end %>
24 <% end %>
25 <div id="preview" class="wiki"></div>
25 <div id="preview" class="wiki"></div>
26 </div>
26 </div>
27
27
28 <h2><%=h @board.name %></h2>
28 <h2><%=h @board.name %></h2>
29
29
30 <% if @topics.any? %>
30 <% if @topics.any? %>
31 <table class="list messages">
31 <table class="list messages">
32 <thead><tr>
32 <thead><tr>
33 <th><%= l(:field_subject) %></th>
33 <th><%= l(:field_subject) %></th>
34 <th><%= l(:field_author) %></th>
34 <th><%= l(:field_author) %></th>
35 <%= sort_header_tag("#{Message.table_name}.created_on", :caption => l(:field_created_on)) %>
35 <%= sort_header_tag("#{Message.table_name}.created_on", :caption => l(:field_created_on)) %>
36 <th><%= l(:label_reply_plural) %></th>
36 <%= sort_header_tag("#{Message.table_name}.replies_count", :caption => l(:label_reply_plural)) %>
37 <%= sort_header_tag("#{Message.table_name}.updated_on", :caption => l(:label_message_last)) %>
37 <%= sort_header_tag("#{Message.table_name}.updated_on", :caption => l(:label_message_last)) %>
38 </tr></thead>
38 </tr></thead>
39 <tbody>
39 <tbody>
40 <% @topics.each do |topic| %>
40 <% @topics.each do |topic| %>
41 <tr class="message <%= cycle 'odd', 'even' %> <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>">
41 <tr class="message <%= cycle 'odd', 'even' %> <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>">
42 <td class="subject"><%= link_to h(topic.subject), { :controller => 'messages', :action => 'show', :board_id => @board, :id => topic }, :class => 'icon' %></td>
42 <td class="subject"><%= link_to h(topic.subject), { :controller => 'messages', :action => 'show', :board_id => @board, :id => topic }, :class => 'icon' %></td>
43 <td class="author" align="center"><%= topic.author %></td>
43 <td class="author" align="center"><%= topic.author %></td>
44 <td class="created_on" align="center"><%= format_time(topic.created_on) %></td>
44 <td class="created_on" align="center"><%= format_time(topic.created_on) %></td>
45 <td class="replies" align="center"><%= topic.replies_count %></td>
45 <td class="replies" align="center"><%= topic.replies_count %></td>
46 <td class="last_message">
46 <td class="last_message">
47 <% if topic.last_reply %>
47 <% if topic.last_reply %>
48 <%= authoring topic.last_reply.created_on, topic.last_reply.author %><br />
48 <%= authoring topic.last_reply.created_on, topic.last_reply.author %><br />
49 <%= link_to_message topic.last_reply %>
49 <%= link_to_message topic.last_reply %>
50 <% end %>
50 <% end %>
51 </td>
51 </td>
52 </tr>
52 </tr>
53 <% end %>
53 <% end %>
54 </tbody>
54 </tbody>
55 </table>
55 </table>
56 <p class="pagination"><%= pagination_links_full @topic_pages, @topic_count %></p>
56 <p class="pagination"><%= pagination_links_full @topic_pages, @topic_count %></p>
57 <% else %>
57 <% else %>
58 <p class="nodata"><%= l(:label_no_data) %></p>
58 <p class="nodata"><%= l(:label_no_data) %></p>
59 <% end %>
59 <% end %>
60
60
61 <% html_title h(@board.name) %>
61 <% html_title h(@board.name) %>
General Comments 0
You need to be logged in to leave comments. Login now