rails_admin_hstore_translate 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile.lock +194 -0
- data/README.md +2 -50
- data/lib/rails_admin_hstore_translate.rb +2 -91
- data/lib/rails_admin_hstore_translate/version.rb +1 -1
- data/rails_admin_hstore_translate.gemspec +7 -6
- metadata +10 -57
- data/.gitignore +0 -18
- data/app/views/rails_admin/main/_form.html.haml +0 -1
- data/app/views/rails_admin/main/_form_code_mirrorml.html.haml +0 -46
- data/app/views/rails_admin/main/_form_fieldml.html.haml +0 -1
- data/app/views/rails_admin/main/_form_textml.html.haml +0 -1
- data/app/views/rails_admin/main/_form_wysihtml5ml.html.haml +0 -8
- data/app/views/rails_admin/main/form_types/_form_simple.html.haml +0 -7
- data/app/views/rails_admin/main/form_types/_form_tabbed.html.haml +0 -23
- data/lib/rails_admin_hstore_translate/engine.rb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a22a2e7697694ea3003a6674f8c7eb75258e92a598a664e7e099746a814366c6
|
4
|
+
data.tar.gz: a3216269f66c9f3b70670773ecf891adeed316fff4b238b58d30ca7f33d90f2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d378b169c2eb110f384c1344f90a8155b3832db0d7d0583a8985b2784b8b7786c2f32e5d3dcb48310c839a839363fec8a6be4ccd8e0adc7141838bcd9037df8
|
7
|
+
data.tar.gz: e07930002b16230bccb910899fa7283df3a52c4741c114efec98af9b1a4781ac17c1c880922dd5f1b93fc3c397f7b69dfa8d7841d110b0042c55b58189816cfb
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,194 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
rails_admin_hstore_translate (0.4.0)
|
5
|
+
rails_admin_translate
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
actioncable (5.2.0)
|
11
|
+
actionpack (= 5.2.0)
|
12
|
+
nio4r (~> 2.0)
|
13
|
+
websocket-driver (>= 0.6.1)
|
14
|
+
actionmailer (5.2.0)
|
15
|
+
actionpack (= 5.2.0)
|
16
|
+
actionview (= 5.2.0)
|
17
|
+
activejob (= 5.2.0)
|
18
|
+
mail (~> 2.5, >= 2.5.4)
|
19
|
+
rails-dom-testing (~> 2.0)
|
20
|
+
actionpack (5.2.0)
|
21
|
+
actionview (= 5.2.0)
|
22
|
+
activesupport (= 5.2.0)
|
23
|
+
rack (~> 2.0)
|
24
|
+
rack-test (>= 0.6.3)
|
25
|
+
rails-dom-testing (~> 2.0)
|
26
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
27
|
+
actionview (5.2.0)
|
28
|
+
activesupport (= 5.2.0)
|
29
|
+
builder (~> 3.1)
|
30
|
+
erubi (~> 1.4)
|
31
|
+
rails-dom-testing (~> 2.0)
|
32
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
33
|
+
activejob (5.2.0)
|
34
|
+
activesupport (= 5.2.0)
|
35
|
+
globalid (>= 0.3.6)
|
36
|
+
activemodel (5.2.0)
|
37
|
+
activesupport (= 5.2.0)
|
38
|
+
activerecord (5.2.0)
|
39
|
+
activemodel (= 5.2.0)
|
40
|
+
activesupport (= 5.2.0)
|
41
|
+
arel (>= 9.0)
|
42
|
+
activestorage (5.2.0)
|
43
|
+
actionpack (= 5.2.0)
|
44
|
+
activerecord (= 5.2.0)
|
45
|
+
marcel (~> 0.3.1)
|
46
|
+
activesupport (5.2.0)
|
47
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
48
|
+
i18n (>= 0.7, < 2)
|
49
|
+
minitest (~> 5.1)
|
50
|
+
tzinfo (~> 1.1)
|
51
|
+
arel (9.0.0)
|
52
|
+
builder (3.2.3)
|
53
|
+
coffee-rails (4.2.2)
|
54
|
+
coffee-script (>= 2.2.0)
|
55
|
+
railties (>= 4.0.0)
|
56
|
+
coffee-script (2.4.1)
|
57
|
+
coffee-script-source
|
58
|
+
execjs
|
59
|
+
coffee-script-source (1.12.2)
|
60
|
+
concurrent-ruby (1.0.5)
|
61
|
+
crass (1.0.4)
|
62
|
+
erubi (1.7.1)
|
63
|
+
execjs (2.7.0)
|
64
|
+
ffi (1.9.25)
|
65
|
+
font-awesome-rails (4.7.0.4)
|
66
|
+
railties (>= 3.2, < 6.0)
|
67
|
+
globalid (0.4.1)
|
68
|
+
activesupport (>= 4.2.0)
|
69
|
+
haml (5.0.4)
|
70
|
+
temple (>= 0.8.0)
|
71
|
+
tilt
|
72
|
+
i18n (1.0.1)
|
73
|
+
concurrent-ruby (~> 1.0)
|
74
|
+
jquery-rails (4.3.3)
|
75
|
+
rails-dom-testing (>= 1, < 3)
|
76
|
+
railties (>= 4.2.0)
|
77
|
+
thor (>= 0.14, < 2.0)
|
78
|
+
jquery-ui-rails (5.0.5)
|
79
|
+
railties (>= 3.2.16)
|
80
|
+
kaminari (1.1.1)
|
81
|
+
activesupport (>= 4.1.0)
|
82
|
+
kaminari-actionview (= 1.1.1)
|
83
|
+
kaminari-activerecord (= 1.1.1)
|
84
|
+
kaminari-core (= 1.1.1)
|
85
|
+
kaminari-actionview (1.1.1)
|
86
|
+
actionview
|
87
|
+
kaminari-core (= 1.1.1)
|
88
|
+
kaminari-activerecord (1.1.1)
|
89
|
+
activerecord
|
90
|
+
kaminari-core (= 1.1.1)
|
91
|
+
kaminari-core (1.1.1)
|
92
|
+
loofah (2.2.2)
|
93
|
+
crass (~> 1.0.2)
|
94
|
+
nokogiri (>= 1.5.9)
|
95
|
+
mail (2.7.0)
|
96
|
+
mini_mime (>= 0.1.1)
|
97
|
+
marcel (0.3.2)
|
98
|
+
mimemagic (~> 0.3.2)
|
99
|
+
method_source (0.9.0)
|
100
|
+
mimemagic (0.3.2)
|
101
|
+
mini_mime (1.0.0)
|
102
|
+
mini_portile2 (2.3.0)
|
103
|
+
minitest (5.11.3)
|
104
|
+
nested_form (0.3.2)
|
105
|
+
nio4r (2.3.1)
|
106
|
+
nokogiri (1.8.2)
|
107
|
+
mini_portile2 (~> 2.3.0)
|
108
|
+
rack (2.0.5)
|
109
|
+
rack-pjax (1.0.0)
|
110
|
+
nokogiri (~> 1.5)
|
111
|
+
rack (>= 1.1)
|
112
|
+
rack-test (1.0.0)
|
113
|
+
rack (>= 1.0, < 3)
|
114
|
+
rails (5.2.0)
|
115
|
+
actioncable (= 5.2.0)
|
116
|
+
actionmailer (= 5.2.0)
|
117
|
+
actionpack (= 5.2.0)
|
118
|
+
actionview (= 5.2.0)
|
119
|
+
activejob (= 5.2.0)
|
120
|
+
activemodel (= 5.2.0)
|
121
|
+
activerecord (= 5.2.0)
|
122
|
+
activestorage (= 5.2.0)
|
123
|
+
activesupport (= 5.2.0)
|
124
|
+
bundler (>= 1.3.0)
|
125
|
+
railties (= 5.2.0)
|
126
|
+
sprockets-rails (>= 2.0.0)
|
127
|
+
rails-dom-testing (2.0.3)
|
128
|
+
activesupport (>= 4.2.0)
|
129
|
+
nokogiri (>= 1.6)
|
130
|
+
rails-html-sanitizer (1.0.4)
|
131
|
+
loofah (~> 2.2, >= 2.2.2)
|
132
|
+
rails_admin (1.3.0)
|
133
|
+
builder (~> 3.1)
|
134
|
+
coffee-rails (~> 4.0)
|
135
|
+
font-awesome-rails (>= 3.0, < 5)
|
136
|
+
haml (>= 4.0, < 6)
|
137
|
+
jquery-rails (>= 3.0, < 5)
|
138
|
+
jquery-ui-rails (~> 5.0)
|
139
|
+
kaminari (>= 0.14, < 2.0)
|
140
|
+
nested_form (~> 0.3)
|
141
|
+
rack-pjax (>= 0.7)
|
142
|
+
rails (>= 4.0, < 6)
|
143
|
+
remotipart (~> 1.3)
|
144
|
+
sass-rails (>= 4.0, < 6)
|
145
|
+
rails_admin_translate (0.4.0)
|
146
|
+
rails
|
147
|
+
rails_admin
|
148
|
+
railties (5.2.0)
|
149
|
+
actionpack (= 5.2.0)
|
150
|
+
activesupport (= 5.2.0)
|
151
|
+
method_source
|
152
|
+
rake (>= 0.8.7)
|
153
|
+
thor (>= 0.18.1, < 2.0)
|
154
|
+
rake (12.3.1)
|
155
|
+
rb-fsevent (0.10.3)
|
156
|
+
rb-inotify (0.9.10)
|
157
|
+
ffi (>= 0.5.0, < 2)
|
158
|
+
remotipart (1.4.2)
|
159
|
+
sass (3.5.6)
|
160
|
+
sass-listen (~> 4.0.0)
|
161
|
+
sass-listen (4.0.0)
|
162
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
163
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
164
|
+
sass-rails (5.0.7)
|
165
|
+
railties (>= 4.0.0, < 6)
|
166
|
+
sass (~> 3.1)
|
167
|
+
sprockets (>= 2.8, < 4.0)
|
168
|
+
sprockets-rails (>= 2.0, < 4.0)
|
169
|
+
tilt (>= 1.1, < 3)
|
170
|
+
sprockets (3.7.1)
|
171
|
+
concurrent-ruby (~> 1.0)
|
172
|
+
rack (> 1, < 3)
|
173
|
+
sprockets-rails (3.2.1)
|
174
|
+
actionpack (>= 4.0)
|
175
|
+
activesupport (>= 4.0)
|
176
|
+
sprockets (>= 3.0.0)
|
177
|
+
temple (0.8.0)
|
178
|
+
thor (0.20.0)
|
179
|
+
thread_safe (0.3.6)
|
180
|
+
tilt (2.0.8)
|
181
|
+
tzinfo (1.2.5)
|
182
|
+
thread_safe (~> 0.1)
|
183
|
+
websocket-driver (0.7.0)
|
184
|
+
websocket-extensions (>= 0.1.0)
|
185
|
+
websocket-extensions (0.1.3)
|
186
|
+
|
187
|
+
PLATFORMS
|
188
|
+
ruby
|
189
|
+
|
190
|
+
DEPENDENCIES
|
191
|
+
rails_admin_hstore_translate!
|
192
|
+
|
193
|
+
BUNDLED WITH
|
194
|
+
1.16.1
|
data/README.md
CHANGED
@@ -1,53 +1,5 @@
|
|
1
1
|
# RailsAdminHstoreTranslate
|
2
2
|
|
3
|
-
##
|
4
|
-
|
5
|
-
### 0.2
|
6
|
-
|
7
|
-
No longer depend on hstore_translate to allow usage of [jsonb_translate](https://github.com/glebtv/jsonb_translate)
|
8
|
-
|
9
|
-
RailsAdminHstoreTranslate adds tabbed interface to [rails_admin](https://github.com/sferik/rails_admin) for multilingual models (using [hstore_translate](https://github.com/Leadformance/hstore_translate) gem)
|
10
|
-
|
11
|
-
Heavily based on [RailsAdminGlobalizeField](https://github.com/scarfacedeb/rails_admin_globalize_field) and [rails_admin_mongoid_localize_field](https://github.com/sudosu/rails_admin_mongoid_localize_field)
|
12
|
-
|
13
|
-
It adds custom field type that you can use for hstore translations association.
|
14
|
-
|
15
|
-
Only PostgreSQL is supported.
|
16
|
-
|
17
|
-
## Installation
|
18
|
-
|
19
|
-
|
20
|
-
Then add this gem and run `bundle`
|
21
|
-
``` ruby
|
22
|
-
gem 'rails_admin_hstore_translate'
|
23
|
-
```
|
24
|
-
|
25
|
-
|
26
|
-
## Usage
|
27
|
-
|
28
|
-
> Don't forget to set I18n.available_locale config, because it uses that to determine what tabs to show
|
29
|
-
|
30
|
-
Add configuration to your model. `:locale` field is always required.
|
31
|
-
``` ruby
|
32
|
-
config.model 'Post' do
|
33
|
-
field :name do
|
34
|
-
tabbed false
|
35
|
-
end
|
36
|
-
field :description do
|
37
|
-
tabbed false
|
38
|
-
end
|
39
|
-
end
|
40
|
-
```
|
41
|
-
|
42
|
-
## Screenshot
|
43
|
-
|
44
|
-
![Screenshot](https://camo.githubusercontent.com/524bee72c730418105c4498ed4cdf40f861cfb1e/68747470733a2f2f7261772e6769746875622e636f6d2f7375646f73752f73637265656e73686f74732f6d61737465722f7261696c735f61646d696e5f6d6f6e676f69645f6c6f63616c697a655f6669656c64732e706e67)
|
45
|
-
|
46
|
-
## Contributing
|
47
|
-
|
48
|
-
1. Fork it
|
49
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
50
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
51
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
52
|
-
5. Create new Pull Request
|
3
|
+
## This gem is now RailsAdminTranslate and is located here:
|
53
4
|
|
5
|
+
https://gitlab.com/rocket-science/rails_admin_translate
|
@@ -1,91 +1,2 @@
|
|
1
|
-
require 'rails_admin_hstore_translate/
|
2
|
-
require '
|
3
|
-
|
4
|
-
require 'active_support/concern'
|
5
|
-
require 'rails_admin/config/fields'
|
6
|
-
require 'rails_admin/config/fields/base'
|
7
|
-
require 'rails_admin/config/fields/types/string'
|
8
|
-
require 'rails_admin/config/fields/types/text'
|
9
|
-
require 'rails_admin/config/fields/types/ck_editor'
|
10
|
-
require 'rails_admin/config/fields/types/code_mirror'
|
11
|
-
require 'rails_admin/config/fields/types/wysihtml5'
|
12
|
-
|
13
|
-
module RegisterInstances
|
14
|
-
extend ActiveSupport::Concern
|
15
|
-
|
16
|
-
included do
|
17
|
-
|
18
|
-
register_instance_option :translations_field do
|
19
|
-
(name.to_s + '_translations').to_sym
|
20
|
-
end
|
21
|
-
|
22
|
-
register_instance_option :localized? do
|
23
|
-
@abstract_model.model_name.constantize.public_instance_methods.include?(translations_field)
|
24
|
-
end
|
25
|
-
|
26
|
-
register_instance_option :tabbed do
|
27
|
-
true
|
28
|
-
end
|
29
|
-
|
30
|
-
register_instance_option :allowed_methods do
|
31
|
-
localized? ? [method_name, translations_field] : [method_name]
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
37
|
-
|
38
|
-
module RailsAdmin
|
39
|
-
module Config
|
40
|
-
module Fields
|
41
|
-
module Types
|
42
|
-
|
43
|
-
RailsAdmin::Config::Fields::Types::Text.class_eval do
|
44
|
-
include RegisterInstances
|
45
|
-
|
46
|
-
register_instance_option :partial do
|
47
|
-
localized? ? :form_textml : :form_text
|
48
|
-
end
|
49
|
-
|
50
|
-
end
|
51
|
-
|
52
|
-
RailsAdmin::Config::Fields::Types::CKEditor.class_eval do
|
53
|
-
include RegisterInstances
|
54
|
-
|
55
|
-
register_instance_option :partial do
|
56
|
-
localized? ? :form_ck_editorml : :form_ck_editor
|
57
|
-
end
|
58
|
-
|
59
|
-
end
|
60
|
-
|
61
|
-
RailsAdmin::Config::Fields::Types::CodeMirror.class_eval do
|
62
|
-
include RegisterInstances
|
63
|
-
|
64
|
-
register_instance_option :partial do
|
65
|
-
localized? ? :form_code_mirrorml : :form_code_mirror
|
66
|
-
end
|
67
|
-
|
68
|
-
end
|
69
|
-
|
70
|
-
RailsAdmin::Config::Fields::Types::Wysihtml5.class_eval do
|
71
|
-
include RegisterInstances
|
72
|
-
|
73
|
-
register_instance_option :partial do
|
74
|
-
localized? ? :form_wysihtml5ml : :form_wysihtml5
|
75
|
-
end
|
76
|
-
|
77
|
-
end
|
78
|
-
|
79
|
-
RailsAdmin::Config::Fields::Types::String.class_eval do
|
80
|
-
include RegisterInstances
|
81
|
-
|
82
|
-
register_instance_option :partial do
|
83
|
-
localized? ? :form_fieldml : :form_field
|
84
|
-
end
|
85
|
-
|
86
|
-
end
|
87
|
-
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
1
|
+
require 'rails_admin_hstore_translate/version'
|
2
|
+
require 'rails_admin_translate'
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["glebtv@gmail.com"]
|
11
11
|
spec.description = %q{Adds tabbed interface and custom field type for hstore_translate translations to rails_admin}
|
12
12
|
spec.summary = %q{Tabbed interface and custom field type for hstore_translate translations for rails_admin}
|
13
|
-
spec.homepage = "https://
|
13
|
+
spec.homepage = "https://gitlab.com/rocket-science/rails_admin_translate"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
@@ -18,9 +18,10 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency '
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
21
|
+
spec.add_dependency 'rails_admin_translate'
|
22
|
+
spec.post_install_message = <<-MESSAGE
|
23
|
+
! The 'rails_admin_hstore_translate' gem has been deprecated and has been replaced by 'rails_admin_translate'.
|
24
|
+
! See: https://rubygems.org/gems/rails_admin_translate
|
25
|
+
! And: https://gitlab.com/rocket-science/rails_admin_translate
|
26
|
+
MESSAGE
|
26
27
|
end
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_admin_hstore_translate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GlebTv
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: rails_admin_translate
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -24,48 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rails_admin
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: bundler
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rake
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
27
|
description: Adds tabbed interface and custom field type for hstore_translate translations
|
70
28
|
to rails_admin
|
71
29
|
email:
|
@@ -74,27 +32,22 @@ executables: []
|
|
74
32
|
extensions: []
|
75
33
|
extra_rdoc_files: []
|
76
34
|
files:
|
77
|
-
- ".gitignore"
|
78
35
|
- Gemfile
|
36
|
+
- Gemfile.lock
|
79
37
|
- LICENSE.txt
|
80
38
|
- README.md
|
81
39
|
- Rakefile
|
82
|
-
- app/views/rails_admin/main/_form.html.haml
|
83
|
-
- app/views/rails_admin/main/_form_code_mirrorml.html.haml
|
84
|
-
- app/views/rails_admin/main/_form_fieldml.html.haml
|
85
|
-
- app/views/rails_admin/main/_form_textml.html.haml
|
86
|
-
- app/views/rails_admin/main/_form_wysihtml5ml.html.haml
|
87
|
-
- app/views/rails_admin/main/form_types/_form_simple.html.haml
|
88
|
-
- app/views/rails_admin/main/form_types/_form_tabbed.html.haml
|
89
40
|
- lib/rails_admin_hstore_translate.rb
|
90
|
-
- lib/rails_admin_hstore_translate/engine.rb
|
91
41
|
- lib/rails_admin_hstore_translate/version.rb
|
92
42
|
- rails_admin_hstore_translate.gemspec
|
93
|
-
homepage: https://
|
43
|
+
homepage: https://gitlab.com/rocket-science/rails_admin_translate
|
94
44
|
licenses:
|
95
45
|
- MIT
|
96
46
|
metadata: {}
|
97
|
-
post_install_message:
|
47
|
+
post_install_message: |
|
48
|
+
! The 'rails_admin_hstore_translate' gem has been deprecated and has been replaced by 'rails_admin_translate'.
|
49
|
+
! See: https://rubygems.org/gems/rails_admin_translate
|
50
|
+
! And: https://gitlab.com/rocket-science/rails_admin_translate
|
98
51
|
rdoc_options: []
|
99
52
|
require_paths:
|
100
53
|
- lib
|
@@ -110,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
63
|
version: '0'
|
111
64
|
requirements: []
|
112
65
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
66
|
+
rubygems_version: 2.7.7
|
114
67
|
signing_key:
|
115
68
|
specification_version: 4
|
116
69
|
summary: Tabbed interface and custom field type for hstore_translate translations
|
data/.gitignore
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
= render "rails_admin/main/form_types/#{field.tabbed ? 'form_tabbed' : 'form_simple'}", form: form, field: field, field_type: field_type, html_attributes: html_attributes
|
@@ -1,46 +0,0 @@
|
|
1
|
-
:ruby
|
2
|
-
js_data = {
|
3
|
-
:csspath => field.css_location,
|
4
|
-
:jspath => field.js_location,
|
5
|
-
:options => field.config,
|
6
|
-
:locations => field.assets
|
7
|
-
}
|
8
|
-
|
9
|
-
editor_size = {
|
10
|
-
width: 'auto',
|
11
|
-
heigth: '300px',
|
12
|
-
}
|
13
|
-
|
14
|
-
if field.html_attributes[:cols]
|
15
|
-
if field.html_attributes[:cols].to_s.match('%')
|
16
|
-
editor_size[:width] = field.html_attributes[:cols]
|
17
|
-
else
|
18
|
-
editor_size[:width] = "#{field.html_attributes[:cols].to_i * 8}px"
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
if field.html_attributes[:rows]
|
23
|
-
if field.html_attributes[:rows].to_s.match('%')
|
24
|
-
editor_size[:heigth] = field.html_attributes[:rows]
|
25
|
-
else
|
26
|
-
editor_size[:heigth] = "#{field.html_attributes[:rows].to_i * 20}px"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
- uniqid = "code_mirror_#{SecureRandom.hex(10)}"
|
31
|
-
|
32
|
-
:css
|
33
|
-
##{uniqid} .CodeMirror {
|
34
|
-
width: #{editor_size[:width]};
|
35
|
-
height: #{editor_size[:heigth]};
|
36
|
-
}
|
37
|
-
|
38
|
-
:javascript
|
39
|
-
$(document).on('click', '##{uniqid} .nav.nav-tabs li a', function(e){
|
40
|
-
$('##{uniqid} .tab-content '+ $(this).attr('href') + ' .CodeMirror').each(function(i, el){
|
41
|
-
el.CodeMirror.refresh();
|
42
|
-
});
|
43
|
-
});
|
44
|
-
|
45
|
-
%div{id: uniqid}
|
46
|
-
= render 'form', form: form, field: field, field_type: :text_area, html_attributes: field.html_attributes.reverse_merge(:data => { :richtext => 'codemirror', :options => js_data.to_json })
|
@@ -1 +0,0 @@
|
|
1
|
-
= render 'form', form: form, field: field, field_type: :text_field, html_attributes: field.html_attributes
|
@@ -1 +0,0 @@
|
|
1
|
-
= render 'form', form: form, field: field, field_type: :text_area, html_attributes: field.html_attributes.reverse_merge(:data => { :richtext => false, :options => {}.to_json })
|
@@ -1,8 +0,0 @@
|
|
1
|
-
:ruby
|
2
|
-
js_data = {
|
3
|
-
:csspath => field.css_location,
|
4
|
-
:jspath => field.js_location,
|
5
|
-
:config_options => field.config_options.to_json
|
6
|
-
}
|
7
|
-
|
8
|
-
= render 'form', form: form, field: field, field_type: :text_area, html_attributes: field.html_attributes.reverse_merge(:data => { :richtext => 'bootstrap-wysihtml5', :options => js_data.to_json })
|
@@ -1,7 +0,0 @@
|
|
1
|
-
= form.fields_for field.translations_field do |localized_field|
|
2
|
-
- I18n.available_locales.each do |locale|
|
3
|
-
- val = form.object.send("#{field.name}_translations").try(:[], locale.to_s)
|
4
|
-
%div
|
5
|
-
= localized_field.label locale
|
6
|
-
= localized_field.send field_type, locale, html_attributes.reverse_merge({ :value => val })
|
7
|
-
|
@@ -1,23 +0,0 @@
|
|
1
|
-
|
2
|
-
%ul.nav.nav-tabs
|
3
|
-
- uuid = "#{field.name}_#{field.object_id}_unique_id"
|
4
|
-
- I18n.available_locales.each do |locale|
|
5
|
-
%li{ class: ( 'active' if locale == I18n.locale ) }
|
6
|
-
%a{ href: "##{locale}_#{uuid}", data: { toggle: "tab" }, class: uuid }= locale
|
7
|
-
.tab-content
|
8
|
-
= form.fields_for field.translations_field do |localized_field|
|
9
|
-
- I18n.available_locales.each do |locale|
|
10
|
-
- val = form.object.send("#{field.name}_translations").try(:[], locale.to_s)
|
11
|
-
.fields.tab-pane{ style: 'padding:5px; margin: 0;', id: "#{locale}_#{uuid}", class: [( 'active' if locale == I18n.locale ), uuid] }
|
12
|
-
= localized_field.send field_type, locale, html_attributes.reverse_merge({ :value => val })
|
13
|
-
|
14
|
-
:javascript
|
15
|
-
var #{field.name}#{field.object_id} = (new Date().getTime()) + Math.floor(Math.random()*100000);
|
16
|
-
$("ul.nav.nav-tabs a.#{uuid}").each(function(e){
|
17
|
-
this.href = $(this).attr('href').replace('_unique_id', #{field.name}#{field.object_id});
|
18
|
-
$(this).removeClass('#{uuid}');
|
19
|
-
});
|
20
|
-
$(".tab-content .#{uuid}").each(function(e){
|
21
|
-
this.id = this.id.replace('_unique_id', #{field.name}#{field.object_id});
|
22
|
-
$(this).removeClass('#{uuid}');
|
23
|
-
});
|