@@ -52,13 +52,9 class TimelogController < ApplicationController | |||||
52 |
|
52 | |||
53 | respond_to do |format| |
|
53 | respond_to do |format| | |
54 | format.html { |
|
54 | format.html { | |
55 | # Paginate results |
|
|||
56 | @entry_count = scope.count |
|
55 | @entry_count = scope.count | |
57 | @entry_pages = Paginator.new @entry_count, per_page_option, params['page'] |
|
56 | @entry_pages = Paginator.new @entry_count, per_page_option, params['page'] | |
58 | @entries = scope.all( |
|
57 | @entries = scope.offset(@entry_pages.offset).limit(@entry_pages.per_page).all | |
59 | :limit => @entry_pages.per_page, |
|
|||
60 | :offset => @entry_pages.offset |
|
|||
61 | ) |
|
|||
62 | @total_hours = scope.sum(:hours).to_f |
|
58 | @total_hours = scope.sum(:hours).to_f | |
63 |
|
59 | |||
64 | render :layout => !request.xhr? |
|
60 | render :layout => !request.xhr? | |
@@ -66,15 +62,10 class TimelogController < ApplicationController | |||||
66 | format.api { |
|
62 | format.api { | |
67 | @entry_count = scope.count |
|
63 | @entry_count = scope.count | |
68 | @offset, @limit = api_offset_and_limit |
|
64 | @offset, @limit = api_offset_and_limit | |
69 |
@entries = scope.preload(:custom_values => :custom_field).all |
|
65 | @entries = scope.offset(@offset).limit(@limit).preload(:custom_values => :custom_field).all | |
70 | :limit => @limit, |
|
|||
71 | :offset => @offset |
|
|||
72 | ) |
|
|||
73 | } |
|
66 | } | |
74 | format.atom { |
|
67 | format.atom { | |
75 |
entries = scope.reorder("#{TimeEntry.table_name}.created_on DESC").all |
|
68 | entries = scope.limit(Setting.feeds_limit.to_i).reorder("#{TimeEntry.table_name}.created_on DESC").all | |
76 | :limit => Setting.feeds_limit.to_i |
|
|||
77 | ) |
|
|||
78 | render_feed(entries, :title => l(:label_spent_time)) |
|
69 | render_feed(entries, :title => l(:label_spent_time)) | |
79 | } |
|
70 | } | |
80 | format.csv { |
|
71 | format.csv { |
General Comments 0
You need to be logged in to leave comments.
Login now