Sha256: 821f11f81df07317ba4554df1588db55ac94032a96d4197eb06cbfb1eebe253a
Contents?: true
Size: 953 Bytes
Versions: 16
Compression:
Stored size: 953 Bytes
Contents
# frozen_string_literal: true require "cell/partial" module Decidim module Proposals # This cell renders the cost report for a proposal. class CostReportCell < Decidim::ViewModel include ActionView::Helpers::NumberHelper include Decidim::SanitizeHelper include Decidim::LayoutHelper include ProposalCellsHelper private def cost number_to_currency(model.cost) end def cost_report decidim_sanitize(translated_attribute(model.cost_report).html_safe) end def needs_text_toggle? cost_report != cost_report_short end def cost_report_short decidim_sanitize( html_truncate( translated_attribute(model.cost_report).html_safe, length: 200 ) ) end def execution_period decidim_sanitize(translated_attribute(model.execution_period).html_safe) end end end end
Version data entries
16 entries across 16 versions & 1 rubygems