mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-27 20:38:48 +01:00
Group context-related pieces in a class
This commit is contained in:
parent
8b1f0a34a0
commit
6ccb9a81fb
5 changed files with 35 additions and 19 deletions
|
|
@ -15,8 +15,8 @@ class StatsController < ApplicationController
|
|||
@hidden_contexts = current_user.contexts.hidden
|
||||
@actions = Stats::Actions.new(current_user)
|
||||
@projects = Stats::Projects.new(current_user)
|
||||
@contexts = Stats::Contexts.new(current_user)
|
||||
|
||||
get_stats_contexts
|
||||
get_stats_tags
|
||||
end
|
||||
|
||||
|
|
@ -387,18 +387,6 @@ class StatsController < ApplicationController
|
|||
@cut_off_3months = 3.months.ago.beginning_of_day
|
||||
end
|
||||
|
||||
def get_stats_contexts
|
||||
@actions_per_context = Stats::TopContextsQuery.new(current_user, :limit => 5).result
|
||||
@running_actions_per_context = Stats::TopContextsQuery.new(current_user, :limit => 5, :running => true).result
|
||||
|
||||
@context_charts = %w{
|
||||
context_total_actions_data
|
||||
context_running_actions_data
|
||||
}.map do |action|
|
||||
Stats::Chart.new(action, :height => 325)
|
||||
end
|
||||
end
|
||||
|
||||
def get_stats_tags
|
||||
tags = Stats::TagCloudQuery.new(current_user).result
|
||||
@tag_cloud = Stats::TagCloud.new(tags)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue