index.rhtml
50 lines
| 2.2 KiB
| text/html+ruby
|
RhtmlLexer
|
r90 | <div class="contextual"> | ||
|
r875 | <%= link_to_if_authorized(l(:label_news_new), | ||
|
r1097 | {:controller => 'news', :action => 'new', :project_id => @project}, | ||
|
r739 | :class => 'icon icon-add', | ||
|
r2293 | :onclick => 'Element.show("add-news"); Form.Element.focus("news_title"); return false;') if @project %> | ||
|
r739 | </div> | ||
<div id="add-news" style="display:none;"> | ||||
<h2><%=l(:label_news_new)%></h2> | ||||
|
r1097 | <% labelled_tabular_form_for :news, @news, :url => { :controller => 'news', :action => 'new', :project_id => @project }, | ||
:html => { :id => 'news-form' } do |f| %> | ||||
|
r739 | <%= render :partial => 'news/form', :locals => { :f => f } %> | ||
<%= submit_tag l(:button_create) %> | ||||
|
r1097 | <%= link_to_remote l(:label_preview), | ||
|
r1660 | { :url => { :controller => 'news', :action => 'preview', :project_id => @project }, | ||
|
r1097 | :method => 'post', | ||
:update => 'preview', | ||||
:with => "Form.serialize('news-form')" | ||||
}, :accesskey => accesskey(:preview) %> | | ||||
|
r739 | <%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-news")' %> | ||
|
r875 | <% end if @project %> | ||
|
r1097 | <div id="preview" class="wiki"></div> | ||
|
r90 | </div> | ||
|
r12 | <h2><%=l(:label_news_plural)%></h2> | ||
|
r2 | |||
|
r739 | <% if @newss.empty? %> | ||
|
r736 | <p class="nodata"><%= l(:label_no_data) %></p> | ||
|
r739 | <% else %> | ||
<% @newss.each do |news| %> | ||||
|
r3810 | <h3><%= link_to_project(news.project) + ': ' unless news.project == @project %> | ||
|
r875 | <%= link_to h(news.title), :controller => 'news', :action => 'show', :id => news %> | ||
|
r2430 | <%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %></h3> | ||
|
r786 | <p class="author"><%= authoring news.created_on, news.author %></p> | ||
|
r1045 | <div class="wiki"> | ||
|
r739 | <%= textilizable(news.description) %> | ||
|
r1045 | </div> | ||
|
r739 | <% end %> | ||
|
r736 | <% end %> | ||
|
r1013 | <p class="pagination"><%= pagination_links_full @news_pages %></p> | ||
|
r663 | |||
|
r2331 | <% other_formats_links do |f| %> | ||
<%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %> | ||||
<% end %> | ||||
|
r1171 | |||
|
r663 | <% content_for :header_tags do %> | ||
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %> | ||||
<% end %> | ||||
|
r951 | |||
|
r1019 | <% html_title(l(:label_news_plural)) -%> | ||