Sha256: 5edf3c2eed427e750e3ef5fe0a311e9416a99ff79dff44b687dda372b23d6227

Contents?: true

Size: 1.01 KB

Versions: 4

Compression:

Stored size: 1.01 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

      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

4 entries across 4 versions & 1 rubygems

Version Path
decidim-admin-0.20.1 app/helpers/decidim/admin/application_helper.rb
decidim-admin-0.20.0 app/helpers/decidim/admin/application_helper.rb
decidim-admin-0.19.1 app/helpers/decidim/admin/application_helper.rb
decidim-admin-0.19.0 app/helpers/decidim/admin/application_helper.rb