mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-22 08:46:11 +01:00
first pass of all tests done
This commit is contained in:
parent
598891c1d3
commit
5e477a4d25
16 changed files with 46 additions and 23 deletions
|
|
@ -189,26 +189,26 @@ class ProjectsController < ApplicationController
|
|||
update_state_counts
|
||||
init_data_for_sidebar
|
||||
|
||||
template = 'projects/update.js.erb'
|
||||
template = 'projects/update'
|
||||
|
||||
# TODO: are these params ever set? or is this dead code?
|
||||
elsif boolean_param('update_status')
|
||||
template = 'projects/update_status.js.rjs'
|
||||
template = 'projects/update_status'
|
||||
elsif boolean_param('update_default_context')
|
||||
@initial_context_name = @project.default_context.name
|
||||
template = 'projects/update_default_context.js.rjs'
|
||||
template = 'projects/update_default_context'
|
||||
elsif boolean_param('update_default_tags')
|
||||
template = 'projects/update_default_tags.js.rjs'
|
||||
template = 'projects/update_default_tags'
|
||||
elsif boolean_param('update_project_name')
|
||||
@projects = current_user.projects
|
||||
template = 'projects/update_project_name.js.rjs'
|
||||
template = 'projects/update_project_name'
|
||||
else
|
||||
render :text => success_text || 'Success'
|
||||
return
|
||||
end
|
||||
else
|
||||
init_data_for_sidebar
|
||||
template = 'projects/update.js.erb'
|
||||
template = 'projects/update'
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ class StatsController < ApplicationController
|
|||
# convert to array and fill in non-existing months
|
||||
@actions_done_last12months_array = convert_to_months_from_today_array(@actions_done_last12months, 13, :completed_at)
|
||||
@actions_created_last12months_array = convert_to_months_from_today_array(@actions_created_last12months, 13, :created_at)
|
||||
@actions_done_last12monthsPlus3_array = convert_to_months_from_today_array(@actions_done_last12monthsPlus3, 13, :completed_at)
|
||||
@actions_created_last12monthsPlus3_array = convert_to_months_from_today_array(@actions_created_last12monthsPlus3, 15, :created_at)
|
||||
@actions_done_last12monthsPlus3_array = convert_to_months_from_today_array(@actions_done_last12monthsPlus3, 16, :completed_at)
|
||||
@actions_created_last12monthsPlus3_array = convert_to_months_from_today_array(@actions_created_last12monthsPlus3, 16, :created_at)
|
||||
|
||||
# find max for graph in both arrays
|
||||
@max = [@actions_done_last12months_array.max, @actions_created_last12months_array.max].max
|
||||
|
|
@ -446,8 +446,8 @@ class StatsController < ApplicationController
|
|||
@seconds_per_day = 60*60*24
|
||||
|
||||
# define cut_off date and discard the time for a month, 3 months and a year
|
||||
@cut_off_year = 13.months.ago.beginning_of_day
|
||||
@cut_off_year_plus3 = 16.months.ago.beginning_of_day
|
||||
@cut_off_year = 12.months.ago.beginning_of_day
|
||||
@cut_off_year_plus3 = 15.months.ago.beginning_of_day
|
||||
@cut_off_month = 1.month.ago.beginning_of_day
|
||||
@cut_off_3months = 3.months.ago.beginning_of_day
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue