Defect #5933 » news.patch
| app/controllers/news_controller.rb (working copy) | ||
|---|---|---|
|
accept_key_auth :index
|
||
|
|
||
|
def index
|
||
|
@with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1')
|
||
|
@news_pages, @newss = paginate :news,
|
||
|
:per_page => 10,
|
||
|
:conditions => Project.allowed_to_condition(User.current, :view_news, :project => @project),
|
||
|
:conditions => Project.allowed_to_condition(User.current, :view_news, :project => @project, :with_subprojects => @with_subprojects),
|
||
|
:include => [:author, :project],
|
||
|
:order => "#{News.table_name}.created_on DESC"
|
||
|
respond_to do |format|
|
||
| app/controllers/projects_controller.rb (working copy) | ||
|---|---|---|
|
|
||
|
@users_by_role = @project.users_by_role
|
||
|
@subprojects = @project.children.visible
|
||
|
@news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "#{News.table_name}.created_on DESC")
|
||
|
@news = News.all(:conditions => Project.allowed_to_condition(User.current, :view_news, :project => @project,
|
||
|
:with_subprojects => Setting.display_subprojects_issues?),
|
||
|
:limit => 5,
|
||
|
:include => [:author, :project],
|
||
|
:order => "#{News.table_name}.created_on DESC")
|
||
|
@trackers = @project.rolled_up_trackers
|
||
|
|
||
|
cond = @project.project_condition(Setting.display_subprojects_issues?)
|
||
| app/views/news/_news.rhtml (working copy) | ||
|---|---|---|
|
<p><%= link_to(h(news.project.name), :controller => 'projects', :action => 'show', :id => news.project) + ': ' unless @project %>
|
||
|
<p><%= 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 %>
|
||
|
<%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %>
|
||
|
<br />
|
||
| app/views/news/index.rhtml (working copy) | ||
|---|---|---|
|
<%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %>
|
||
|
<% end %>
|
||
|
<% content_for :sidebar do %>
|
||
|
<% form_tag({:project_id => @project}, :method => :get) do %>
|
||
|
<h3><%= l(:label_news) %></h3>
|
||
|
<%= hidden_field_tag 'with_subprojects', 0 %>
|
||
|
<br /><label><%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%></label>
|
||
|
<p><%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %></p>
|
||
|
<% end %>
|
||
|
<% end if @project && @project.descendants.active.any? %>
|
||
|
<% content_for :header_tags do %>
|
||
|
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
|
||
|
<% end %>
|
||
- « Previous
- 1
- 2
- 3
- 4
- Next »