To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / app / views / news / show.html.erb @ 1298:4f746d8966dd
History | View | Annotate | Download (2.59 KB)
| 1 | 0:513646585e45 | Chris | <div class="contextual"> |
|---|---|---|---|
| 2 | 1295:622f24f53b42 | Chris | <%= watcher_link(@news, User.current) %>
|
| 3 | 909:cbb26bc654de | Chris | <%= link_to(l(:button_edit),
|
| 4 | 119:8661b858af72 | Chris | edit_news_path(@news),
|
| 5 | :class => 'icon icon-edit',
|
||
| 6 | :accesskey => accesskey(:edit),
|
||
| 7 | 1115:433d4f72a19b | Chris | :onclick => '$("#edit-news").show(); return false;') if User.current.allowed_to?(:manage_news, @project) %>
|
| 8 | <%= delete_link news_path(@news) if User.current.allowed_to?(:manage_news, @project) %>
|
||
| 9 | 0:513646585e45 | Chris | </div>
|
| 10 | |||
| 11 | <h2><%= avatar(@news.author, :size => "24") %><%=h @news.title %></h2> |
||
| 12 | |||
| 13 | <% if authorize_for('news', 'edit') %>
|
||
| 14 | <div id="edit-news" style="display:none;"> |
||
| 15 | 1115:433d4f72a19b | Chris | <%= labelled_form_for :news, @news, :url => news_path(@news),
|
| 16 | :html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %>
|
||
| 17 | 0:513646585e45 | Chris | <%= render :partial => 'form', :locals => { :f => f } %>
|
| 18 | <%= submit_tag l(:button_save) %>
|
||
| 19 | 1115:433d4f72a19b | Chris | <%= preview_link preview_news_path(:project_id => @project, :id => @news), 'news-form' %> |
|
| 20 | <%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;' %>
|
||
| 21 | 0:513646585e45 | Chris | <% end %>
|
| 22 | <div id="preview" class="wiki"></div> |
||
| 23 | </div>
|
||
| 24 | <% end %>
|
||
| 25 | |||
| 26 | <p><% unless @news.summary.blank? %><em><%=h @news.summary %></em><br /><% end %> |
||
| 27 | <span class="author"><%= authoring @news.created_on, @news.author %></span></p> |
||
| 28 | <div class="wiki"> |
||
| 29 | 1115:433d4f72a19b | Chris | <%= textilizable(@news, :description) %>
|
| 30 | 0:513646585e45 | Chris | </div>
|
| 31 | 1115:433d4f72a19b | Chris | <%= link_to_attachments @news %>
|
| 32 | 0:513646585e45 | Chris | <br /> |
| 33 | |||
| 34 | <div id="comments" style="margin-bottom:16px;"> |
||
| 35 | <h3 class="comments"><%= l(:label_comment_plural) %></h3> |
||
| 36 | <% @comments.each do |comment| %>
|
||
| 37 | <% next if comment.new_record? %>
|
||
| 38 | <div class="contextual"> |
||
| 39 | 22:40f7cfd4df19 | chris | <%= link_to_if_authorized image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment},
|
| 40 | 1115:433d4f72a19b | Chris | :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %>
|
| 41 | 0:513646585e45 | Chris | </div>
|
| 42 | <h4><%= avatar(comment.author, :size => "24") %><%= authoring comment.created_on, comment.author %></h4> |
||
| 43 | <%= textilizable(comment.comments) %>
|
||
| 44 | <% end if @comments.any? %>
|
||
| 45 | </div>
|
||
| 46 | |||
| 47 | 1115:433d4f72a19b | Chris | <% if @news.commentable? %>
|
| 48 | 0:513646585e45 | Chris | <p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %></p> |
| 49 | 1115:433d4f72a19b | Chris | <%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %>
|
| 50 | 0:513646585e45 | Chris | <div class="box"> |
| 51 | <%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit' %>
|
||
| 52 | <%= wikitoolbar_for 'comment_comments' %>
|
||
| 53 | </div>
|
||
| 54 | <p><%= submit_tag l(:button_add) %></p> |
||
| 55 | <% end %>
|
||
| 56 | <% end %>
|
||
| 57 | |||
| 58 | <% html_title @news.title -%>
|
||
| 59 | |||
| 60 | <% content_for :header_tags do %>
|
||
| 61 | <%= stylesheet_link_tag 'scm' %>
|
||
| 62 | <% end %> |