rails_admin_mongoid_localize_filed 0.1.0 → 0.1.1

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: 99c610f8829e498233ba9152f950dc6fbacc91c6
4
- data.tar.gz: 89ce2fae74dc68ded000cb6b9d334d88c903ee1a
3
+ metadata.gz: ae6d80a63c5671fc4d20d682ffae9b0bc78f50ea
4
+ data.tar.gz: f9a937de1a520cba5781607a898804645e9e3b76
5
5
  SHA512:
6
- metadata.gz: 9cca85aca680be589e368a7230e58ddfebdc0b850d12c37e2245e3310e33fc3357fe65e4b4f09b91dc736e2f3788ba00fdd561e65d8e152530fd808eb745464e
7
- data.tar.gz: 4c9d5ba46306461bd4be7fa70c4135d790f9c5e6f83a2209117bb5353f31b1d5d2d8d6dbfbb60a893dc5bac0e2726440660b5a59bc5f9d49ebdd53af5d668fbd
6
+ metadata.gz: 4b150a4725a198bedc8e9ba30a70fa0d27f34b49c29f30a9865ea51866bd54e839d6a37469e158db2dd0023eef7141e185d6fdbdb81c00ddd9c35fccae3250b0
7
+ data.tar.gz: 9a8c354530755379987c9bb54213d8eb0c479efdbd4c649ff5ff22c21358741835a3621a2a06ec7a3f0d57c17a726cf7c93dad1478d4bc16065c864a8d0351df
data/README.md CHANGED
@@ -2,12 +2,11 @@
2
2
 
3
3
  Adds to [RailsAdmin](https://github.com/sferik/rails_admin) support for [mongoid localized fields](http://mongoid.org/en/mongoid/docs/documents.html#localized_fields).
4
4
 
5
-
6
5
  ## Installation
7
6
 
8
7
  In your `Gemfile`add the following dependencies:
9
8
 
10
- gem 'rails_admin_mongoid_localize_filed', :github => 'sudosu/rails_admin_mongoid_localize_filed'
9
+ gem "rails_admin_mongoid_localize_filed", "~> 0.1.0"
11
10
 
12
11
  Run:
13
12
 
@@ -16,6 +15,7 @@ Run:
16
15
  ## Usage
17
16
 
18
17
  Just by telling the field to `localize`:
18
+
19
19
  ```ruby
20
20
  class Category
21
21
  include Mongoid::Document
@@ -25,9 +25,33 @@ class Category
25
25
  end
26
26
  ```
27
27
 
28
+ If you didn't like ui tabs, you can remove them and use simple form template by using `tabbed` option:
29
+
30
+ ```ruby
31
+ # config/initializer/rails_admin.rb
32
+
33
+ config.model 'Category' do
34
+ edit do
35
+ field :name do
36
+ tabbed false
37
+ end
38
+ field :description do
39
+ tabbed false
40
+ end
41
+ end
42
+ end
43
+ ```
44
+
28
45
  ## Screenshot
29
46
 
30
- ![Screenshot](https://s3-us-west-2.amazonaws.com/droplr.storage/files/acc_176152/yd3e?AWSAccessKeyId=AKIAJSVQN3Z4K7MT5U2A&Expires=1388262962&Signature=Q5fdU5Bn8Q9dMa%2BOGiLtjQwctp0%3D&response-content-disposition=inline%3B%20filename%3Drails_admin_mongoid_localize_fields.png%3B%20filename%2A%3DUTF-8%2527%2527rails_admin_mongoid_localize_fields.png)
47
+ ![Screenshot](https://raw.github.com/sudosu/screenshots/master/rails_admin_mongoid_localize_fields.png)
48
+
49
+
50
+ ## Dependencies
31
51
 
52
+ * haml
53
+ * mongoid >= 3.0
54
+ * rails >= 3.0
55
+ * rails_admin >= 0.5
32
56
 
33
- This project rocks and uses MIT-LICENSE.
57
+ This project rocks and uses MIT-LICENSE.
@@ -1,9 +1,10 @@
1
1
  %ul.nav.nav-tabs
2
+ - uuid = "#{field.name}_for_new_#{field.abstract_model.table_name}_#{SecureRandom.hex(10)}"
2
3
  - I18n.available_locales.each do |locale|
3
4
  %li{ class: ( 'active' if locale == I18n.locale ) }
4
- %a{ href: "##{field.method_name}_#{locale}", data: { toggle: "tab" } }= locale
5
+ %a{ href: "##{locale}_#{uuid}", data: { toggle: "tab" } }= locale
5
6
  .tab-content{ style: 'float:left' }
6
7
  = form.fields_for field.translations_field do |localized_field|
7
8
  - I18n.available_locales.each do |locale|
8
- .fields.tab-pane{ style: 'padding:5px',id: "#{field.method_name}_#{locale}", class: ( 'active' if locale == I18n.locale ) }
9
- = localized_field.send field_type, locale, html_attributes.reverse_merge({ :value => field.value.try(:[], locale.to_s) })
9
+ .fields.tab-pane{ style: 'padding:5px', id: "#{locale}_#{uuid}", class: ( 'active' if locale == I18n.locale ) }
10
+ = localized_field.send field_type, locale, html_attributes.reverse_merge({ :value => field.value.try(:[], locale.to_s) })
@@ -1,3 +1,3 @@
1
1
  module RailsAdminMongoidLocalizeField
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_admin_mongoid_localize_filed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Popadiuk
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-28 00:00:00.000000000 Z
12
+ date: 2014-01-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - '>='
19
19
  - !ruby/object:Gem::Version
20
- version: '4.0'
20
+ version: '3.0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - '>='
26
26
  - !ruby/object:Gem::Version
27
- version: '4.0'
27
+ version: '3.0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: mongoid
30
30
  requirement: !ruby/object:Gem::Requirement