Sha256: a85681c003af9c02a38c579c9831ef5a8a9a60e241fc109861fe48fc45f710bb

Contents?: true

Size: 652 Bytes

Versions: 8

Compression:

Stored size: 652 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Initiatives
    # This cell renders the Grid (:g) initiative card
    # for a given instance of an Initiative
    class InitiativeGCell < Decidim::CardGCell
      private

      def resource_path
        Decidim::Initiatives::Engine.routes.url_helpers.initiative_path(model)
      end

      def has_image?
        image.present?
      end

      def image
        @image ||= model.attachments.find(&:image?)
      end

      def resource_image_path
        image.url if has_image?
      end

      def metadata_cell
        "decidim/initiatives/initiative_metadata_g"
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
decidim-initiatives-0.29.0.rc3 app/cells/decidim/initiatives/initiative_g_cell.rb
decidim-initiatives-0.29.0.rc2 app/cells/decidim/initiatives/initiative_g_cell.rb
decidim-initiatives-0.29.0.rc1 app/cells/decidim/initiatives/initiative_g_cell.rb
decidim-initiatives-0.28.2 app/cells/decidim/initiatives/initiative_g_cell.rb
decidim-initiatives-0.28.1 app/cells/decidim/initiatives/initiative_g_cell.rb
decidim-initiatives-0.28.0 app/cells/decidim/initiatives/initiative_g_cell.rb
decidim-initiatives-0.28.0.rc5 app/cells/decidim/initiatives/initiative_g_cell.rb
decidim-initiatives-0.28.0.rc4 app/cells/decidim/initiatives/initiative_g_cell.rb