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