Moved ProjectsController#list_news to NewsController#index.
[gitredmine.git] / app / views / news / index.rhtml
bloba956f86d04bb2837c813ddce5f563df01d2c01f4
1 <div class="contextual">
2 <%= link_to_if_authorized(l(:label_news_new),
3                           {:controller => 'projects', :action => 'add_news', :id => @project},
4                           :class => 'icon icon-add',
5                           :onclick => 'Element.show("add-news"); return false;') if @project %>
6 </div>
8 <div id="add-news" style="display:none;">
9 <h2><%=l(:label_news_new)%></h2>
10 <% labelled_tabular_form_for :news, @news, :url => { :controller => 'projects', :action => "add_news", :id => @project } do |f| %>
11 <%= render :partial => 'news/form', :locals => { :f => f } %>
12 <%= submit_tag l(:button_create) %>
13 <%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-news")' %>
14 <% end if @project %>
15 </div>
17 <h2><%=l(:label_news_plural)%></h2>
19 <% if @newss.empty? %>
20 <p class="nodata"><%= l(:label_no_data) %></p>
21 <% else %>
22 <% @newss.each do |news| %>
23     <h3><%= link_to(h(news.project.name), :controller => 'projects', :action => 'show', :id => news.project) + ': ' unless news.project == @project %>
24     <%= link_to h(news.title), :controller => 'news', :action => 'show', :id => news %>
25     <%= "(#{news.comments_count} #{lwr(:label_comment, news.comments_count).downcase})" if news.comments_count > 0 %></h3>
26     <p class="author"><%= authoring news.created_on, news.author %></p>
27     <%= textilizable(news.description) %>
28 <% end %>
29 <% end %>
30 <%= pagination_links_full @news_pages %>
32 <% content_for :header_tags do %>
33   <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
34 <% end %>