Sha256: d219d53bec35a6b647d9acde70b2024b06698327b019505fe2620272c83b4414

Contents?: true

Size: 742 Bytes

Versions: 3

Compression:

Stored size: 742 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 show
      return render :online if options[:online]

      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
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
decidim-core-0.28.0 app/cells/decidim/address_cell.rb
decidim-core-0.28.0.rc5 app/cells/decidim/address_cell.rb
decidim-core-0.28.0.rc4 app/cells/decidim/address_cell.rb