Module: Decidim::Admin::ApplicationHelper
- Includes:
- LogRenderHelper, ResourceScopeHelper, SearchFormHelper, UserRolesHelper, Decidim::AriaSelectedLinkToHelper, HumanizeBooleansHelper, LocalizedLocalesHelper, MapHelper, MetaTagsHelper, TranslationsHelper
- Defined in:
- decidim-admin/app/helpers/decidim/admin/application_helper.rb
Overview
Custom helpers, scoped to the admin panel.
Instance Attribute Summary
Attributes included from MetaTagsHelper
#decidim_meta_description, #decidim_meta_image_url, #decidim_meta_twitter_handler, #decidim_meta_url
Instance Method Summary collapse
- #participatory_space_active_link?(component) ⇒ Boolean
-
#public_page_link(url) ⇒ Object
Adds a link to the secondary navigation so admins can easily access the public page of the element their working on.
Methods included from ResourceScopeHelper
#td_resource_scope_for, #th_resource_scope_label, #th_scope_sort_link
Methods included from UserRolesHelper
Methods included from LogRenderHelper
Methods included from MetaTagsHelper
#add_base_url_to, #add_decidim_meta_description, #add_decidim_meta_image_url, #add_decidim_meta_tags, #add_decidim_meta_twitter_handler, #add_decidim_meta_url, #add_decidim_page_title, #decidim_page_title, #resolve_base_url
Methods included from Decidim::AriaSelectedLinkToHelper
Methods included from HumanizeBooleansHelper
Methods included from TranslationsHelper
empty_translatable, ensure_translatable, multi_translation, translated_in_current_locale?
Methods included from TranslatableAttributes
Methods included from LocalizedLocalesHelper
Instance Method Details
#participatory_space_active_link?(component) ⇒ Boolean
33 34 35 36 |
# File 'decidim-admin/app/helpers/decidim/admin/application_helper.rb', line 33 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 |
#public_page_link(url) ⇒ Object
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.
25 26 27 28 29 30 31 |
# File 'decidim-admin/app/helpers/decidim/admin/application_helper.rb', line 25 def public_page_link(url) content_tag(: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 |