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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <div class="contextual">
  2. <%= watcher_link(@news, User.current) %>
  3. <%= link_to(l(:button_edit),
  4. edit_news_path(@news),
  5. :class => 'icon icon-edit',
  6. :accesskey => accesskey(:edit),
  7. :onclick => '$("#edit-news").show(); return false;') if User.current.allowed_to?(:manage_news, @project) %>
  8. <%= delete_link news_path(@news) if User.current.allowed_to?(:manage_news, @project) %>
  9. </div>
  10. <h2><%= avatar(@news.author) %> <%=h @news.title %></h2>
  11. <% if authorize_for('news', 'edit') %>
  12. <div id="edit-news" style="display:none;">
  13. <%= labelled_form_for :news, @news, :url => news_path(@news),
  14. :html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %>
  15. <%= render :partial => 'form', :locals => { :f => f } %>
  16. <%= submit_tag l(:button_save) %>
  17. <%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;' %>
  18. <% end %>
  19. </div>
  20. <% end %>
  21. <p><% unless @news.summary.blank? %><em><%= @news.summary %></em><br /><% end %>
  22. <span class="author"><%= authoring @news.created_on, @news.author %></span></p>
  23. <div class="wiki">
  24. <%= textilizable(@news, :description) %>
  25. </div>
  26. <%= link_to_attachments @news %>
  27. <br />
  28. <div id="comments" style="margin-bottom:16px;">
  29. <h3 class="comments"><%= l(:label_comment_plural) %></h3>
  30. <% if @news.commentable? && @comments.size >= 3 %>
  31. <p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments", :scroll => "comment_comments" %></p>
  32. <% end %>
  33. <% @comments.each do |comment| %>
  34. <% next if comment.new_record? %>
  35. <div class="contextual">
  36. <%= link_to_if_authorized l(:button_delete), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment},
  37. :data => {:confirm => l(:text_are_you_sure)}, :method => :delete,
  38. :title => l(:button_delete),
  39. :class => 'icon-only icon-del' %>
  40. </div>
  41. <h4><%= avatar(comment.author) %><%= authoring comment.created_on, comment.author %></h4>
  42. <div class="wiki">
  43. <%= textilizable(comment.comments) %>
  44. </div>
  45. <% end if @comments.any? %>
  46. </div>
  47. <% if @news.commentable? %>
  48. <p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %></p>
  49. <%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %>
  50. <div class="box">
  51. <%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit',
  52. :data => {
  53. :auto_complete => true
  54. }
  55. %>
  56. <%= wikitoolbar_for 'comment_comments', preview_news_path(:project_id => @project, :id => @news) %>
  57. </div>
  58. <p><%= submit_tag l(:button_add) %></p>
  59. <% end %>
  60. <% end %>
  61. <% html_title @news.title -%>
  62. <% content_for :header_tags do %>
  63. <%= stylesheet_link_tag 'scm' %>
  64. <% end %>