mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-20 07:21:12 +00:00
replace multi line block "{}" to "do end" in app/controllers/issues_controller.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@19319 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
e27dc4d547
commit
677dfdc883
@ -47,33 +47,33 @@ class IssuesController < ApplicationController
|
|||||||
|
|
||||||
if @query.valid?
|
if @query.valid?
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html do
|
||||||
@issue_count = @query.issue_count
|
@issue_count = @query.issue_count
|
||||||
@issue_pages = Paginator.new @issue_count, per_page_option, params['page']
|
@issue_pages = Paginator.new @issue_count, per_page_option, params['page']
|
||||||
@issues = @query.issues(:offset => @issue_pages.offset, :limit => @issue_pages.per_page)
|
@issues = @query.issues(:offset => @issue_pages.offset, :limit => @issue_pages.per_page)
|
||||||
render :layout => !request.xhr?
|
render :layout => !request.xhr?
|
||||||
}
|
end
|
||||||
format.api {
|
format.api do
|
||||||
@offset, @limit = api_offset_and_limit
|
@offset, @limit = api_offset_and_limit
|
||||||
@query.column_names = %w(author)
|
@query.column_names = %w(author)
|
||||||
@issue_count = @query.issue_count
|
@issue_count = @query.issue_count
|
||||||
@issues = @query.issues(:offset => @offset, :limit => @limit)
|
@issues = @query.issues(:offset => @offset, :limit => @limit)
|
||||||
Issue.load_visible_relations(@issues) if include_in_api_response?('relations')
|
Issue.load_visible_relations(@issues) if include_in_api_response?('relations')
|
||||||
}
|
end
|
||||||
format.atom {
|
format.atom do
|
||||||
@issues = @query.issues(:limit => Setting.feeds_limit.to_i)
|
@issues = @query.issues(:limit => Setting.feeds_limit.to_i)
|
||||||
render_feed(@issues,
|
render_feed(@issues,
|
||||||
:title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}")
|
:title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}")
|
||||||
}
|
end
|
||||||
format.csv {
|
format.csv do
|
||||||
@issues = @query.issues(:limit => Setting.issues_export_limit.to_i)
|
@issues = @query.issues(:limit => Setting.issues_export_limit.to_i)
|
||||||
send_data(query_to_csv(@issues, @query, params[:csv]),
|
send_data(query_to_csv(@issues, @query, params[:csv]),
|
||||||
:type => 'text/csv; header=present', :filename => 'issues.csv')
|
:type => 'text/csv; header=present', :filename => 'issues.csv')
|
||||||
}
|
end
|
||||||
format.pdf {
|
format.pdf do
|
||||||
@issues = @query.issues(:limit => Setting.issues_export_limit.to_i)
|
@issues = @query.issues(:limit => Setting.issues_export_limit.to_i)
|
||||||
send_file_headers! :type => 'application/pdf', :filename => 'issues.pdf'
|
send_file_headers! :type => 'application/pdf', :filename => 'issues.pdf'
|
||||||
}
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
@ -91,9 +91,9 @@ class IssuesController < ApplicationController
|
|||||||
@has_changesets = @issue.changesets.visible.preload(:repository, :user).exists?
|
@has_changesets = @issue.changesets.visible.preload(:repository, :user).exists?
|
||||||
@relations =
|
@relations =
|
||||||
@issue.relations.
|
@issue.relations.
|
||||||
select {|r|
|
select do |r|
|
||||||
r.other_issue(@issue) && r.other_issue(@issue).visible?
|
r.other_issue(@issue) && r.other_issue(@issue).visible?
|
||||||
}
|
end
|
||||||
@journals.reverse! if User.current.wants_comments_in_reverse_order?
|
@journals.reverse! if User.current.wants_comments_in_reverse_order?
|
||||||
|
|
||||||
if User.current.allowed_to?(:view_time_entries, @project)
|
if User.current.allowed_to?(:view_time_entries, @project)
|
||||||
@ -102,7 +102,7 @@ class IssuesController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html do
|
||||||
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
|
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
|
||||||
@priorities = IssuePriority.active
|
@priorities = IssuePriority.active
|
||||||
@time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project)
|
@time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project)
|
||||||
@ -110,19 +110,19 @@ class IssuesController < ApplicationController
|
|||||||
@relation = IssueRelation.new
|
@relation = IssueRelation.new
|
||||||
retrieve_previous_and_next_issue_ids
|
retrieve_previous_and_next_issue_ids
|
||||||
render :template => 'issues/show'
|
render :template => 'issues/show'
|
||||||
}
|
end
|
||||||
format.api {
|
format.api do
|
||||||
@changesets = @issue.changesets.visible.preload(:repository, :user).to_a
|
@changesets = @issue.changesets.visible.preload(:repository, :user).to_a
|
||||||
@changesets.reverse! if User.current.wants_comments_in_reverse_order?
|
@changesets.reverse! if User.current.wants_comments_in_reverse_order?
|
||||||
}
|
end
|
||||||
format.atom {
|
format.atom do
|
||||||
render :template => 'journals/index', :layout => false,
|
render :template => 'journals/index', :layout => false,
|
||||||
:content_type => 'application/atom+xml'
|
:content_type => 'application/atom+xml'
|
||||||
}
|
end
|
||||||
format.pdf {
|
format.pdf do
|
||||||
send_file_headers!(:type => 'application/pdf',
|
send_file_headers!(:type => 'application/pdf',
|
||||||
:filename => "#{@project.identifier}-#{@issue.id}.pdf")
|
:filename => "#{@project.identifier}-#{@issue.id}.pdf")
|
||||||
}
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -143,29 +143,29 @@ class IssuesController < ApplicationController
|
|||||||
if @issue.save
|
if @issue.save
|
||||||
call_hook(:controller_issues_new_after_save, {:params => params, :issue => @issue})
|
call_hook(:controller_issues_new_after_save, {:params => params, :issue => @issue})
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html do
|
||||||
render_attachment_warning_if_needed(@issue)
|
render_attachment_warning_if_needed(@issue)
|
||||||
flash[:notice] =
|
flash[:notice] =
|
||||||
l(:notice_issue_successful_create,
|
l(:notice_issue_successful_create,
|
||||||
:id => view_context.link_to("##{@issue.id}", issue_path(@issue),
|
:id => view_context.link_to("##{@issue.id}", issue_path(@issue),
|
||||||
:title => @issue.subject))
|
:title => @issue.subject))
|
||||||
redirect_after_create
|
redirect_after_create
|
||||||
}
|
end
|
||||||
format.api {
|
format.api do
|
||||||
render :action => 'show', :status => :created,
|
render :action => 'show', :status => :created,
|
||||||
:location => issue_url(@issue)
|
:location => issue_url(@issue)
|
||||||
}
|
end
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html do
|
||||||
if @issue.project.nil?
|
if @issue.project.nil?
|
||||||
render_error :status => 422
|
render_error :status => 422
|
||||||
else
|
else
|
||||||
render :action => 'new'
|
render :action => 'new'
|
||||||
end
|
end
|
||||||
}
|
end
|
||||||
format.api {render_validation_errors(@issue)}
|
format.api {render_validation_errors(@issue)}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -204,11 +204,11 @@ class IssuesController < ApplicationController
|
|||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
end
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html do
|
||||||
redirect_back_or_default(
|
redirect_back_or_default(
|
||||||
issue_path(@issue, previous_and_next_issue_ids_params)
|
issue_path(@issue, previous_and_next_issue_ids_params)
|
||||||
)
|
)
|
||||||
}
|
end
|
||||||
format.api {render_api_ok}
|
format.api {render_api_ok}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user