You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.rhtml 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <div class="contextual">
  2. <%= link_to_if_authorized(l(:label_news_new),
  3. {:controller => 'news', :action => 'new', :project_id => @project},
  4. :class => 'icon icon-add',
  5. :onclick => 'Element.show("add-news"); Form.Element.focus("news_title"); return false;') if @project %>
  6. </div>
  7. <div id="add-news" style="display:none;">
  8. <h2><%=l(:label_news_new)%></h2>
  9. <% labelled_tabular_form_for :news, @news, :url => { :controller => 'news', :action => 'new', :project_id => @project },
  10. :html => { :id => 'news-form' } do |f| %>
  11. <%= render :partial => 'news/form', :locals => { :f => f } %>
  12. <%= submit_tag l(:button_create) %>
  13. <%= link_to_remote l(:label_preview),
  14. { :url => { :controller => 'news', :action => 'preview', :project_id => @project },
  15. :method => 'post',
  16. :update => 'preview',
  17. :with => "Form.serialize('news-form')"
  18. }, :accesskey => accesskey(:preview) %> |
  19. <%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-news")' %>
  20. <% end if @project %>
  21. <div id="preview" class="wiki"></div>
  22. </div>
  23. <h2><%=l(:label_news_plural)%></h2>
  24. <% if @newss.empty? %>
  25. <p class="nodata"><%= l(:label_no_data) %></p>
  26. <% else %>
  27. <% @newss.each do |news| %>
  28. <h3><%= link_to(h(news.project.name), :controller => 'projects', :action => 'show', :id => news.project) + ': ' unless news.project == @project %>
  29. <%= link_to h(news.title), :controller => 'news', :action => 'show', :id => news %>
  30. <%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %></h3>
  31. <p class="author"><%= authoring news.created_on, news.author %></p>
  32. <div class="wiki">
  33. <%= textilizable(news.description) %>
  34. </div>
  35. <% end %>
  36. <% end %>
  37. <p class="pagination"><%= pagination_links_full @news_pages %></p>
  38. <% other_formats_links do |f| %>
  39. <%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %>
  40. <% end %>
  41. <% content_for :header_tags do %>
  42. <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
  43. <% end %>
  44. <% html_title(l(:label_news_plural)) -%>