annotate app/views/news/show.rhtml @ 871:d6c20f61a130 feature_128

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