Sha256: d5b5138b80a76c5683edbde907dffdb3104f659f59deb71e7072431d3506e6d4

Contents?: true

Size: 970 Bytes

Versions: 19

Compression:

Stored size: 970 Bytes

Contents

# frozen_string_literal: true

require 'set'
module Thredded
  module NavHelper
    USER_NAV_MODERATION_PAGES = Set.new(
      %w[
        thredded--pending-moderation
        thredded--moderation-activity
        thredded--moderation-history
        thredded--moderation-users
        thredded--moderation-user
      ]
    )

    USER_NAV_PREFERENCES_PAGES = Set.new(
      %w[
        thredded--preferences
      ]
    )

    USER_NAV_PRIVATE_TOPICS_PAGES = Set.new(
      %w[
        thredded--new-private-topic
        thredded--private-topics-index
        thredded--private-topic-show
      ]
    )

    def current_page_preferences?
      USER_NAV_PREFERENCES_PAGES.include?(content_for(:thredded_page_id))
    end

    def current_page_moderation?
      USER_NAV_MODERATION_PAGES.include?(content_for(:thredded_page_id))
    end

    def current_page_private_topics?
      USER_NAV_PRIVATE_TOPICS_PAGES.include?(content_for(:thredded_page_id))
    end
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
thredded-0.15.1 app/helpers/thredded/nav_helper.rb
threddedDANIEL-0.14.5 app/helpers/thredded/nav_helper.rb
thredded-0.14.4 app/helpers/thredded/nav_helper.rb
thredded-0.14.3 app/helpers/thredded/nav_helper.rb
thredded-0.14.2 app/helpers/thredded/nav_helper.rb
thredded-0.14.1 app/helpers/thredded/nav_helper.rb
thredded-0.14.0 app/helpers/thredded/nav_helper.rb
thredded-0.13.8 app/helpers/thredded/nav_helper.rb
thredded-0.13.7 app/helpers/thredded/nav_helper.rb
thredded-0.13.6 app/helpers/thredded/nav_helper.rb
thredded-0.13.5 app/helpers/thredded/nav_helper.rb
thredded-0.13.4 app/helpers/thredded/nav_helper.rb
thredded-0.13.3 app/helpers/thredded/nav_helper.rb
thredded-0.13.2 app/helpers/thredded/nav_helper.rb
thredded-0.13.1 app/helpers/thredded/nav_helper.rb
thredded-0.13.0 app/helpers/thredded/nav_helper.rb
thredded-0.12.4 app/helpers/thredded/nav_helper.rb
thredded-0.12.3 app/helpers/thredded/nav_helper.rb
thredded-0.12.2 app/helpers/thredded/nav_helper.rb