Sha256: 04a430b6a4b8ad8014f9d88dcc16e72e543cc7135b0f10818fcbd94a712b6421

Contents?: true

Size: 694 Bytes

Versions: 187

Compression:

Stored size: 694 Bytes

Contents

module GovukPublishingComponents
  module Presenters
    class TranslationNavHelper
      attr_reader :translations

      def initialize(local_assigns)
        @translations = []
        @translations = local_assigns[:translations] if local_assigns[:translations]
        @no_margin_top = local_assigns[:no_margin_top]
      end

      def has_translations?
        true if @translations.length > 1
      end

      def tracking_is_present?
        @translations.each do |translation|
          return true if translation[:data_attributes]
        end
        false
      end

      def margin_class
        "gem-c-translation-nav--no-margin-top" if @no_margin_top
      end
    end
  end
end

Version data entries

187 entries across 187 versions & 1 rubygems

Version Path
govuk_publishing_components-21.5.0 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-21.4.1 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-21.4.0 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-21.3.0 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-21.2.0 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-21.1.1 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-21.1.0 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-21.0.0 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-20.5.2 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-20.5.1 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-20.5.0 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-20.4.0 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-20.3.0 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-20.2.2 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-20.2.1 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-20.2.0 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-20.1.0 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-20.0.0 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-19.0.0 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-18.3.1 lib/govuk_publishing_components/presenters/translation_nav_helper.rb