Sha256: 13310dde730b25e4df6627dcfe44bec194b060d22b497f6a3fb9f1082b2dd6be

Contents?: true

Size: 1.1 KB

Versions: 8

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # Custom helpers, scoped to the admin panel.
    #
    module ApplicationHelper
      include Decidim::LocalizedLocalesHelper
      include Decidim::TranslationsHelper
      include Decidim::HumanizeBooleansHelper
      include Decidim::AriaSelectedLinkToHelper
      include Decidim::MetaTagsHelper
      include Decidim::MapHelper
      include Decidim::Admin::LogRenderHelper
      include Decidim::Admin::UserRolesHelper
      include Decidim::Admin::ResourceScopeHelper

      def title
        current_organization.name
      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.
      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
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
decidim-admin-0.23.6 app/helpers/decidim/admin/application_helper.rb
decidim-admin-0.23.5 app/helpers/decidim/admin/application_helper.rb
decidim-admin-0.23.4 app/helpers/decidim/admin/application_helper.rb
decidim-admin-0.23.3 app/helpers/decidim/admin/application_helper.rb
decidim-admin-0.23.2 app/helpers/decidim/admin/application_helper.rb
decidim-admin-0.23.1 app/helpers/decidim/admin/application_helper.rb
decidim-admin-0.23.1.rc1 app/helpers/decidim/admin/application_helper.rb
decidim-admin-0.23.0 app/helpers/decidim/admin/application_helper.rb