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 3.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <%= breadcrumb link_to(l(:label_board_plural), project_boards_path(@project)) %>
  2. <div class="contextual">
  3. <%= link_to_if_authorized l(:label_message_new),
  4. {:controller => 'messages', :action => 'new', :board_id => @board},
  5. :class => 'icon icon-add',
  6. :onclick => 'Element.show("add-message"); Form.Element.focus("message_subject"); return false;' %>
  7. <%= watcher_tag(@board, User.current) %>
  8. </div>
  9. <div id="add-message" style="display:none;">
  10. <% if authorize_for('messages', 'new') %>
  11. <h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> &#187; <%= l(:label_message_new) %></h2>
  12. <%= form_for @message, :url => {:controller => 'messages', :action => 'new', :board_id => @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. <%= link_to_remote l(:label_preview),
  16. { :url => { :controller => 'messages', :action => 'preview', :board_id => @board },
  17. :method => 'post',
  18. :update => 'preview',
  19. :with => "Form.serialize('message-form')",
  20. :complete => "Element.scrollTo('preview')"
  21. }, :accesskey => accesskey(:preview) %> |
  22. <%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-message")' %></p>
  23. <% end %>
  24. <div id="preview" class="wiki"></div>
  25. <% end %>
  26. </div>
  27. <h2><%=h @board.name %></h2>
  28. <p class="subtitle"><%=h @board.description %></p>
  29. <% if @topics.any? %>
  30. <table class="list messages">
  31. <thead><tr>
  32. <th><%= l(:field_subject) %></th>
  33. <th><%= l(:field_author) %></th>
  34. <%= sort_header_tag('created_on', :caption => l(:field_created_on)) %>
  35. <%= sort_header_tag('replies', :caption => l(:label_reply_plural)) %>
  36. <%= sort_header_tag('updated_on', :caption => l(:label_message_last)) %>
  37. </tr></thead>
  38. <tbody>
  39. <% @topics.each do |topic| %>
  40. <tr class="message <%= cycle 'odd', 'even' %> <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>">
  41. <td class="subject"><%= link_to h(topic.subject), { :controller => 'messages', :action => 'show', :board_id => @board, :id => topic } %></td>
  42. <td class="author" align="center"><%= link_to_user(topic.author) %></td>
  43. <td class="created_on" align="center"><%= format_time(topic.created_on) %></td>
  44. <td class="replies" align="center"><%= topic.replies_count %></td>
  45. <td class="last_message">
  46. <% if topic.last_reply %>
  47. <%= authoring topic.last_reply.created_on, topic.last_reply.author %><br />
  48. <%= link_to_message topic.last_reply %>
  49. <% end %>
  50. </td>
  51. </tr>
  52. <% end %>
  53. </tbody>
  54. </table>
  55. <p class="pagination"><%= pagination_links_full @topic_pages, @topic_count %></p>
  56. <% else %>
  57. <p class="nodata"><%= l(:label_no_data) %></p>
  58. <% end %>
  59. <% other_formats_links do |f| %>
  60. <%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
  61. <% end %>
  62. <% html_title @board.name %>
  63. <% content_for :header_tags do %>
  64. <%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@project}: #{@board}") %>
  65. <%= stylesheet_link_tag 'scm' %>
  66. <% end %>