Sha256: 26a8e08b48112744b8efcb966806d8876f0ace2a7ac0b81fbf06e10782e5b519

Contents?: true

Size: 873 Bytes

Versions: 45

Compression:

Stored size: 873 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # Helpers used in controllers implementing the `Decidim::UserProfile` concern.
  module UserProfileHelper
    # Public: Shows a menu tab with a section. It highlights automatically bye
    # detecting if the current path is a subset of the provided route.
    #
    # text - The text to show in the tab.
    # link - The path to link to.
    # options - Extra options.
    #           aria_link_type - :inclusive or :exact, depending on the type of
    #                            highlighting desired.
    #
    # Returns a String with the menu tab.
    def user_profile_tab(text, link, options = {})
      active = is_active_link?(link, (options[:aria_link_type] || :inclusive))

      content_tag(:li, class: "tabs-title#{active ? " is-active" : nil}") do
        link_to(text, link, options)
      end
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
decidim-core-0.26.10 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.26.9 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.28.0 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.27.5 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.28.0.rc5 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.28.0.rc4 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.26.8 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.27.4 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.27.3 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.26.7 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.26.5 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.27.2 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.27.1 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.26.4 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.27.0 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.26.3 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.27.0.rc2 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.27.0.rc1 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.26.2 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.26.1 app/helpers/decidim/user_profile_helper.rb