2006-12-16 12:15:31 +00:00
|
|
|
<div class="contextual">
|
2007-11-05 22:22:51 +00:00
|
|
|
<%= link_to_if_authorized(l(:label_news_new),
|
2007-09-22 17:52:43 +00:00
|
|
|
{:controller => 'projects', :action => 'add_news', :id => @project},
|
|
|
|
:class => 'icon icon-add',
|
2007-11-05 22:22:51 +00:00
|
|
|
:onclick => 'Element.show("add-news"); return false;') if @project %>
|
2007-09-22 17:52:43 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="add-news" style="display:none;">
|
|
|
|
<h2><%=l(:label_news_new)%></h2>
|
2007-11-05 22:22:51 +00:00
|
|
|
<% labelled_tabular_form_for :news, @news, :url => { :controller => 'projects', :action => "add_news", :id => @project } do |f| %>
|
2007-09-22 17:52:43 +00:00
|
|
|
<%= render :partial => 'news/form', :locals => { :f => f } %>
|
|
|
|
<%= submit_tag l(:button_create) %>
|
|
|
|
<%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-news")' %>
|
2007-11-05 22:22:51 +00:00
|
|
|
<% end if @project %>
|
2006-12-16 12:15:31 +00:00
|
|
|
</div>
|
|
|
|
|
2006-07-29 19:54:22 +00:00
|
|
|
<h2><%=l(:label_news_plural)%></h2>
|
2006-06-28 18:11:03 +00:00
|
|
|
|
2007-09-22 17:52:43 +00:00
|
|
|
<% if @newss.empty? %>
|
2007-09-22 13:17:49 +00:00
|
|
|
<p class="nodata"><%= l(:label_no_data) %></p>
|
2007-09-22 17:52:43 +00:00
|
|
|
<% else %>
|
|
|
|
<% @newss.each do |news| %>
|
2007-11-05 22:22:51 +00:00
|
|
|
<h3><%= link_to(h(news.project.name), :controller => 'projects', :action => 'show', :id => news.project) + ': ' unless news.project == @project %>
|
|
|
|
<%= link_to h(news.title), :controller => 'news', :action => 'show', :id => news %>
|
2007-09-22 17:52:43 +00:00
|
|
|
<%= "(#{news.comments_count} #{lwr(:label_comment, news.comments_count).downcase})" if news.comments_count > 0 %></h3>
|
2007-10-03 18:43:38 +00:00
|
|
|
<p class="author"><%= authoring news.created_on, news.author %></p>
|
2007-09-22 17:52:43 +00:00
|
|
|
<%= textilizable(news.description) %>
|
|
|
|
<% end %>
|
2007-09-22 13:17:49 +00:00
|
|
|
<% end %>
|
2007-12-29 11:36:30 +00:00
|
|
|
<p class="pagination"><%= pagination_links_full @news_pages %></p>
|
2007-08-29 16:52:35 +00:00
|
|
|
|
|
|
|
<% content_for :header_tags do %>
|
|
|
|
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
|
|
|
|
<% end %>
|
2007-12-07 18:42:40 +00:00
|
|
|
|
|
|
|
<% set_html_title l(:label_news_plural) -%>
|