Sha256: facfb8eff667de61977a25a1be6f38d4730ad675ae40010c7a911e8caeaa6d08

Contents?: true

Size: 474 Bytes

Versions: 6

Compression:

Stored size: 474 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::CardHelper

    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

6 entries across 6 versions & 1 rubygems

Version Path
decidim-core-0.29.1 app/cells/decidim/amendable/amendments_cell.rb
decidim-core-0.29.0 app/cells/decidim/amendable/amendments_cell.rb
decidim-core-0.29.0.rc4 app/cells/decidim/amendable/amendments_cell.rb
decidim-core-0.29.0.rc3 app/cells/decidim/amendable/amendments_cell.rb
decidim-core-0.29.0.rc2 app/cells/decidim/amendable/amendments_cell.rb
decidim-core-0.29.0.rc1 app/cells/decidim/amendable/amendments_cell.rb