To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / app / views / news / index.html.erb @ 912:5e80956cc792
History | View | Annotate | Download (2.1 KB)
| 1 | 0:513646585e45 | Chris | <div class="contextual"> |
|---|---|---|---|
| 2 | 37:94944d00e43c | chris | <%= 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 | 0:513646585e45 | Chris | </div>
|
| 7 | |||
| 8 | <div id="add-news" style="display:none;"> |
||
| 9 | <h2><%=l(:label_news_new)%></h2> |
||
| 10 | 909:cbb26bc654de | Chris | <% labelled_tabular_form_for @news, :url => project_news_index_path(@project),
|
| 11 | 0:513646585e45 | Chris | :html => { :id => 'news-form' } do |f| %>
|
| 12 | <%= render :partial => 'news/form', :locals => { :f => f } %>
|
||
| 13 | <%= submit_tag l(:button_create) %>
|
||
| 14 | 909:cbb26bc654de | Chris | <%= link_to_remote l(:label_preview),
|
| 15 | 37:94944d00e43c | chris | { :url => preview_news_path(:project_id => @project),
|
| 16 | :method => 'get',
|
||
| 17 | 0:513646585e45 | Chris | :update => 'preview',
|
| 18 | :with => "Form.serialize('news-form')"
|
||
| 19 | }, :accesskey => accesskey(:preview) %> |
|
||
| 20 | <%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-news")' %>
|
||
| 21 | <% end if @project %>
|
||
| 22 | <div id="preview" class="wiki"></div> |
||
| 23 | </div>
|
||
| 24 | |||
| 25 | <h2><%=l(:label_news_plural)%></h2> |
||
| 26 | |||
| 27 | <% if @newss.empty? %>
|
||
| 28 | <p class="nodata"><%= l(:label_no_data) %></p> |
||
| 29 | <% else %>
|
||
| 30 | <% @newss.each do |news| %>
|
||
| 31 | 909:cbb26bc654de | Chris | <h3><%= avatar(news.author, :size => "24") %><%= link_to_project(news.project) + ': ' unless news.project == @project %> |
| 32 | 37:94944d00e43c | chris | <%= link_to h(news.title), news_path(news) %>
|
| 33 | 0:513646585e45 | Chris | <%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %></h3> |
| 34 | <p class="author"><%= authoring news.created_on, news.author %></p> |
||
| 35 | <div class="wiki"> |
||
| 36 | <%= textilizable(news.description) %>
|
||
| 37 | </div>
|
||
| 38 | <% end %>
|
||
| 39 | <% end %>
|
||
| 40 | <p class="pagination"><%= pagination_links_full @news_pages %></p> |
||
| 41 | |||
| 42 | <% other_formats_links do |f| %>
|
||
| 43 | 909:cbb26bc654de | Chris | <%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %>
|
| 44 | 0:513646585e45 | Chris | <% end %>
|
| 45 | |||
| 46 | <% content_for :header_tags do %>
|
||
| 47 | <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
|
||
| 48 | 22:40f7cfd4df19 | chris | <%= stylesheet_link_tag 'scm' %>
|
| 49 | 0:513646585e45 | Chris | <% end %>
|
| 50 | |||
| 51 | <% html_title(l(:label_news_plural)) -%> |