Sha256: a1cc6b2c0225e320c07bfb1d5ed032df2b4f30ea134afeed8bbc6bd6cb217312

Contents?: true

Size: 485 Bytes

Versions: 7

Compression:

Stored size: 485 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Elections
    # This cell renders the Grid (:g) election card
    # for a given instance of an Election
    class ElectionGCell < Decidim::CardGCell
      include ElectionCellsHelper

      def metadata_cell
        "decidim/elections/election_metadata"
      end

      def has_image?
        model.photos.present?
      end

      def resource_image_path
        model.photos.first.url if has_image?
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
decidim-elections-0.28.4 app/cells/decidim/elections/election_g_cell.rb
decidim-elections-0.28.3 app/cells/decidim/elections/election_g_cell.rb
decidim-elections-0.28.2 app/cells/decidim/elections/election_g_cell.rb
decidim-elections-0.28.1 app/cells/decidim/elections/election_g_cell.rb
decidim-elections-0.28.0 app/cells/decidim/elections/election_g_cell.rb
decidim-elections-0.28.0.rc5 app/cells/decidim/elections/election_g_cell.rb
decidim-elections-0.28.0.rc4 app/cells/decidim/elections/election_g_cell.rb