annotate app/views/news/show.rhtml @ 904:0a8317a50fa0 redmine-1.1

Close obsolete branch redmine-1.1
author Chris Cannam
date Fri, 14 Jan 2011 12:53:21 +0000
parents af80e5618e9b
children cbce1fd3b1b7
rev   line source
Chris@0 1 <div class="contextual">
Chris@117 2 <%= link_to(l(:button_edit),
Chris@117 3 edit_news_path(@news),
Chris@117 4 :class => 'icon icon-edit',
Chris@117 5 :accesskey => accesskey(:edit),
Chris@117 6 :onclick => 'Element.show("edit-news"); return false;') if User.current.allowed_to?(:manage_news, @project) %>
Chris@117 7 <%= link_to(l(:button_delete),
Chris@117 8 news_path(@news),
Chris@117 9 :confirm => l(:text_are_you_sure),
Chris@117 10 :method => :delete,
Chris@117 11 :class => 'icon icon-del') if User.current.allowed_to?(:manage_news, @project) %>
Chris@0 12 </div>
Chris@0 13
Chris@0 14 <h2><%= avatar(@news.author, :size => "24") %><%=h @news.title %></h2>
Chris@0 15
Chris@0 16 <% if authorize_for('news', 'edit') %>
Chris@0 17 <div id="edit-news" style="display:none;">
chris@37 18 <% labelled_tabular_form_for :news, @news, :url => news_path(@news),
chris@22 19 :html => { :id => 'news-form', :method => :put } do |f| %>
Chris@0 20 <%= render :partial => 'form', :locals => { :f => f } %>
Chris@0 21 <%= submit_tag l(:button_save) %>
Chris@0 22 <%= link_to_remote l(:label_preview),
chris@37 23 { :url => preview_news_path(:project_id => @project),
chris@37 24 :method => 'get',
Chris@0 25 :update => 'preview',
Chris@0 26 :with => "Form.serialize('news-form')"
Chris@0 27 }, :accesskey => accesskey(:preview) %> |
Chris@0 28 <%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("edit-news"); return false;' %>
Chris@0 29 <% end %>
Chris@0 30 <div id="preview" class="wiki"></div>
Chris@0 31 </div>
Chris@0 32 <% end %>
Chris@0 33
Chris@0 34 <p><% unless @news.summary.blank? %><em><%=h @news.summary %></em><br /><% end %>
Chris@0 35 <span class="author"><%= authoring @news.created_on, @news.author %></span></p>
Chris@0 36 <div class="wiki">
Chris@0 37 <%= textilizable(@news.description) %>
Chris@0 38 </div>
Chris@0 39 <br />
Chris@0 40
Chris@0 41 <div id="comments" style="margin-bottom:16px;">
Chris@0 42 <h3 class="comments"><%= l(:label_comment_plural) %></h3>
Chris@0 43 <% @comments.each do |comment| %>
Chris@0 44 <% next if comment.new_record? %>
Chris@0 45 <div class="contextual">
chris@22 46 <%= link_to_if_authorized image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment},
chris@22 47 :confirm => l(:text_are_you_sure), :method => :delete, :title => l(:button_delete) %>
Chris@0 48 </div>
Chris@0 49 <h4><%= avatar(comment.author, :size => "24") %><%= authoring comment.created_on, comment.author %></h4>
Chris@0 50 <%= textilizable(comment.comments) %>
Chris@0 51 <% end if @comments.any? %>
Chris@0 52 </div>
Chris@0 53
chris@22 54 <% if authorize_for 'comments', 'create' %>
Chris@0 55 <p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %></p>
chris@22 56 <% form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %>
Chris@0 57 <div class="box">
Chris@0 58 <%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit' %>
Chris@0 59 <%= wikitoolbar_for 'comment_comments' %>
Chris@0 60 </div>
Chris@0 61 <p><%= submit_tag l(:button_add) %></p>
Chris@0 62 <% end %>
Chris@0 63 <% end %>
Chris@0 64
Chris@0 65 <% html_title @news.title -%>
Chris@0 66
Chris@0 67 <% content_for :header_tags do %>
Chris@0 68 <%= stylesheet_link_tag 'scm' %>
Chris@0 69 <% end %>