| Module | Admin::AnalyticsHelper |
| In: |
app/helpers/admin/analytics_helper.rb
|
# File app/helpers/admin/analytics_helper.rb, line 24
24: def cap_options(options)
25: options_for_select(options.map(&:humanize).zip(options))
26: end
# File app/helpers/admin/analytics_helper.rb, line 20
20: def country_options
21: options_for_select(groups_for_select { |q| q.groups.first.code.downcase }.unshift([t('form.all_countries'), 'all']))
22: end
# File app/helpers/admin/analytics_helper.rb, line 7 7: def country_plot_select(group = '') 8: select_tag "country_#{group}", country_options, :onchange => "Plot.select('#{group}');" 9: end
# File app/helpers/admin/analytics_helper.rb, line 16
16: def order_select(group)
17: select_tag "order_#{group}", cap_options(orders(group)), :onchange => "Plot.select('#{group}');"
18: end
# File app/helpers/admin/analytics_helper.rb, line 33
33: def orders(group)
34: group == 'per_visitor' ? ['day_of_visit', 'visit'] : ['']
35: end
# File app/helpers/admin/analytics_helper.rb, line 2 2: def plot_selects(group, options) 3: country_plot_select(group) + stat_select(group, options && cap_options(options)) + 4: " <strong>#{group.humanize}</strong> " + (group == 'per_visitor' ? "ordered by #{order_select(group)}" : '') 5: end
# File app/helpers/admin/analytics_helper.rb, line 28
28: def show_all_firsts
29: javascript_tag("$([$('#all_visitors_per_day'), $('#all_votes_histogram'),
30: $('#all_votes_per_visitor_day_of_visit'), $('#all_popular_hits_per_action')]).showAll()")
31: end
# File app/helpers/admin/analytics_helper.rb, line 11
11: def stat_select(group, options = nil)
12: options ||= cap_options(stat_types)
13: select_tag "stat_#{group}", options, :onchange => "Plot.select('#{group}');"
14: end
# File app/helpers/admin/analytics_helper.rb, line 37
37: def stat_types; ['votes', 'actions', 'uploads'] end
# File app/helpers/admin/analytics_helper.rb, line 40
40: def stat_types_items; ['last_visit', 'skipped'] end
# File app/helpers/admin/analytics_helper.rb, line 39
39: def stat_types_per_action; ['popular_hits', 'unpopular_hits', 'last_hits'] end