Sha256: 24d818722ed951c6ec874d93489438e3ed17e183b67ef431d7807b8b11bfe031

Contents?: true

Size: 816 Bytes

Versions: 39

Compression:

Stored size: 816 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # This cell renders the address of a meeting.
  class AddressCell < Decidim::ViewModel
    include Cell::ViewModel::Partial
    include LayoutHelper
    include Decidim::SanitizeHelper

    def details
      render
    end

    def has_location?
      model.respond_to?(:location)
    end

    def has_location_hints?
      model.respond_to?(:location_hints)
    end

    def location_hints
      decidim_sanitize(translated_attribute(model.location_hints))
    end

    def location
      decidim_sanitize(translated_attribute(model.location))
    end

    def address
      decidim_sanitize(translated_attribute(model.address))
    end

    private

    def resource_icon
      icon "meetings", class: "icon--big", role: "img", "aria-hidden": true
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
decidim-core-0.27.9 app/cells/decidim/address_cell.rb
decidim-core-0.27.8 app/cells/decidim/address_cell.rb
decidim-core-0.27.7 app/cells/decidim/address_cell.rb
decidim-core-0.27.6 app/cells/decidim/address_cell.rb
decidim-core-0.26.10 app/cells/decidim/address_cell.rb
decidim-core-0.26.9 app/cells/decidim/address_cell.rb
decidim-core-0.27.5 app/cells/decidim/address_cell.rb
decidim-core-0.26.8 app/cells/decidim/address_cell.rb
decidim-core-0.27.4 app/cells/decidim/address_cell.rb
decidim-core-0.27.3 app/cells/decidim/address_cell.rb
decidim-core-0.26.7 app/cells/decidim/address_cell.rb
decidim-core-0.26.5 app/cells/decidim/address_cell.rb
decidim-core-0.27.2 app/cells/decidim/address_cell.rb
decidim-core-0.27.1 app/cells/decidim/address_cell.rb
decidim-core-0.26.4 app/cells/decidim/address_cell.rb
decidim-core-0.27.0 app/cells/decidim/address_cell.rb
decidim-core-0.26.3 app/cells/decidim/address_cell.rb
decidim-core-0.27.0.rc2 app/cells/decidim/address_cell.rb
decidim-core-0.27.0.rc1 app/cells/decidim/address_cell.rb
decidim-core-0.26.2 app/cells/decidim/address_cell.rb