Sha256: e7130f123011501b6aea2c85136f524ce70866a3ee37c929206c51d87717c1de
Contents?: true
Size: 989 Bytes
Versions: 72
Compression:
Stored size: 989 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] @inverse = local_assigns[:inverse] 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 classes classes = %w(gem-c-translation-nav) classes << inverse_class if @inverse classes << margin_class if @no_margin_top classes.join(" ") end def inverse_class "gem-c-translation-nav--inverse" end def margin_class "gem-c-translation-nav--no-margin-top" end end end end
Version data entries
72 entries across 72 versions & 1 rubygems