2006-12-16 15:15:31 +03:00
|
|
|
<div class="contextual">
|
2007-11-06 01:22:51 +03:00
|
|
|
<%= link_to_if_authorized(l(:label_news_new),
|
2008-02-03 17:38:04 +03:00
|
|
|
{:controller => 'news', :action => 'new', :project_id => @project},
|
2007-09-22 21:52:43 +04:00
|
|
|
:class => 'icon icon-add',
|
2009-01-22 19:34:54 +03:00
|
|
|
:onclick => 'Element.show("add-news"); Form.Element.focus("news_title"); return false;') if @project %>
|
2007-09-22 21:52:43 +04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="add-news" style="display:none;">
|
|
|
|
<h2><%=l(:label_news_new)%></h2>
|
2008-02-03 17:38:04 +03:00
|
|
|
<% labelled_tabular_form_for :news, @news, :url => { :controller => 'news', :action => 'new', :project_id => @project },
|
|
|
|
: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) %>
|
2008-02-03 17:38:04 +03:00
|
|
|
<%= link_to_remote l(:label_preview),
|
2008-07-19 11:29:05 +04:00
|
|
|
{ :url => { :controller => 'news', :action => 'preview', :project_id => @project },
|
2008-02-03 17:38:04 +03:00
|
|
|
:method => 'post',
|
|
|
|
: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| %>
|
2007-11-06 01:22:51 +03: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 21:52:43 +04:00
|
|
|
<%= "(#{news.comments_count} #{lwr(:label_comment, news.comments_count).downcase})" 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
|
|
|
|
2008-03-05 11:25:22 +03:00
|
|
|
<p class="other-formats">
|
|
|
|
<%= l(:label_export_to) %>
|
|
|
|
<span><%= link_to 'Atom', {:format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span>
|
|
|
|
</p>
|
|
|
|
|
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})) %>
|
|
|
|
<% end %>
|
2007-12-07 21:42:40 +03:00
|
|
|
|
2008-01-03 01:41:53 +03:00
|
|
|
<% html_title(l(:label_news_plural)) -%>
|