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