annotate app/views/news/show.rhtml @ 507:0c939c159af4 redmine-1.2

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