Sha256: 0d752334751a53d6259c4eb8010e99a2bed857a1a48a2f875ba9ffc3f8366439

Contents?: true

Size: 886 Bytes

Versions: 6

Compression:

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

6 entries across 6 versions & 1 rubygems

Version Path
decidim-core-0.1.0 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.0.8.1 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.0.7 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.0.6 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.0.5 app/helpers/decidim/user_profile_helper.rb
decidim-core-0.0.3 app/helpers/decidim/user_profile_helper.rb