Class: Decidim::Admin::DashboardMetricChartsPresenter
Instance Method Summary
collapse
#highlighted, #not_highlighted, #render_charts, #render_metrics, #view_context
Instance Method Details
#highlighted_metrics ⇒ Object
10
11
12
13
14
15
16
17
18
19
|
# File 'decidim-admin/app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb', line 10
def highlighted_metrics
return super unless summary?
Decidim.metrics_registry.filtered(
highlight: true,
scope: "home"
).select do |registry|
%w(users proposals).include? registry.metric_name
end
end
|
#not_highlighted_metrics ⇒ Object
21
22
23
24
25
26
27
28
29
30
|
# File 'decidim-admin/app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb', line 21
def not_highlighted_metrics
return super unless summary?
Decidim.metrics_registry.filtered(
highlight: false,
scope: "home"
).select do |registry|
%w(comments meetings accepted_proposals results blocked_users user_reports reported_users).include? registry.metric_name
end
end
|
#summary? ⇒ Boolean
6
7
8
|
# File 'decidim-admin/app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb', line 6
def summary?
__getobj__.fetch(:summary)
end
|