Sha256: 0363a60bae98ece2460ad33a12598658da4b9b5315c64d174d9483c0373cfd93

Contents?: true

Size: 887 Bytes

Versions: 76

Compression:

Stored size: 887 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
        aria_selected_link_to(text, link, options)
      end
    end
  end
end

Version data entries

76 entries across 76 versions & 2 rubygems

Version Path
decidim-core-0.21.0 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.20.1 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.20.0 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.19.1 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.18.1 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.19.0 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.17.2 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.18.0 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.17.1 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.16.1 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.17.0 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.16.0 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.15.2 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.15.1 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.15.0 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.14.4 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.14.3 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.14.2 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.14.1 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.13.1 app/helpers/decidim/user_profile_helper.rb