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