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