Module: Decidim::Assemblies::AssembliesHelper

Includes:
FilterAssembliesHelper, Decidim::AttachmentsHelper, FiltersHelper, IconHelper, ResourceHelper, ResourceReferenceHelper, SanitizeHelper
Included in:
AssemblyDropdownMetadataCell, ContentBlocks::MainDataCell
Defined in:
decidim-assemblies/app/helpers/decidim/assemblies/assemblies_helper.rb

Overview

Helpers related to the Assemblies layout.

Constant Summary

Constants included from IconHelper

IconHelper::DEFAULT_RESOURCE_TYPE_ICONS

Instance Method Summary collapse

Methods included from FilterAssembliesHelper

#assembly_types, #filter_sections, #filter_types_values

Methods included from CheckBoxesTreeHelper

#check_boxes_tree_options, #filter_areas_values, #filter_categories_values, #filter_global_scopes_values, #filter_origin_values, #filter_scopes_values, #filter_text_for, #filter_tree_from_array, #flat_filter_values, #resource_filter_scope_values

Methods included from FiltersHelper

#filter_form_for

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_user_unread_data, #extended_navigation_bar, #external_icon, #favicon, #icon, #legacy_favicon, #organization_colors, #role

Methods included from TooltipHelper

#with_tooltip

Methods included from ModalHelper

#decidim_modal

Methods included from ResourceReferenceHelper

#resource_reference

Methods included from SanitizeHelper

#decidim_html_escape, #decidim_sanitize, #decidim_sanitize_admin, #decidim_sanitize_editor, #decidim_sanitize_editor_admin, #decidim_sanitize_newsletter, #decidim_url_escape, included

Methods included from Decidim::AttachmentsHelper

#attachment_title, #attachments_for, #attachments_tab_panel_items

Methods included from ResourceHelper

#linked_classes_filter_values_for, #linked_classes_for, #resource_locator, #resource_title

Instance Method Details

#assembly_features(assembly) ⇒ Object



32
33
34
35
36
37
38
39
# File 'decidim-assemblies/app/helpers/decidim/assemblies/assemblies_helper.rb', line 32

def assembly_features(assembly)
  html = "".html_safe
  html += "<strong>#{translated_attribute(assembly.title)}: </strong>".html_safe
  html += t("assemblies.show.private_space", scope: "decidim").to_s.html_safe
  html += ", #{t("assemblies.show.is_transparent.#{assembly.is_transparent}", scope: "decidim")}".html_safe if assembly.is_transparent?
  html += " #{decidim_sanitize_editor translated_attribute(assembly.special_features)}".html_safe
  html.html_safe
end

#assembly_nav_items(participatory_space) ⇒ Object

Items to display in the navigation of an assembly



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'decidim-assemblies/app/helpers/decidim/assemblies/assemblies_helper.rb', line 42

def assembly_nav_items(participatory_space)
  components = participatory_space.components.published.or(Decidim::Component.where(id: try(:current_component)))

  [
    *(if participatory_space.members.not_ceased.any?
        [{
          name: t("assembly_member_menu_item", scope: "layouts.decidim.assembly_navigation"),
          url: decidim_assemblies.assembly_assembly_members_path(participatory_space),
          active: is_active_link?(decidim_assemblies.assembly_assembly_members_path(participatory_space), :inclusive)
        }]
      end
     )
  ] + components.map do |component|
    {
      name: translated_attribute(component.name),
      url: main_component_path(component),
      active: is_active_link?(main_component_path(component), :inclusive)
    }
  end
end

#participatory_processes_for_assembly(assembly_participatory_processes) ⇒ Object

Public: Returns the characteristics of an assembly in a readable format like “title: close, no public, no transparent and is restricted to the members of the assembly” deprecated



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'decidim-assemblies/app/helpers/decidim/assemblies/assemblies_helper.rb', line 18

def participatory_processes_for_assembly(assembly_participatory_processes)
  html = ""
  html += %( <div class="section"> ).html_safe
  html += %( <h4>#{t("assemblies.show.related_participatory_processes", scope: "decidim")}</h4> ).html_safe
  html += %( <div class="row small-up-1 medium-up-2 card-grid"> ).html_safe
  assembly_participatory_processes.each do |assembly_participatory_process|
    html += render partial: "decidim/participatory_processes/participatory_process", locals: { participatory_process: assembly_participatory_process }
  end
  html += %( </div> ).html_safe
  html += %( </div> ).html_safe

  html.html_safe
end