From 188f533bd058ca03875e974cc3b3a888492acfed Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Mon, 5 Oct 2020 15:48:39 +0000 Subject: [PATCH] use "do end" instead of {} at TimelogController git-svn-id: http://svn.redmine.org/redmine/trunk@20132 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/timelog_controller.rb | 32 +++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb index bbb25d081..0107af3a0 100644 --- a/app/controllers/timelog_controller.rb +++ b/app/controllers/timelog_controller.rb @@ -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 -- 2.39.5