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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <%= breadcrumb link_to(l(:label_board_plural), project_boards_path(@project)),
  2. link_to(h(@board.name), project_board_path(@project, @board)) %>
  3. <div class="contextual">
  4. <%= watcher_tag(@topic, User.current) %>
  5. <%= link_to_remote_if_authorized(
  6. l(:button_quote),
  7. { :url => {:action => 'quote', :id => @topic} },
  8. :class => 'icon icon-comment'
  9. ) unless @topic.locked? %>
  10. <%= link_to(
  11. l(:button_edit),
  12. {:action => 'edit', :id => @topic},
  13. :class => 'icon icon-edit'
  14. ) if @message.editable_by?(User.current) %>
  15. <%= link_to(
  16. l(:button_delete),
  17. {:action => 'destroy', :id => @topic},
  18. :method => :post,
  19. :confirm => l(:text_are_you_sure),
  20. :class => 'icon icon-del'
  21. ) if @message.destroyable_by?(User.current) %>
  22. </div>
  23. <h2><%= avatar(@topic.author, :size => "24") %><%=h @topic.subject %></h2>
  24. <div class="message">
  25. <p><span class="author"><%= authoring @topic.created_on, @topic.author %></span></p>
  26. <div class="wiki">
  27. <%= textilizable(@topic, :content) %>
  28. </div>
  29. <%= link_to_attachments @topic, :author => false %>
  30. </div>
  31. <br />
  32. <% unless @replies.empty? %>
  33. <h3 class="comments"><%= l(:label_reply_plural) %> (<%= @reply_count %>)</h3>
  34. <% @replies.each do |message| %>
  35. <div class="message reply" id="<%= "message-#{message.id}" %>">
  36. <div class="contextual">
  37. <%= link_to_remote_if_authorized(
  38. image_tag('comment.png'),
  39. { :url => {:action => 'quote', :id => message} },
  40. :title => l(:button_quote)
  41. ) unless @topic.locked? %>
  42. <%= link_to(
  43. image_tag('edit.png'),
  44. {:action => 'edit', :id => message},
  45. :title => l(:button_edit)
  46. ) if message.editable_by?(User.current) %>
  47. <%= link_to(
  48. image_tag('delete.png'),
  49. {:action => 'destroy', :id => message},
  50. :method => :post,
  51. :confirm => l(:text_are_you_sure),
  52. :title => l(:button_delete)
  53. ) if message.destroyable_by?(User.current) %>
  54. </div>
  55. <h4>
  56. <%= avatar(message.author, :size => "24") %>
  57. <%= link_to h(message.subject), { :controller => 'messages', :action => 'show', :board_id => @board, :id => @topic, :r => message, :anchor => "message-#{message.id}" } %>
  58. -
  59. <%= authoring message.created_on, message.author %>
  60. </h4>
  61. <div class="wiki"><%= textilizable message, :content, :attachments => message.attachments %></div>
  62. <%= link_to_attachments message, :author => false %>
  63. </div>
  64. <% end %>
  65. <p class="pagination"><%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %></p>
  66. <% end %>
  67. <% if !@topic.locked? && authorize_for('messages', 'reply') %>
  68. <p><%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %></p>
  69. <div id="reply" style="display:none;">
  70. <%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
  71. <%= render :partial => 'form', :locals => {:f => f, :replying => true} %>
  72. <%= submit_tag l(:button_submit) %>
  73. <%= link_to_remote l(:label_preview),
  74. { :url => { :controller => 'messages', :action => 'preview', :board_id => @board },
  75. :method => 'post',
  76. :update => 'preview',
  77. :with => "Form.serialize('message-form')",
  78. :complete => "Element.scrollTo('preview')"
  79. }, :accesskey => accesskey(:preview) %>
  80. <% end %>
  81. <div id="preview" class="wiki"></div>
  82. </div>
  83. <% end %>
  84. <% content_for :header_tags do %>
  85. <%= stylesheet_link_tag 'scm' %>
  86. <% end %>
  87. <% html_title @topic.subject %>