Class: Decidim::Admin::DashboardMetricChartsPresenter
Instance Method Summary
collapse
#highlighted, #not_highlighted, #view_context
Instance Method Details
#highlighted_metrics ⇒ Object
18
19
20
21
22
23
24
25
26
27
|
# File 'decidim-admin/app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb', line 18
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
29
30
31
32
33
34
35
36
37
38
|
# File 'decidim-admin/app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb', line 29
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
|
#render_not_highlighted(metrics) ⇒ Object
10
11
12
13
14
15
16
|
# File 'decidim-admin/app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb', line 10
def render_not_highlighted(metrics)
safe_join(
metrics.map do |metric|
render_metrics_data(metric.metric_name, klass: not_highlighted_classes, graph_klass: "small")
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
|