Sha256: 420e197a75435b3c708ea0e50cae9c05e820ab231872d92ee3fae587e2c5d598

Contents?: true

Size: 545 Bytes

Versions: 8

Compression:

Stored size: 545 Bytes

Contents

# frozen_string_literal: true

module Decidim::Amendable
  # This cell renders the list of amendments of a resource.
  class AmendmentsCell < Decidim::ViewModel
    include Decidim::ApplicationHelper
    include Decidim::CardHelper
    include Decidim::IconHelper

    delegate :amendable?, :visible_emendations_for, to: :model

    def show
      return unless amendable?
      return unless emendations.any?

      render
    end

    private

    def emendations
      @emendations ||= visible_emendations_for(current_user)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
decidim-core-0.28.5 app/cells/decidim/amendable/amendments_cell.rb
decidim-core-0.28.4 app/cells/decidim/amendable/amendments_cell.rb
decidim-core-0.28.3 app/cells/decidim/amendable/amendments_cell.rb
decidim-core-0.28.2 app/cells/decidim/amendable/amendments_cell.rb
decidim-core-0.28.1 app/cells/decidim/amendable/amendments_cell.rb
decidim-core-0.28.0 app/cells/decidim/amendable/amendments_cell.rb
decidim-core-0.28.0.rc5 app/cells/decidim/amendable/amendments_cell.rb
decidim-core-0.28.0.rc4 app/cells/decidim/amendable/amendments_cell.rb