Sha256: eb0a2c4db316cd331451a36e51bec04daa16989956e49773e5d7a5ab250d4d88

Contents?: true

Size: 586 Bytes

Versions: 13

Compression:

Stored size: 586 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Budgets
    # This cell renders metadata for an instance of a budget
    class BudgetMetadataCell < Decidim::CardMetadataCell
      alias budget model

      def initialize(*)
        super

        @items.prepend(*budget_items)
      end

      private

      def budget_items
        [project_count]
      end

      def project_count
        {
          text: t(:projects_count, scope: "decidim.budgets.projects.count", count: budget.projects.size),
          icon: "git-pull-request-line"
        }
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-budgets-0.29.1 app/cells/decidim/budgets/budget_metadata_cell.rb
decidim-budgets-0.28.4 app/cells/decidim/budgets/budget_metadata_cell.rb
decidim-budgets-0.29.0 app/cells/decidim/budgets/budget_metadata_cell.rb
decidim-budgets-0.28.3 app/cells/decidim/budgets/budget_metadata_cell.rb
decidim-budgets-0.29.0.rc4 app/cells/decidim/budgets/budget_metadata_cell.rb
decidim-budgets-0.29.0.rc3 app/cells/decidim/budgets/budget_metadata_cell.rb
decidim-budgets-0.29.0.rc2 app/cells/decidim/budgets/budget_metadata_cell.rb
decidim-budgets-0.29.0.rc1 app/cells/decidim/budgets/budget_metadata_cell.rb
decidim-budgets-0.28.2 app/cells/decidim/budgets/budget_metadata_cell.rb
decidim-budgets-0.28.1 app/cells/decidim/budgets/budget_metadata_cell.rb
decidim-budgets-0.28.0 app/cells/decidim/budgets/budget_metadata_cell.rb
decidim-budgets-0.28.0.rc5 app/cells/decidim/budgets/budget_metadata_cell.rb
decidim-budgets-0.28.0.rc4 app/cells/decidim/budgets/budget_metadata_cell.rb