Sha256: 0f997fcea419943fbc8a0aca620158674002e883edaed74c9df01dab277684ce
Contents?: true
Size: 1.55 KB
Versions: 3
Compression:
Stored size: 1.55 KB
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 def display_start_and_end_time? model.respond_to?(:start_time) && model.respond_to?(:end_time) end def start_and_end_time <<~HTML #{with_tooltip(l(model.start_time, format: :tooltip)) { start_time }} - #{with_tooltip(l(model.end_time, format: :tooltip)) { end_time }} HTML end def online_meeting_url URI::Parser.new.escape(model.online_meeting_url) end def display_online_meeting_url? return true unless model.respond_to?(:online?) return true unless model.respond_to?(:iframe_access_level_allowed_for_user?) model.online? && model.iframe_access_level_allowed_for_user?(current_user) end private def start_time l model.start_time, format: "%H:%M %p" end def end_time l model.end_time, format: "%H:%M %p %Z" end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
decidim-core-0.28.5 | app/cells/decidim/address_cell.rb |
decidim-core-0.28.4 | app/cells/decidim/address_cell.rb |
decidim-core-0.28.3 | app/cells/decidim/address_cell.rb |