show.rhtml
65 lines
| 2.8 KiB
| text/html+ruby
|
RhtmlLexer
|
r330 | <div class="contextual"> | ||
|
r739 | <%= link_to_if_authorized l(:button_edit), | ||
{:controller => 'news', :action => 'edit', :id => @news}, | ||||
:class => 'icon icon-edit', | ||||
|
r793 | :accesskey => accesskey(:edit), | ||
|
r739 | :onclick => 'Element.show("edit-news"); return false;' %> | ||
|
r330 | <%= 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' %> | ||
</div> | ||||
<h2><%=h @news.title %></h2> | ||||
|
r2840 | <% if authorize_for('news', 'edit') %> | ||
|
r739 | <div id="edit-news" style="display:none;"> | ||
|
r1097 | <% labelled_tabular_form_for :news, @news, :url => { :action => "edit", :id => @news }, | ||
:html => { :id => 'news-form' } do |f| %> | ||||
|
r739 | <%= render :partial => 'form', :locals => { :f => f } %> | ||
<%= submit_tag l(:button_save) %> | ||||
|
r1097 | <%= link_to_remote l(:label_preview), | ||
|
r1660 | { :url => { :controller => 'news', :action => 'preview', :project_id => @project }, | ||
|
r1097 | :method => 'post', | ||
:update => 'preview', | ||||
:with => "Form.serialize('news-form')" | ||||
}, :accesskey => accesskey(:preview) %> | | ||||
|
r2840 | <%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("edit-news"); return false;' %> | ||
|
r739 | <% end %> | ||
|
r1097 | <div id="preview" class="wiki"></div> | ||
|
r739 | </div> | ||
|
r2840 | <% end %> | ||
|
r739 | |||
|
r1292 | <p><em><% unless @news.summary.blank? %><%=h @news.summary %><br /><% end %> | ||
|
r721 | <span class="author"><%= authoring @news.created_on, @news.author %></span></em></p> | ||
|
r1045 | <div class="wiki"> | ||
|
r452 | <%= textilizable(@news.description) %> | ||
|
r1045 | </div> | ||
|
r330 | <br /> | ||
<div id="comments" style="margin-bottom:16px;"> | ||||
|
r3065 | <h3 class="comments"><%= l(:label_comment_plural) %></h3> | ||
|
r1183 | <% @comments.each do |comment| %> | ||
|
r330 | <% next if comment.new_record? %> | ||
<div class="contextual"> | ||||
|
r1183 | <%= link_to_if_authorized image_tag('delete.png'), {:controller => 'news', :action => 'destroy_comment', :id => @news, :comment_id => comment}, | ||
:confirm => l(:text_are_you_sure), :method => :post, :title => l(:button_delete) %> | ||||
|
r330 | </div> | ||
|
r1183 | <h4><%= authoring comment.created_on, comment.author %></h4> | ||
|
r973 | <%= textilizable(comment.comments) %> | ||
|
r1183 | <% end if @comments.any? %> | ||
|
r330 | </div> | ||
<% if authorize_for 'news', 'add_comment' %> | ||||
|
r476 | <p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %></p> | ||
|
r429 | <% form_tag({:action => 'add_comment', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %> | ||
|
r2351 | <div class="box"> | ||
<%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit' %> | ||||
<%= wikitoolbar_for 'comment_comments' %> | ||||
</div> | ||||
|
r429 | <p><%= submit_tag l(:button_add) %></p> | ||
|
r330 | <% end %> | ||
|
r591 | <% end %> | ||
|
r951 | |||
|
r1019 | <% html_title @news.title -%> | ||
|
r1548 | |||
<% content_for :header_tags do %> | ||||
<%= stylesheet_link_tag 'scm' %> | ||||
<% end %> | ||||