2008-03-27 21:41:42 +03:00
|
|
|
<%= breadcrumb link_to(l(:label_board_plural), {:controller => 'boards', :action => 'index', :project_id => @project}) %>
|
|
|
|
|
2007-05-13 21:09:56 +04:00
|
|
|
<div class="contextual">
|
2007-09-24 23:54:48 +04:00
|
|
|
<%= link_to_if_authorized l(:label_message_new),
|
|
|
|
{:controller => 'messages', :action => 'new', :board_id => @board},
|
|
|
|
:class => 'icon icon-add',
|
|
|
|
:onclick => 'Element.show("add-message"); return false;' %>
|
2007-08-29 20:52:35 +04:00
|
|
|
<%= watcher_tag(@board, User.current) %>
|
2007-05-13 21:09:56 +04:00
|
|
|
</div>
|
|
|
|
|
2007-09-24 23:54:48 +04:00
|
|
|
<div id="add-message" style="display:none;">
|
|
|
|
<h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> » <%= l(:label_message_new) %></h2>
|
2008-03-07 20:49:44 +03:00
|
|
|
<% form_for :message, @message, :url => {:controller => 'messages', :action => 'new', :board_id => @board}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
|
2007-09-24 23:54:48 +04:00
|
|
|
<%= render :partial => 'messages/form', :locals => {:f => f} %>
|
|
|
|
<p><%= submit_tag l(:button_create) %>
|
2008-03-07 20:49:44 +03:00
|
|
|
<%= link_to_remote l(:label_preview),
|
|
|
|
{ :url => { :controller => 'messages', :action => 'preview', :board_id => @board },
|
|
|
|
:method => 'post',
|
|
|
|
:update => 'preview',
|
|
|
|
:with => "Form.serialize('message-form')",
|
|
|
|
:complete => "Element.scrollTo('preview')"
|
|
|
|
}, :accesskey => accesskey(:preview) %> |
|
2007-09-24 23:54:48 +04:00
|
|
|
<%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-message")' %></p>
|
|
|
|
<% end %>
|
2008-03-07 20:49:44 +03:00
|
|
|
<div id="preview" class="wiki"></div>
|
2007-09-24 23:54:48 +04:00
|
|
|
</div>
|
|
|
|
|
2007-05-13 21:09:56 +04:00
|
|
|
<h2><%=h @board.name %></h2>
|
|
|
|
|
2007-09-22 17:17:49 +04:00
|
|
|
<% if @topics.any? %>
|
2007-11-24 15:25:07 +03:00
|
|
|
<table class="list messages">
|
2007-05-13 21:09:56 +04:00
|
|
|
<thead><tr>
|
|
|
|
<th><%= l(:field_subject) %></th>
|
|
|
|
<th><%= l(:field_author) %></th>
|
|
|
|
<%= sort_header_tag("#{Message.table_name}.created_on", :caption => l(:field_created_on)) %>
|
2008-08-20 10:14:44 +04:00
|
|
|
<%= sort_header_tag("#{Message.table_name}.replies_count", :caption => l(:label_reply_plural)) %>
|
2007-05-13 21:09:56 +04:00
|
|
|
<%= sort_header_tag("#{Message.table_name}.updated_on", :caption => l(:label_message_last)) %>
|
|
|
|
</tr></thead>
|
|
|
|
<tbody>
|
|
|
|
<% @topics.each do |topic| %>
|
2007-11-24 15:25:07 +03:00
|
|
|
<tr class="message <%= cycle 'odd', 'even' %> <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>">
|
|
|
|
<td class="subject"><%= link_to h(topic.subject), { :controller => 'messages', :action => 'show', :board_id => @board, :id => topic }, :class => 'icon' %></td>
|
|
|
|
<td class="author" align="center"><%= topic.author %></td>
|
|
|
|
<td class="created_on" align="center"><%= format_time(topic.created_on) %></td>
|
|
|
|
<td class="replies" align="center"><%= topic.replies_count %></td>
|
|
|
|
<td class="last_message">
|
2007-05-13 21:09:56 +04:00
|
|
|
<% if topic.last_reply %>
|
2007-11-24 15:25:07 +03:00
|
|
|
<%= authoring topic.last_reply.created_on, topic.last_reply.author %><br />
|
2007-05-13 21:09:56 +04:00
|
|
|
<%= link_to_message topic.last_reply %>
|
|
|
|
<% end %>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2007-12-29 14:36:30 +03:00
|
|
|
<p class="pagination"><%= pagination_links_full @topic_pages, @topic_count %></p>
|
2007-09-22 17:17:49 +04:00
|
|
|
<% else %>
|
|
|
|
<p class="nodata"><%= l(:label_no_data) %></p>
|
|
|
|
<% end %>
|
2008-06-29 13:08:58 +04:00
|
|
|
|
|
|
|
<% html_title h(@board.name) %>
|