Sha256: 13c6d532b4864329270dee5fbb38251eedca89656ceccfa87e8f45bbda2f9842

Contents?: true

Size: 541 Bytes

Versions: 8

Compression:

Stored size: 541 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Blogs
    # This cell renders the Grid (:g) post card
    # for a given instance of a Post
    class PostGCell < Decidim::CardGCell
      delegate :photo, to: :model

      private

      def has_image?
        resource_image_path.present?
      end

      def show_description?
        true
      end

      def metadata_cell
        "decidim/blogs/post_metadata_g"
      end

      def resource_image_path
        return if photo.blank?

        photo.url
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

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