2006-12-16 13:15:31 +01:00
|
|
|
<div class="contextual">
|
2010-10-22 16:42:38 +02:00
|
|
|
<%= link_to(l(:label_news_new),
|
|
|
|
new_project_news_path(@project),
|
|
|
|
:class => 'icon icon-add',
|
|
|
|
:onclick => 'Element.show("add-news"); Form.Element.focus("news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %>
|
2007-09-22 19:52:43 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="add-news" style="display:none;">
|
|
|
|
<h2><%=l(:label_news_new)%></h2>
|
2011-12-09 19:15:55 +01:00
|
|
|
<% labelled_form_for @news, :url => project_news_index_path(@project),
|
2012-01-29 23:39:06 +01:00
|
|
|
:html => { :id => 'news-form', :multipart => true } do |f| %>
|
2007-09-22 19:52:43 +02:00
|
|
|
<%= render :partial => 'news/form', :locals => { :f => f } %>
|
|
|
|
<%= submit_tag l(:button_create) %>
|
2011-09-17 04:52:10 +02:00
|
|
|
<%= link_to_remote l(:label_preview),
|
2010-09-27 18:51:12 +02:00
|
|
|
{ :url => preview_news_path(:project_id => @project),
|
2010-09-24 18:26:46 +02:00
|
|
|
:method => 'get',
|
2008-02-03 15:38:04 +01:00
|
|
|
:update => 'preview',
|
|
|
|
:with => "Form.serialize('news-form')"
|
|
|
|
}, :accesskey => accesskey(:preview) %> |
|
2007-09-22 19:52:43 +02:00
|
|
|
<%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-news")' %>
|
2007-11-05 23:22:51 +01:00
|
|
|
<% end if @project %>
|
2008-02-03 15:38:04 +01:00
|
|
|
<div id="preview" class="wiki"></div>
|
2006-12-16 13:15:31 +01:00
|
|
|
</div>
|
|
|
|
|
2006-07-29 21:54:22 +02:00
|
|
|
<h2><%=l(:label_news_plural)%></h2>
|
2006-06-28 20:11:03 +02:00
|
|
|
|
2007-09-22 19:52:43 +02:00
|
|
|
<% if @newss.empty? %>
|
2007-09-22 15:17:49 +02:00
|
|
|
<p class="nodata"><%= l(:label_no_data) %></p>
|
2007-09-22 19:52:43 +02:00
|
|
|
<% else %>
|
|
|
|
<% @newss.each do |news| %>
|
2011-10-26 01:43:27 +02:00
|
|
|
<h3><%= avatar(news.author, :size => "24") %><%= link_to_project(news.project) + ': ' unless news.project == @project %>
|
2010-09-27 18:51:12 +02:00
|
|
|
<%= link_to h(news.title), news_path(news) %>
|
2009-02-21 12:04:50 +01:00
|
|
|
<%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %></h3>
|
2007-10-03 20:43:38 +02:00
|
|
|
<p class="author"><%= authoring news.created_on, news.author %></p>
|
2008-01-12 17:26:37 +01:00
|
|
|
<div class="wiki">
|
2012-01-29 23:42:12 +01:00
|
|
|
<%= textilizable(news, :description) %>
|
2008-01-12 17:26:37 +01:00
|
|
|
</div>
|
2007-09-22 19:52:43 +02:00
|
|
|
<% end %>
|
2007-09-22 15:17:49 +02:00
|
|
|
<% end %>
|
2007-12-29 12:36:30 +01:00
|
|
|
<p class="pagination"><%= pagination_links_full @news_pages %></p>
|
2007-08-29 18:52:35 +02:00
|
|
|
|
2009-01-29 14:53:17 +01:00
|
|
|
<% other_formats_links do |f| %>
|
2011-09-18 01:01:23 +02:00
|
|
|
<%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %>
|
2009-01-29 14:53:17 +01:00
|
|
|
<% end %>
|
2008-03-05 09:25:22 +01:00
|
|
|
|
2007-08-29 18:52:35 +02:00
|
|
|
<% content_for :header_tags do %>
|
|
|
|
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
|
2010-09-20 04:55:37 +02:00
|
|
|
<%= stylesheet_link_tag 'scm' %>
|
2007-08-29 18:52:35 +02:00
|
|
|
<% end %>
|
2007-12-07 19:42:40 +01:00
|
|
|
|
2008-01-02 23:41:53 +01:00
|
|
|
<% html_title(l(:label_news_plural)) -%>
|