mirror of
https://github.com/meineerde/redmine.git
synced 2026-01-31 19:47:14 +00:00
use "do end" instead of {} at TimelogController
git-svn-id: http://svn.redmine.org/redmine/trunk@20132 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
b81f601408
commit
188f533bd0
@ -47,27 +47,27 @@ class TimelogController < ApplicationController
|
||||
preload(:project, :user)
|
||||
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
format.html do
|
||||
@entry_count = scope.count
|
||||
@entry_pages = Paginator.new @entry_count, per_page_option, params['page']
|
||||
@entries = scope.offset(@entry_pages.offset).limit(@entry_pages.per_page).to_a
|
||||
|
||||
render :layout => !request.xhr?
|
||||
}
|
||||
format.api {
|
||||
end
|
||||
format.api do
|
||||
@entry_count = scope.count
|
||||
@offset, @limit = api_offset_and_limit
|
||||
@entries = scope.offset(@offset).limit(@limit).preload(:custom_values => :custom_field).to_a
|
||||
}
|
||||
format.atom {
|
||||
end
|
||||
format.atom do
|
||||
entries = scope.limit(Setting.feeds_limit.to_i).reorder("#{TimeEntry.table_name}.created_on DESC").to_a
|
||||
render_feed(entries, :title => l(:label_spent_time))
|
||||
}
|
||||
format.csv {
|
||||
end
|
||||
format.csv do
|
||||
# Export all entries
|
||||
@entries = scope.to_a
|
||||
send_data(query_to_csv(@entries, @query, params), :type => 'text/csv; header=present', :filename => 'timelog.csv')
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -117,7 +117,7 @@ class TimelogController < ApplicationController
|
||||
|
||||
if @time_entry.save
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
format.html do
|
||||
flash[:notice] = l(:notice_successful_create)
|
||||
if params[:continue]
|
||||
options = {
|
||||
@ -139,7 +139,7 @@ class TimelogController < ApplicationController
|
||||
else
|
||||
redirect_back_or_default project_time_entries_path(@time_entry.project)
|
||||
end
|
||||
}
|
||||
end
|
||||
format.api do
|
||||
render :action => 'show', :status => :created, :location => time_entry_url(@time_entry)
|
||||
end
|
||||
@ -163,10 +163,10 @@ class TimelogController < ApplicationController
|
||||
|
||||
if @time_entry.save
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
format.html do
|
||||
flash[:notice] = l(:notice_successful_update)
|
||||
redirect_back_or_default project_time_entries_path(@time_entry.project)
|
||||
}
|
||||
end
|
||||
format.api { render_api_ok }
|
||||
end
|
||||
else
|
||||
@ -237,21 +237,21 @@ class TimelogController < ApplicationController
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
format.html do
|
||||
if destroyed
|
||||
flash[:notice] = l(:notice_successful_delete)
|
||||
else
|
||||
flash[:error] = l(:notice_unable_delete_time_entry)
|
||||
end
|
||||
redirect_back_or_default project_time_entries_path(@projects.first), :referer => true
|
||||
}
|
||||
format.api {
|
||||
end
|
||||
format.api do
|
||||
if destroyed
|
||||
render_api_ok
|
||||
else
|
||||
render_validation_errors(@time_entries)
|
||||
end
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user