Module: Decidim::Conferences::ConferenceHelper

Includes:
AttachmentsHelper, PaginateHelper
Included in:
ConferenceDropdownMetadataCell
Defined in:
decidim-conferences/app/helpers/decidim/conferences/conference_helper.rb

Instance Method Summary collapse

Methods included from AttachmentsHelper

#attachment_title, #attachments_for, #attachments_tab_panel_items

Methods included from IconHelper

#component_icon, #manifest_icon, #resource_icon, #resource_type_icon, #resource_type_icon_key, #text_with_resource_icon

Methods included from LayoutHelper

#_icon_classes, #apple_favicon, #application_path, #current_url, #current_user_unread_data, #extended_navigation_bar, #external_icon, #favicon, #icon, #legacy_favicon, #role

Methods included from TooltipHelper

#with_tooltip

Methods included from ModalHelper

#decidim_drawer, #decidim_modal

Methods included from OrganizationHelper

#current_organization_name, #organization_colors, #organization_description_label, #organization_name

Methods included from TranslatableAttributes

#default_locale?

Methods included from PaginateHelper

#decidim_paginate

Instance Method Details

#conference_nav_items(participatory_space) ⇒ Object

Items to display in the navigation of a conference



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'decidim-conferences/app/helpers/decidim/conferences/conference_helper.rb', line 20

def conference_nav_items(participatory_space)
  [].tap do |items|
    if participatory_space.speakers.published.exists?
      items << {
        name: t("layouts.decidim.conferences_nav.conference_speaker_menu_item"),
        url: decidim_conferences.conference_conference_speakers_path(participatory_space)
      }
    end

    meeting_components = participatory_space.components.published.where(manifest_name: "meetings")
    other_components = participatory_space.components.published.where.not(manifest_name: "meetings")

    meeting_components.each do |component|
      next unless Decidim::Meetings::Meeting.where(component:).published.not_hidden.visible_for(current_user).exists?

      items << {
        name: decidim_escape_translated(component.name),
        url: decidim_conferences.conference_conference_program_path(participatory_space, id: component.id)
      }
    end

    if participatory_space.partners.exists?
      items << {
        name: t("layouts.decidim.conferences_nav.conference_partners_menu_item"),
        url: decidim_conferences.conference_path(participatory_space, anchor: "conference-partners-main_promotor")
      }
    end

    if meeting_components.exists?
      items << {
        name: t("layouts.decidim.conferences_nav.venues"),
        url: decidim_conferences.conference_path(participatory_space, anchor: "venues")
      }
    end

    other_components.each do |component|
      items << {
        name: decidim_escape_translated(component.name),
        url: main_component_path(component)
      }
    end

    if participatory_space.attachments.any? || participatory_space.media_links.any?
      items << {
        name: t("layouts.decidim.conferences_nav.media"),
        url: decidim_conferences.conference_media_path(participatory_space)
      }
    end
  end
end

#render_date(conference) ⇒ Object

Renders the dates of a conference



12
13
14
15
16
# File 'decidim-conferences/app/helpers/decidim/conferences/conference_helper.rb', line 12

def render_date(conference)
  return l(conference.start_date, format: :decidim_with_month_name_short) if conference.start_date == conference.end_date

  "#{l(conference.start_date, format: :decidim_with_month_name_short)} - #{l(conference.end_date, format: :decidim_with_month_name_short)}"
end