Note we're naming it "chart" in order to avoid possible conflicts with the "graph" view when we move it to a component.
20 lines
599 B
Ruby
20 lines
599 B
Ruby
module StatsHelper
|
|
def budget_investments_chart_tag(opt = {})
|
|
opt[:data] ||= {}
|
|
opt[:data][:graph] = admin_api_stats_path(budget_investments: true)
|
|
tag.div(**opt)
|
|
end
|
|
|
|
def number_to_stats_percentage(number, options = {})
|
|
number_to_percentage(number, { strip_insignificant_zeros: true, precision: 2 }.merge(options))
|
|
end
|
|
|
|
def number_with_info_tags(number, text, html_class: "")
|
|
tag.p class: "number-with-info #{html_class}".strip do
|
|
tag.span class: "content" do
|
|
tag.span(number, class: "number") + tag.span(text, class: "info")
|
|
end
|
|
end
|
|
end
|
|
end
|