@@ -47,27 +47,27 @@ def index
47
47
preload ( :project , :user )
48
48
49
49
respond_to do |format |
50
- format . html {
50
+ format . html do
51
51
@entry_count = scope . count
52
52
@entry_pages = Paginator . new @entry_count , per_page_option , params [ 'page' ]
53
53
@entries = scope . offset ( @entry_pages . offset ) . limit ( @entry_pages . per_page ) . to_a
54
54
55
55
render :layout => !request . xhr?
56
- }
57
- format . api {
56
+ end
57
+ format . api do
58
58
@entry_count = scope . count
59
59
@offset , @limit = api_offset_and_limit
60
60
@entries = scope . offset ( @offset ) . limit ( @limit ) . preload ( :custom_values => :custom_field ) . to_a
61
- }
62
- format . atom {
61
+ end
62
+ format . atom do
63
63
entries = scope . limit ( Setting . feeds_limit . to_i ) . reorder ( "#{ TimeEntry . table_name } .created_on DESC" ) . to_a
64
64
render_feed ( entries , :title => l ( :label_spent_time ) )
65
- }
66
- format . csv {
65
+ end
66
+ format . csv do
67
67
# Export all entries
68
68
@entries = scope . to_a
69
69
send_data ( query_to_csv ( @entries , @query , params ) , :type => 'text/csv; header=present' , :filename => 'timelog.csv' )
70
- }
70
+ end
71
71
end
72
72
end
73
73
@@ -117,7 +117,7 @@ def create
117
117
118
118
if @time_entry . save
119
119
respond_to do |format |
120
- format . html {
120
+ format . html do
121
121
flash [ :notice ] = l ( :notice_successful_create )
122
122
if params [ :continue ]
123
123
options = {
@@ -139,7 +139,7 @@ def create
139
139
else
140
140
redirect_back_or_default project_time_entries_path ( @time_entry . project )
141
141
end
142
- }
142
+ end
143
143
format . api do
144
144
render :action => 'show' , :status => :created , :location => time_entry_url ( @time_entry )
145
145
end
@@ -163,10 +163,10 @@ def update
163
163
164
164
if @time_entry . save
165
165
respond_to do |format |
166
- format . html {
166
+ format . html do
167
167
flash [ :notice ] = l ( :notice_successful_update )
168
168
redirect_back_or_default project_time_entries_path ( @time_entry . project )
169
- }
169
+ end
170
170
format . api { render_api_ok }
171
171
end
172
172
else
@@ -237,21 +237,21 @@ def destroy
237
237
end
238
238
239
239
respond_to do |format |
240
- format . html {
240
+ format . html do
241
241
if destroyed
242
242
flash [ :notice ] = l ( :notice_successful_delete )
243
243
else
244
244
flash [ :error ] = l ( :notice_unable_delete_time_entry )
245
245
end
246
246
redirect_back_or_default project_time_entries_path ( @projects . first ) , :referer => true
247
- }
248
- format . api {
247
+ end
248
+ format . api do
249
249
if destroyed
250
250
render_api_ok
251
251
else
252
252
render_validation_errors ( @time_entries )
253
253
end
254
- }
254
+ end
255
255
end
256
256
end
257
257
0 commit comments