rails_admin_globalize_field 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: caa756da5d955d39baeae1b822446fd0a5c757c3
4
- data.tar.gz: 3d8a4780432d211ddf8099be9fc7aebdf3b01188
3
+ metadata.gz: 7353145b56d95cd44bb83e762caade9e67c3b520
4
+ data.tar.gz: 7c2f9ab652b47cae7cad942a1ceabe10e3aa98e9
5
5
  SHA512:
6
- metadata.gz: c18521dad54e3361e86fa6932a1be75e8e15db599c4a4d29fe88eb2b680db118e418f90fc0d03c170cf12340e000b71c8caedb0883db26959eda3a87cc7a1f9d
7
- data.tar.gz: 6346891d5eda3f547f49907033493d9cfeb4cb815e43d4499250aa2cc3e4a0447cf7a57de3775111a585d04dea3c95f5bfc555973e1de3bb2b78de2da7236b6d
6
+ metadata.gz: 2defab5a3f0823cc93ad6482de0cdb29a783cc25800aa4679fde74f9a8933a6face235925570bbeffe62ce608fc7a8ea0cf0eb1aafed0fff43ef616c1be6847a
7
+ data.tar.gz: c7e3a844ab1d27c5753825427a6d65de6194edaf76dc6dc39c07fb04dac89f71722250a02be26e5ded2f34a71e980948b50f4af7fc46d6b98f69a678024b607c
data/README.md CHANGED
@@ -23,6 +23,8 @@ Then add this gem and run `bundle`
23
23
 
24
24
  ## Usage
25
25
 
26
+ > Don't forget to set I18n.available_locale config, because it uses that to determine what tabs to show
27
+
26
28
  Add **translation** models to `config.included_models` in `initializers/rails_admin.rb`:
27
29
  ``` ruby
28
30
  config.included_models = ['Model','Model::Translation']
@@ -1,16 +1,19 @@
1
1
  - field.translations(true) # fetch translations and memoize them
2
+ - key = field.abstract_model.model_name.downcase
2
3
 
3
4
  .controls
4
5
  .globalize-errors
5
6
  = form.errors_for(field)
6
7
  %ul.nav.nav-tabs{ :style => 'margin-top:5px' }
7
8
  - field.available_locales.each do |locale|
9
+ - klass = "localized-pane-#{locale}-#{key}-#{form.object.id}"
8
10
  %li{ class: ( 'active' if locale == field.current_locale ) }
9
- %a{ href: "##{locale}", data: { toggle: "tab" } }= locale
11
+ %a{ href: "#", data: { toggle: "tab", target: ".#{klass}:first"} }= locale
10
12
  .tab-content
11
13
  - field.available_locales.each do |locale|
14
+ - klass = "localized-pane-#{locale}-#{key}-#{form.object.id}"
12
15
  = form.fields_for field.name, field.translations[locale], wrapper: false do |nested_form|
13
- .fields.tab-pane{ id: locale, class: ( 'active' if locale == field.current_locale ) }
16
+ .fields.tab-pane{ class: "#{klass} #{'active' if locale == field.current_locale}" }
14
17
  = nested_form.generate({:action => :nested, :model_config => field.associated_model_config, :nested_in => field.name })
15
18
  .globalize-help
16
- = form.help_for(field)
19
+ = form.help_for(field)
@@ -1,3 +1,3 @@
1
1
  module RailsAdminGlobalizeField
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_admin_globalize_field
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Volozhanin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-01 00:00:00.000000000 Z
11
+ date: 2014-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -120,8 +120,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  version: '0'
121
121
  requirements: []
122
122
  rubyforge_project:
123
- rubygems_version: 2.2.0
123
+ rubygems_version: 2.2.2
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: Tabbed interface and custom field type for globalize translations for Rails_admin
127
127
  test_files: []
128
+ has_rdoc: