Module: Decidim::Admin::ApplicationHelper

Includes:
LogRenderHelper, ResourceScopeHelper, 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 ResourceScopeHelper

#td_resource_scope_for, #th_resource_scope_label, #th_scope_sort_link

Methods included from UserRolesHelper

#user_role_config

Methods included from LogRenderHelper

#render_log

Instance Method Details

#participatory_space_active_link?(component) ⇒ Boolean

Returns:

  • (Boolean)


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

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

Adds a link to the secondary navigation so admins can easily access the public page of the element their working on.

url - The String with the URL to link to.

Returns a String with a link wrapped in a <li> element.



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

def public_page_link(url)
  (:li) do
    link_to url, class: "button", style: "color: #fff", target: "_blank", rel: "noopener" do
      I18n.t("decidim.admin.view_public_page")
    end
  end
end