mirror of
https://github.com/redmine/redmine.git
synced 2024-09-13 15:45:44 +02:00
remove trailing white-spaces from app/controllers/news_controller.rb.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6809 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
44ea52dac3
commit
239bc3c795
@ -5,12 +5,12 @@
|
|||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
@ -25,9 +25,9 @@ class NewsController < ApplicationController
|
|||||||
before_filter :find_optional_project, :only => :index
|
before_filter :find_optional_project, :only => :index
|
||||||
accept_rss_auth :index
|
accept_rss_auth :index
|
||||||
accept_api_auth :index
|
accept_api_auth :index
|
||||||
|
|
||||||
helper :watchers
|
helper :watchers
|
||||||
|
|
||||||
def index
|
def index
|
||||||
case params[:format]
|
case params[:format]
|
||||||
when 'xml', 'json'
|
when 'xml', 'json'
|
||||||
@ -35,9 +35,9 @@ class NewsController < ApplicationController
|
|||||||
else
|
else
|
||||||
@limit = 10
|
@limit = 10
|
||||||
end
|
end
|
||||||
|
|
||||||
scope = @project ? @project.news.visible : News.visible
|
scope = @project ? @project.news.visible : News.visible
|
||||||
|
|
||||||
@news_count = scope.count
|
@news_count = scope.count
|
||||||
@news_pages = Paginator.new self, @news_count, @limit, params['page']
|
@news_pages = Paginator.new self, @news_count, @limit, params['page']
|
||||||
@offset ||= @news_pages.current.offset
|
@offset ||= @news_pages.current.offset
|
||||||
@ -45,14 +45,14 @@ class NewsController < ApplicationController
|
|||||||
:order => "#{News.table_name}.created_on DESC",
|
:order => "#{News.table_name}.created_on DESC",
|
||||||
:offset => @offset,
|
:offset => @offset,
|
||||||
:limit => @limit)
|
:limit => @limit)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { render :layout => false if request.xhr? }
|
format.html { render :layout => false if request.xhr? }
|
||||||
format.api
|
format.api
|
||||||
format.atom { render_feed(@newss, :title => (@project ? @project.name : Setting.app_title) + ": #{l(:label_news_plural)}") }
|
format.atom { render_feed(@newss, :title => (@project ? @project.name : Setting.app_title) + ": #{l(:label_news_plural)}") }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@comments = @news.comments
|
@comments = @news.comments
|
||||||
@comments.reverse! if User.current.wants_comments_in_reverse_order?
|
@comments.reverse! if User.current.wants_comments_in_reverse_order?
|
||||||
@ -77,7 +77,7 @@ class NewsController < ApplicationController
|
|||||||
|
|
||||||
def edit
|
def edit
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
if request.put? and @news.update_attributes(params[:news])
|
if request.put? and @news.update_attributes(params[:news])
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
@ -91,14 +91,14 @@ class NewsController < ApplicationController
|
|||||||
@news.destroy
|
@news.destroy
|
||||||
redirect_to :action => 'index', :project_id => @project
|
redirect_to :action => 'index', :project_id => @project
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def find_project
|
def find_project
|
||||||
@project = Project.find(params[:project_id])
|
@project = Project.find(params[:project_id])
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
render_404
|
render_404
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_optional_project
|
def find_optional_project
|
||||||
return true unless params[:project_id]
|
return true unless params[:project_id]
|
||||||
@project = Project.find(params[:project_id])
|
@project = Project.find(params[:project_id])
|
||||||
|
Loading…
Reference in New Issue
Block a user