Module: Decidim::Admin::ApplicationHelper

Includes:
LogRenderHelper, SearchFormHelper, UserRolesHelper, Decidim::AriaSelectedLinkToHelper, HumanizeBooleansHelper, LocalizedLocalesHelper, MapHelper, MetaTagsHelper, TranslationsHelper
Defined in:
app/helpers/decidim/admin/application_helper.rb

Overview

Custom helpers, scoped to the admin panel.

Instance Method Summary collapse

Methods included from SearchFormHelper

#search_form_for

Methods included from UserRolesHelper

#user_role_config

Methods included from LogRenderHelper

#render_log

Instance Method Details

#cell(name, model, options = {}) ⇒ Object

Public: Overwrites the ‘cell` helper method to automatically set some common context.

name - the name of the cell to render model - the cell model options - a Hash with options

Renders the cell contents.



26
27
28
29
# File 'app/helpers/decidim/admin/application_helper.rb', line 26

def cell(name, model, options = {}, &)
  options = { context: { view_context: self, current_user: } }.deep_merge(options)
  super
end

#participatory_space_active_link?(component) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
34
# File 'app/helpers/decidim/admin/application_helper.rb', line 31

def participatory_space_active_link?(component)
  endpoints = component.manifest.admin_engine.try(:participatory_space_endpoints)
  endpoints && is_active_link?(decidim_admin_participatory_processes.components_path(current_participatory_space), %r{/\d+/manage/(#{endpoints.join("|")})\b})
end