Module: Decidim::Assemblies::AssembliesHelper
- Includes:
- FilterAssembliesHelper, Decidim::AttachmentsHelper, FiltersHelper, IconHelper, ResourceHelper, ResourceReferenceHelper, SanitizeHelper, WidgetUrlsHelper
- 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
- #assembly_features(assembly) ⇒ Object
-
#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”.
- #social_handler_links(assembly) ⇒ Object
Methods included from FilterAssembliesHelper
#available_filters, #current_filter_name, #filter_link, #help_text, #organization_assembly_types
Methods included from IconHelper
#component_icon, #manifest_icon, #resource_icon, #resource_type_icon, #resource_type_icon_key
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 |
#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”
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 class="section-heading">#{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 |
#social_handler_links(assembly) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'decidim-assemblies/app/helpers/decidim/assemblies/assemblies_helper.rb', line 41 def (assembly) html = "".html_safe if Decidim::Assembly::SOCIAL_HANDLERS.any? { |h| assembly.try("#{h}_handler").present? } html += "<div class='definition-data__item social_networks'>".html_safe html += "<span class='definition-data__title'>#{t("assemblies.show.social_networks", scope: "decidim")}</span>".html_safe Decidim::Assembly::SOCIAL_HANDLERS.each do |handler| handler_name = "#{handler}_handler" next if assembly.send(handler_name).blank? html += link_to handler.capitalize, "https://#{handler}.com/#{assembly.send(handler_name)}", target: "_blank", class: "", title: t("assemblies.show.social_networks_title", scope: "decidim") << " " << handler.capitalize.to_s, rel: "noopener" end html += "</div>".html_safe end html.html_safe end |