Sha256: 9c0bfa2bf544d93a9ed2ad54603980c34cddc78185b4bd05de176f93644c73d3

Contents?: true

Size: 717 Bytes

Versions: 89

Compression:

Stored size: 717 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 do

        locales.each do |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 locale.to_s
          end
        end

      end
    end
  end

end

Version data entries

89 entries across 89 versions & 1 rubygems

Version Path
lalala-4.0.0.dev.219 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.218 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.217 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.216 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.215 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.212 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.208 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.202 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.201 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.198 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.195 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.194 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.193 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.192 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.191 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.190 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.189 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.188 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.187 lib/lalala/views/title_bar.rb
lalala-4.0.0.dev.186 lib/lalala/views/title_bar.rb