Class: Decidim::Meetings::ContentBlocks::UpcomingMeetingsCell
- Inherits:
-
ViewModel
- Object
- ViewModel
- Decidim::Meetings::ContentBlocks::UpcomingMeetingsCell
- Includes:
- CardHelper
- Defined in:
- decidim-meetings/app/cells/decidim/meetings/content_blocks/upcoming_meetings_cell.rb
Instance Method Summary collapse
- #geolocation_enabled? ⇒ Boolean
- #meetings_directory_path ⇒ Object
- #show ⇒ Object
- #upcoming_meetings ⇒ Object
Methods included from CardHelper
Instance Method Details
#geolocation_enabled? ⇒ Boolean
28 29 30 |
# File 'decidim-meetings/app/cells/decidim/meetings/content_blocks/upcoming_meetings_cell.rb', line 28 def geolocation_enabled? Decidim::Map.available?(:geocoding) end |
#meetings_directory_path ⇒ Object
32 33 34 |
# File 'decidim-meetings/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 |
#show ⇒ Object
9 10 11 12 13 |
# File 'decidim-meetings/app/cells/decidim/meetings/content_blocks/upcoming_meetings_cell.rb', line 9 def show return if upcoming_meetings.blank? render end |
#upcoming_meetings ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'decidim-meetings/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 |