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.html.erb 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <div class="contextual">
  2. <%= link_to(l(:label_news_new),
  3. new_project_news_path(@project),
  4. :class => 'icon icon-add',
  5. :onclick => 'Element.show("add-news"); Form.Element.focus("news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %>
  6. </div>
  7. <div id="add-news" style="display:none;">
  8. <h2><%=l(:label_news_new)%></h2>
  9. <%= labelled_form_for @news, :url => project_news_index_path(@project),
  10. :html => { :id => 'news-form', :multipart => true } 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 => preview_news_path(:project_id => @project),
  15. :method => 'get',
  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><%= avatar(news.author, :size => "24") %><%= link_to_project(news.project) + ': ' unless news.project == @project %>
  29. <%= link_to h(news.title), news_path(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. <%= stylesheet_link_tag 'scm' %>
  44. <% end %>
  45. <% html_title(l(:label_news_plural)) -%>