Sha256: 8444216b213e034b4d66a2d814f38c469c3fb0e5dc0ba47354f8b9ca7aaab39f

Contents?: true

Size: 879 Bytes

Versions: 72

Compression:

Stored size: 879 Bytes

Contents

class Lalala::Views::TitleBar < ActiveAdmin::Views::TitleBar

  def build_titlebar_right
    div :id => "titlebar_right" do
      build_locale_dropdown
      build_action_items
    end
  end

  def build_locale_dropdown
    return unless I18n.available_locales.size > 1

    locales = I18n.available_locales.dup
    locales.sort!

    div :class => "locale_chooser" do
      select(class: "bypass-chosen") do

        locales.each do |locale|
          next if Rails.application.config.lalala.i18n.excluded_locales.try(:include?, locale)
          opts = { :value => locale.to_s }
          opts[:'data-default'] = "true" if I18n.default_locale == locale
          opts[:'data-current'] = "true" if I18n.locale == locale
          option opts do
            text_node Lalala::ExtI18n::NameForLocale.name_for_locale(locale)
          end
        end

      end
    end
  end

end

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
lalala-4.1.0.dev.392 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.393 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.391 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.390 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.389 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.388 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.387 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.386 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.385 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.384 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.382 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.381 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.376 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.375 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.374 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.372 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.368 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.367 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.366 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.360 lib/lalala/views/title_bar.rb