You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

show.html.erb 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <%= board_breadcrumb(@board) %>
  2. <div class="contextual">
  3. <%= link_to l(:label_message_new),
  4. new_board_message_path(@board),
  5. :class => 'icon icon-add',
  6. :onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.allowed_to?(:add_messages, @board.project) %>
  7. <%= watcher_link(@board, User.current) %>
  8. </div>
  9. <div id="add-message" style="display:none;">
  10. <% if User.current.allowed_to?(:add_messages, @board.project) %>
  11. <h2><%= link_to @board.name, project_board_path(@project, @board) %> &#187; <%= l(:label_message_new) %></h2>
  12. <%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %>
  13. <%= render :partial => 'messages/form', :locals => {:f => f} %>
  14. <p><%= submit_tag l(:button_create) %>
  15. <%= preview_link(preview_board_message_path(@board), 'message-form') %> |
  16. <%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' %></p>
  17. <% end %>
  18. <div id="preview" class="wiki"></div>
  19. <% end %>
  20. </div>
  21. <h2><%= @board.name %></h2>
  22. <p class="subtitle"><%= @board.description %></p>
  23. <% if @topics.any? %>
  24. <table class="list messages">
  25. <thead><tr>
  26. <th><%= l(:field_subject) %></th>
  27. <th><%= l(:field_author) %></th>
  28. <%= sort_header_tag('created_on', :caption => l(:field_created_on)) %>
  29. <%= sort_header_tag('replies', :caption => l(:label_reply_plural)) %>
  30. <%= sort_header_tag('updated_on', :caption => l(:label_message_last)) %>
  31. </tr></thead>
  32. <tbody>
  33. <% @topics.each do |topic| %>
  34. <tr id="message-<%= topic.id %>" class="message <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>">
  35. <td class="subject icon <%= 'icon-sticky' if topic.sticky? %> <%= 'icon-locked' if topic.locked? %>"><%= link_to topic.subject, board_message_path(@board, topic) %></td>
  36. <td class="author"><%= link_to_user(topic.author) %></td>
  37. <td class="created_on"><%= format_time(topic.created_on) %></td>
  38. <td class="reply-count"><%= topic.replies_count %></td>
  39. <td class="last_message">
  40. <% if topic.last_reply %>
  41. <%= authoring topic.last_reply.created_on, topic.last_reply.author %><br />
  42. <%= link_to_message topic.last_reply %>
  43. <% end %>
  44. </td>
  45. </tr>
  46. <% end %>
  47. </tbody>
  48. </table>
  49. <span class="pagination"><%= pagination_links_full @topic_pages, @topic_count %></span>
  50. <% else %>
  51. <p class="nodata"><%= l(:label_no_data) %></p>
  52. <% end %>
  53. <% other_formats_links do |f| %>
  54. <%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
  55. <% end %>
  56. <% html_title @board.name %>
  57. <% content_for :header_tags do %>
  58. <%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@project}: #{@board}") %>
  59. <% end %>