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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <%= board_breadcrumb(@message) %>
  2. <div class="contextual">
  3. <%= watcher_link(@topic, User.current) %>
  4. <%= link_to(
  5. l(:button_quote),
  6. {:action => 'quote', :id => @topic},
  7. :method => 'get',
  8. :class => 'icon icon-comment',
  9. :remote => true) if !@topic.locked? && authorize_for('messages', 'reply') %>
  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. :data => {: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) %><%= @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, :thumbnails => true %>
  30. </div>
  31. <br />
  32. <% unless @replies.empty? %>
  33. <div id="replies">
  34. <h3 class="comments icon icon-comments"><%= l(:label_reply_plural) %> (<%= @reply_count %>)</h3>
  35. <% if !@topic.locked? && authorize_for('messages', 'reply') && @replies.size >= 3 %>
  36. <p><%= toggle_link l(:button_reply), "reply", :focus => 'message_content', :scroll => "message_content" %></p>
  37. <% end %>
  38. <% @replies.each do |message| %>
  39. <div class="message reply" id="<%= "message-#{message.id}" %>">
  40. <div class="contextual">
  41. <%= link_to(
  42. '',
  43. {:action => 'quote', :id => message},
  44. :remote => true,
  45. :method => 'get',
  46. :title => l(:button_quote),
  47. :class => 'icon icon-comment'
  48. ) if !@topic.locked? && authorize_for('messages', 'reply') %>
  49. <%= link_to(
  50. '',
  51. {:action => 'edit', :id => message},
  52. :title => l(:button_edit),
  53. :class => 'icon icon-edit'
  54. ) if message.editable_by?(User.current) %>
  55. <%= link_to(
  56. '',
  57. {:action => 'destroy', :id => message},
  58. :method => :post,
  59. :data => {:confirm => l(:text_are_you_sure)},
  60. :title => l(:button_delete),
  61. :class => 'icon icon-del'
  62. ) if message.destroyable_by?(User.current) %>
  63. </div>
  64. <h4 class='reply-header'>
  65. <%= avatar(message.author) %>
  66. <%= link_to message.subject, { :controller => 'messages', :action => 'show', :board_id => @board, :id => @topic, :r => message, :anchor => "message-#{message.id}" } %>
  67. -
  68. <%= authoring message.created_on, message.author %>
  69. </h4>
  70. <div class="wiki"><%= textilizable message, :content, :attachments => message.attachments %></div>
  71. <%= link_to_attachments message, :author => false, :thumbnails => true %>
  72. </div>
  73. <% end %>
  74. </div>
  75. <span class="pagination"><%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %></span>
  76. <% end %>
  77. <% if !@topic.locked? && authorize_for('messages', 'reply') %>
  78. <p><%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %></p>
  79. <div id="reply" style="display:none;">
  80. <%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
  81. <%= render :partial => 'form', :locals => {:f => f, :replying => true} %>
  82. <%= submit_tag l(:button_submit) %>
  83. <% end %>
  84. </div>
  85. <% end %>
  86. <% html_title @topic.subject %>