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.425 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.420 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.419 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.418 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.417 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.416 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.415 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.414 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.413 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.412 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.411 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.410 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.409 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.407 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.408 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.398 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.397 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.396 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.395 lib/lalala/views/title_bar.rb
lalala-4.1.0.dev.394 lib/lalala/views/title_bar.rb