##// END OF EJS Templates
Code cleanup, use named routes....
Jean-Philippe Lang -
r10842:8eea999ca676
parent child
Show More
@@ -1,38 +1,38
1 <h2><%= l(:label_board_plural) %></h2>
1 <h2><%= l(:label_board_plural) %></h2>
2
2
3 <table class="list boards">
3 <table class="list boards">
4 <thead><tr>
4 <thead><tr>
5 <th><%= l(:label_board) %></th>
5 <th><%= l(:label_board) %></th>
6 <th><%= l(:label_topic_plural) %></th>
6 <th><%= l(:label_topic_plural) %></th>
7 <th><%= l(:label_message_plural) %></th>
7 <th><%= l(:label_message_plural) %></th>
8 <th><%= l(:label_message_last) %></th>
8 <th><%= l(:label_message_last) %></th>
9 </tr></thead>
9 </tr></thead>
10 <tbody>
10 <tbody>
11 <% Board.board_tree(@boards) do |board, level| %>
11 <% Board.board_tree(@boards) do |board, level| %>
12 <tr class="<%= cycle 'odd', 'even' %>">
12 <tr class="<%= cycle 'odd', 'even' %>">
13 <td style="padding-left: <%= level * 18 %>px;">
13 <td style="padding-left: <%= level * 18 %>px;">
14 <%= link_to h(board.name), {:action => 'show', :id => board}, :class => "board" %><br />
14 <%= link_to h(board.name), project_board_path(board.project, board), :class => "board" %><br />
15 <%=h board.description %>
15 <%=h board.description %>
16 </td>
16 </td>
17 <td class="topic-count"><%= board.topics_count %></td>
17 <td class="topic-count"><%= board.topics_count %></td>
18 <td class="message-count"><%= board.messages_count %></td>
18 <td class="message-count"><%= board.messages_count %></td>
19 <td class="last-message">
19 <td class="last-message">
20 <% if board.last_message %>
20 <% if board.last_message %>
21 <%= authoring board.last_message.created_on, board.last_message.author %><br />
21 <%= authoring board.last_message.created_on, board.last_message.author %><br />
22 <%= link_to_message board.last_message %>
22 <%= link_to_message board.last_message %>
23 <% end %>
23 <% end %>
24 </td>
24 </td>
25 </tr>
25 </tr>
26 <% end %>
26 <% end %>
27 </tbody>
27 </tbody>
28 </table>
28 </table>
29
29
30 <% other_formats_links do |f| %>
30 <% other_formats_links do |f| %>
31 <%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'index', :id => @project, :show_messages => 1, :key => User.current.rss_key} %>
31 <%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'index', :id => @project, :show_messages => 1, :key => User.current.rss_key} %>
32 <% end %>
32 <% end %>
33
33
34 <% content_for :header_tags do %>
34 <% content_for :header_tags do %>
35 <%= auto_discovery_link_tag(:atom, {:controller => 'activities', :action => 'index', :id => @project, :format => 'atom', :show_messages => 1, :key => User.current.rss_key}) %>
35 <%= auto_discovery_link_tag(:atom, {:controller => 'activities', :action => 'index', :id => @project, :format => 'atom', :show_messages => 1, :key => User.current.rss_key}) %>
36 <% end %>
36 <% end %>
37
37
38 <% html_title l(:label_board_plural) %>
38 <% html_title l(:label_board_plural) %>
@@ -1,66 +1,66
1 <%= board_breadcrumb(@board) %>
1 <%= board_breadcrumb(@board) %>
2
2
3 <div class="contextual">
3 <div class="contextual">
4 <%= link_to_if_authorized l(:label_message_new),
4 <%= link_to l(:label_message_new),
5 {:controller => 'messages', :action => 'new', :board_id => @board},
5 new_board_message_path(@board),
6 :class => 'icon icon-add',
6 :class => 'icon icon-add',
7 :onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' %>
7 :onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.allowed_to?(:add_messages, @board.project) %>
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 <% if authorize_for('messages', 'new') %>
12 <% if User.current.allowed_to?(:add_messages, @board.project) %>
13 <h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> &#187; <%= l(:label_message_new) %></h2>
13 <h2><%= link_to h(@board.name), project_board_path(@project, @board) %> &#187; <%= l(:label_message_new) %></h2>
14 <%= form_for @message, :url => {:controller => 'messages', :action => 'new', :board_id => @board}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
14 <%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %>
15 <%= render :partial => 'messages/form', :locals => {:f => f} %>
15 <%= render :partial => 'messages/form', :locals => {:f => f} %>
16 <p><%= submit_tag l(:button_create) %>
16 <p><%= submit_tag l(:button_create) %>
17 <%= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form') %> |
17 <%= preview_link(preview_board_message_path(@board), 'message-form') %> |
18 <%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' %></p>
18 <%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' %></p>
19 <% end %>
19 <% end %>
20 <div id="preview" class="wiki"></div>
20 <div id="preview" class="wiki"></div>
21 <% end %>
21 <% end %>
22 </div>
22 </div>
23
23
24 <h2><%=h @board.name %></h2>
24 <h2><%=h @board.name %></h2>
25 <p class="subtitle"><%=h @board.description %></p>
25 <p class="subtitle"><%=h @board.description %></p>
26
26
27 <% if @topics.any? %>
27 <% if @topics.any? %>
28 <table class="list messages">
28 <table class="list messages">
29 <thead><tr>
29 <thead><tr>
30 <th><%= l(:field_subject) %></th>
30 <th><%= l(:field_subject) %></th>
31 <th><%= l(:field_author) %></th>
31 <th><%= l(:field_author) %></th>
32 <%= sort_header_tag('created_on', :caption => l(:field_created_on)) %>
32 <%= sort_header_tag('created_on', :caption => l(:field_created_on)) %>
33 <%= sort_header_tag('replies', :caption => l(:label_reply_plural)) %>
33 <%= sort_header_tag('replies', :caption => l(:label_reply_plural)) %>
34 <%= sort_header_tag('updated_on', :caption => l(:label_message_last)) %>
34 <%= sort_header_tag('updated_on', :caption => l(:label_message_last)) %>
35 </tr></thead>
35 </tr></thead>
36 <tbody>
36 <tbody>
37 <% @topics.each do |topic| %>
37 <% @topics.each do |topic| %>
38 <tr class="message <%= cycle 'odd', 'even' %> <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>">
38 <tr class="message <%= cycle 'odd', 'even' %> <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>">
39 <td class="subject"><%= link_to h(topic.subject), { :controller => 'messages', :action => 'show', :board_id => @board, :id => topic } %></td>
39 <td class="subject"><%= link_to h(topic.subject), board_message_path(@board, topic) %></td>
40 <td class="author"><%= link_to_user(topic.author) %></td>
40 <td class="author"><%= link_to_user(topic.author) %></td>
41 <td class="created_on"><%= format_time(topic.created_on) %></td>
41 <td class="created_on"><%= format_time(topic.created_on) %></td>
42 <td class="reply-count"><%= topic.replies_count %></td>
42 <td class="reply-count"><%= topic.replies_count %></td>
43 <td class="last_message">
43 <td class="last_message">
44 <% if topic.last_reply %>
44 <% if topic.last_reply %>
45 <%= authoring topic.last_reply.created_on, topic.last_reply.author %><br />
45 <%= authoring topic.last_reply.created_on, topic.last_reply.author %><br />
46 <%= link_to_message topic.last_reply %>
46 <%= link_to_message topic.last_reply %>
47 <% end %>
47 <% end %>
48 </td>
48 </td>
49 </tr>
49 </tr>
50 <% end %>
50 <% end %>
51 </tbody>
51 </tbody>
52 </table>
52 </table>
53 <p class="pagination"><%= pagination_links_full @topic_pages, @topic_count %></p>
53 <p class="pagination"><%= pagination_links_full @topic_pages, @topic_count %></p>
54 <% else %>
54 <% else %>
55 <p class="nodata"><%= l(:label_no_data) %></p>
55 <p class="nodata"><%= l(:label_no_data) %></p>
56 <% end %>
56 <% end %>
57
57
58 <% other_formats_links do |f| %>
58 <% other_formats_links do |f| %>
59 <%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
59 <%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
60 <% end %>
60 <% end %>
61
61
62 <% html_title @board.name %>
62 <% html_title @board.name %>
63
63
64 <% content_for :header_tags do %>
64 <% content_for :header_tags do %>
65 <%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@project}: #{@board}") %>
65 <%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@project}: #{@board}") %>
66 <% end %>
66 <% end %>
General Comments 0
You need to be logged in to leave comments. Login now