Sha256: 3439585f4d21effd968311a47f67423844260f320f2e810a4f8086bc56388450

Contents?: true

Size: 716 Bytes

Versions: 7

Compression:

Stored size: 716 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, unit: Decidim.currency_unit)
      end

      def cost_report
        decidim_sanitize_editor(translated_attribute(model.cost_report).html_safe)
      end

      def execution_period
        decidim_sanitize_editor(translated_attribute(model.execution_period).html_safe)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
decidim-proposals-0.28.4 app/cells/decidim/proposals/cost_report_cell.rb
decidim-proposals-0.28.3 app/cells/decidim/proposals/cost_report_cell.rb
decidim-proposals-0.28.2 app/cells/decidim/proposals/cost_report_cell.rb
decidim-proposals-0.28.1 app/cells/decidim/proposals/cost_report_cell.rb
decidim-proposals-0.28.0 app/cells/decidim/proposals/cost_report_cell.rb
decidim-proposals-0.28.0.rc5 app/cells/decidim/proposals/cost_report_cell.rb
decidim-proposals-0.28.0.rc4 app/cells/decidim/proposals/cost_report_cell.rb