Mercurial > hg > soundsoftware-site
diff app/controllers/boards_controller.rb @ 1298:4f746d8966dd redmine_2.3_integration
Merge from redmine-2.3 branch to create new branch redmine-2.3-integration
author | Chris Cannam |
---|---|
date | Fri, 14 Jun 2013 09:28:30 +0100 |
parents | 622f24f53b42 |
children |
line wrap: on
line diff
--- a/app/controllers/boards_controller.rb Fri Jun 14 09:07:32 2013 +0100 +++ b/app/controllers/boards_controller.rb Fri Jun 14 09:28:30 2013 +0100 @@ -1,5 +1,5 @@ # Redmine - project management software -# Copyright (C) 2006-2012 Jean-Philippe Lang +# Copyright (C) 2006-2013 Jean-Philippe Lang # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -37,17 +37,17 @@ respond_to do |format| format.html { sort_init 'updated_on', 'desc' - sort_update 'created_on' => "#{Message.table_name}.created_on", + sort_update 'created_on' => "#{Message.table_name}.created_on", 'replies' => "#{Message.table_name}.replies_count", 'updated_on' => "COALESCE(last_replies_messages.created_on, #{Message.table_name}.created_on)" @topic_count = @board.topics.count - @topic_pages = Paginator.new self, @topic_count, per_page_option, params['page'] + @topic_pages = Paginator.new @topic_count, per_page_option, params['page'] @topics = @board.topics. reorder("#{Message.table_name}.sticky DESC"). includes(:last_reply). - limit(@topic_pages.items_per_page). - offset(@topic_pages.current.offset). + limit(@topic_pages.per_page). + offset(@topic_pages.offset). order(sort_clause). preload(:author, {:last_reply => :author}). all @@ -55,9 +55,11 @@ render :action => 'show', :layout => !request.xhr? } format.atom { - @messages = @board.messages.find :all, :order => 'created_on DESC', - :include => [:author, :board], - :limit => Setting.feeds_limit.to_i + @messages = @board.messages. + reorder('created_on DESC'). + includes(:author, :board). + limit(Setting.feeds_limit.to_i). + all render_feed(@messages, :title => "#{@project}: #{@board}") } end @@ -98,7 +100,7 @@ private def redirect_to_settings_in_projects - redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'boards' + redirect_to settings_project_path(@project, :tab => 'boards') end def find_board_if_available