Class: Decidim::Meetings::ContentBlocks::UpcomingMeetingsCell

Inherits:
ViewModel
  • Object
show all
Includes:
CardHelper
Defined in:
app/cells/decidim/meetings/content_blocks/upcoming_meetings_cell.rb

Instance Method Summary collapse

Instance Method Details

#geolocation_enabled?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'app/cells/decidim/meetings/content_blocks/upcoming_meetings_cell.rb', line 28

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

#meetings_directory_pathObject



32
33
34
# File 'app/cells/decidim/meetings/content_blocks/upcoming_meetings_cell.rb', line 32

def meetings_directory_path
  Decidim::Meetings::DirectoryEngine.routes.url_helpers.root_path
end

#showObject



9
10
11
12
13
# File 'app/cells/decidim/meetings/content_blocks/upcoming_meetings_cell.rb', line 9

def show
  return if upcoming_meetings.blank?

  render
end

#upcoming_meetingsObject



15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/cells/decidim/meetings/content_blocks/upcoming_meetings_cell.rb', line 15

def upcoming_meetings
  @upcoming_meetings ||= Decidim::Meetings::Meeting
                         .includes(:author, component: :participatory_space)
                         .where(component: meeting_components)
                         .visible_for(current_user)
                         .published
                         .where("end_time >= ?", Time.current)
                         .except_withdrawn
                         .not_hidden
                         .order(start_time: :asc)
                         .limit(limit)
end