To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / app / views / news / show.html.erb @ 912:5e80956cc792

History | View | Annotate | Download (2.89 KB)

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