##// END OF EJS Templates
Use #blank? instead of #empty? in news/show view....
Jean-Philippe Lang -
r1292:5ccbeba5c2fe
parent child
Show More
@@ -1,57 +1,57
1 <div class="contextual">
1 <div class="contextual">
2 <%= link_to_if_authorized l(:button_edit),
2 <%= link_to_if_authorized l(:button_edit),
3 {:controller => 'news', :action => 'edit', :id => @news},
3 {:controller => 'news', :action => 'edit', :id => @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;' %>
7 <%= link_to_if_authorized l(:button_delete), {:controller => 'news', :action => 'destroy', :id => @news}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
7 <%= link_to_if_authorized l(:button_delete), {:controller => 'news', :action => 'destroy', :id => @news}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
8 </div>
8 </div>
9
9
10 <h2><%=h @news.title %></h2>
10 <h2><%=h @news.title %></h2>
11
11
12 <div id="edit-news" style="display:none;">
12 <div id="edit-news" style="display:none;">
13 <% labelled_tabular_form_for :news, @news, :url => { :action => "edit", :id => @news },
13 <% labelled_tabular_form_for :news, @news, :url => { :action => "edit", :id => @news },
14 :html => { :id => 'news-form' } do |f| %>
14 :html => { :id => 'news-form' } do |f| %>
15 <%= render :partial => 'form', :locals => { :f => f } %>
15 <%= render :partial => 'form', :locals => { :f => f } %>
16 <%= submit_tag l(:button_save) %>
16 <%= submit_tag l(:button_save) %>
17 <%= link_to_remote l(:label_preview),
17 <%= link_to_remote l(:label_preview),
18 { :url => { :controller => 'news', :action => 'preview' },
18 { :url => { :controller => 'news', :action => 'preview' },
19 :method => 'post',
19 :method => 'post',
20 :update => 'preview',
20 :update => 'preview',
21 :with => "Form.serialize('news-form')"
21 :with => "Form.serialize('news-form')"
22 }, :accesskey => accesskey(:preview) %> |
22 }, :accesskey => accesskey(:preview) %> |
23 <%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("edit-news")' %>
23 <%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("edit-news")' %>
24 <% end %>
24 <% end %>
25 <div id="preview" class="wiki"></div>
25 <div id="preview" class="wiki"></div>
26 </div>
26 </div>
27
27
28 <p><em><% unless @news.summary.empty? %><%=h @news.summary %><br /><% end %>
28 <p><em><% unless @news.summary.blank? %><%=h @news.summary %><br /><% end %>
29 <span class="author"><%= authoring @news.created_on, @news.author %></span></em></p>
29 <span class="author"><%= authoring @news.created_on, @news.author %></span></em></p>
30 <div class="wiki">
30 <div class="wiki">
31 <%= textilizable(@news.description) %>
31 <%= textilizable(@news.description) %>
32 </div>
32 </div>
33 <br />
33 <br />
34
34
35 <div id="comments" style="margin-bottom:16px;">
35 <div id="comments" style="margin-bottom:16px;">
36 <h3 class="icon22 icon22-comment"><%= l(:label_comment_plural) %></h3>
36 <h3 class="icon22 icon22-comment"><%= l(:label_comment_plural) %></h3>
37 <% @comments.each do |comment| %>
37 <% @comments.each do |comment| %>
38 <% next if comment.new_record? %>
38 <% next if comment.new_record? %>
39 <div class="contextual">
39 <div class="contextual">
40 <%= link_to_if_authorized image_tag('delete.png'), {:controller => 'news', :action => 'destroy_comment', :id => @news, :comment_id => comment},
40 <%= link_to_if_authorized image_tag('delete.png'), {:controller => 'news', :action => 'destroy_comment', :id => @news, :comment_id => comment},
41 :confirm => l(:text_are_you_sure), :method => :post, :title => l(:button_delete) %>
41 :confirm => l(:text_are_you_sure), :method => :post, :title => l(:button_delete) %>
42 </div>
42 </div>
43 <h4><%= authoring comment.created_on, comment.author %></h4>
43 <h4><%= authoring comment.created_on, comment.author %></h4>
44 <%= textilizable(comment.comments) %>
44 <%= textilizable(comment.comments) %>
45 <% end if @comments.any? %>
45 <% end if @comments.any? %>
46 </div>
46 </div>
47
47
48 <% if authorize_for 'news', 'add_comment' %>
48 <% if authorize_for 'news', 'add_comment' %>
49 <p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %></p>
49 <p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %></p>
50 <% form_tag({:action => 'add_comment', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %>
50 <% form_tag({:action => 'add_comment', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %>
51 <%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit' %>
51 <%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit' %>
52 <%= wikitoolbar_for 'comment_comments' %>
52 <%= wikitoolbar_for 'comment_comments' %>
53 <p><%= submit_tag l(:button_add) %></p>
53 <p><%= submit_tag l(:button_add) %></p>
54 <% end %>
54 <% end %>
55 <% end %>
55 <% end %>
56
56
57 <% html_title @news.title -%>
57 <% html_title @news.title -%>
General Comments 0
You need to be logged in to leave comments. Login now