Class: Decidim::Meetings::BaseMeetingForm

Inherits:
Form
  • Object
show all
Defined in:
app/forms/decidim/meetings/base_meeting_form.rb

Direct Known Subclasses

Admin::MeetingForm, MeetingForm

Instance Method Summary collapse

Instance Method Details

#geocoded?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'app/forms/decidim/meetings/base_meeting_form.rb', line 34

def geocoded?
  latitude.present? && longitude.present?
end

#geocoding_enabled?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'app/forms/decidim/meetings/base_meeting_form.rb', line 30

def geocoding_enabled?
  Decidim::Map.available?(:geocoding)
end

#has_address?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'app/forms/decidim/meetings/base_meeting_form.rb', line 38

def has_address?
  geocoding_enabled? && address.present?
end

#hybrid_meeting?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'app/forms/decidim/meetings/base_meeting_form.rb', line 54

def hybrid_meeting?
  type_of_meeting == "hybrid"
end

#in_person_meeting?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'app/forms/decidim/meetings/base_meeting_form.rb', line 50

def in_person_meeting?
  type_of_meeting == "in_person"
end

#needs_address?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'app/forms/decidim/meetings/base_meeting_form.rb', line 42

def needs_address?
  in_person_meeting? || hybrid_meeting?
end

#online_meeting?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'app/forms/decidim/meetings/base_meeting_form.rb', line 46

def online_meeting?
  type_of_meeting == "online"
end

#type_of_meeting_selectObject



21
22
23
24
25
26
27
28
# File 'app/forms/decidim/meetings/base_meeting_form.rb', line 21

def type_of_meeting_select
  Decidim::Meetings::Meeting::TYPE_OF_MEETING.keys.map do |type|
    [
      I18n.t("type_of_meeting.#{type}", scope: "decidim.meetings"),
      type
    ]
  end
end