rails_admin_toggleable 0.7.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +118 -98
- data/config/locales/ru.rails_admin_toggleable.yml +1 -1
- data/lib/rails_admin_toggleable/action.rb +1 -1
- data/lib/rails_admin_toggleable/field.rb +16 -4
- data/lib/rails_admin_toggleable/version.rb +1 -1
- data/rails_admin_toggleable.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7f78b2ecaa7d7f9dc2d92a7c77670300ed91aed
|
4
|
+
data.tar.gz: b5d52fe6de375db85a94737aaa24a7ee89067528
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b4af91a34af534992fdd5729c5f6e0132ed10378b03b703f0e394aa106fe48c97bb80d519eaa90c22798f6b4c5e85dbb227e7de89ae089867a3cfd9f1384180
|
7
|
+
data.tar.gz: 6612d51c2cdc8d5d5287319822d42a2ed0702a85c7cf3fcf49f88bf81642d65d1c9fc39893202189aff746d4e29ee3255613af8ea42433ac534560c87825846d
|
data/Gemfile.lock
CHANGED
@@ -1,156 +1,176 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rails_admin_toggleable (0.
|
4
|
+
rails_admin_toggleable (0.8.0)
|
5
5
|
rails_admin
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
|
11
|
-
actionpack (=
|
12
|
-
|
13
|
-
|
10
|
+
actioncable (5.1.3)
|
11
|
+
actionpack (= 5.1.3)
|
12
|
+
nio4r (~> 2.0)
|
13
|
+
websocket-driver (~> 0.6.1)
|
14
|
+
actionmailer (5.1.3)
|
15
|
+
actionpack (= 5.1.3)
|
16
|
+
actionview (= 5.1.3)
|
17
|
+
activejob (= 5.1.3)
|
14
18
|
mail (~> 2.5, >= 2.5.4)
|
15
|
-
rails-dom-testing (~>
|
16
|
-
actionpack (
|
17
|
-
actionview (=
|
18
|
-
activesupport (=
|
19
|
-
rack (~>
|
20
|
-
rack-test (~> 0.6.
|
21
|
-
rails-dom-testing (~>
|
19
|
+
rails-dom-testing (~> 2.0)
|
20
|
+
actionpack (5.1.3)
|
21
|
+
actionview (= 5.1.3)
|
22
|
+
activesupport (= 5.1.3)
|
23
|
+
rack (~> 2.0)
|
24
|
+
rack-test (~> 0.6.3)
|
25
|
+
rails-dom-testing (~> 2.0)
|
22
26
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
23
|
-
actionview (
|
24
|
-
activesupport (=
|
27
|
+
actionview (5.1.3)
|
28
|
+
activesupport (= 5.1.3)
|
25
29
|
builder (~> 3.1)
|
26
|
-
|
27
|
-
rails-dom-testing (~>
|
28
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.
|
29
|
-
activejob (
|
30
|
-
activesupport (=
|
31
|
-
globalid (>= 0.3.
|
32
|
-
activemodel (
|
33
|
-
activesupport (=
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
30
|
+
erubi (~> 1.4)
|
31
|
+
rails-dom-testing (~> 2.0)
|
32
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
33
|
+
activejob (5.1.3)
|
34
|
+
activesupport (= 5.1.3)
|
35
|
+
globalid (>= 0.3.6)
|
36
|
+
activemodel (5.1.3)
|
37
|
+
activesupport (= 5.1.3)
|
38
|
+
activerecord (5.1.3)
|
39
|
+
activemodel (= 5.1.3)
|
40
|
+
activesupport (= 5.1.3)
|
41
|
+
arel (~> 8.0)
|
42
|
+
activesupport (5.1.3)
|
43
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
40
44
|
i18n (~> 0.7)
|
41
|
-
json (~> 1.7, >= 1.7.7)
|
42
45
|
minitest (~> 5.1)
|
43
|
-
thread_safe (~> 0.3, >= 0.3.4)
|
44
46
|
tzinfo (~> 1.1)
|
45
|
-
arel (
|
46
|
-
builder (3.2.
|
47
|
-
coffee-rails (4.
|
47
|
+
arel (8.0.0)
|
48
|
+
builder (3.2.3)
|
49
|
+
coffee-rails (4.2.2)
|
48
50
|
coffee-script (>= 2.2.0)
|
49
|
-
railties (>= 4.0.0
|
51
|
+
railties (>= 4.0.0)
|
50
52
|
coffee-script (2.4.1)
|
51
53
|
coffee-script-source
|
52
54
|
execjs
|
53
|
-
coffee-script-source (1.
|
54
|
-
concurrent-ruby (1.0.
|
55
|
-
|
55
|
+
coffee-script-source (1.12.2)
|
56
|
+
concurrent-ruby (1.0.5)
|
57
|
+
erubi (1.6.1)
|
56
58
|
execjs (2.7.0)
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
59
|
+
ffi (1.9.18)
|
60
|
+
font-awesome-rails (4.7.0.2)
|
61
|
+
railties (>= 3.2, < 5.2)
|
62
|
+
globalid (0.4.0)
|
63
|
+
activesupport (>= 4.2.0)
|
64
|
+
haml (5.0.2)
|
65
|
+
temple (>= 0.8.0)
|
62
66
|
tilt
|
63
|
-
i18n (0.
|
64
|
-
jquery-rails (4.
|
67
|
+
i18n (0.8.6)
|
68
|
+
jquery-rails (4.3.1)
|
65
69
|
rails-dom-testing (>= 1, < 3)
|
66
70
|
railties (>= 4.2.0)
|
67
71
|
thor (>= 0.14, < 2.0)
|
68
72
|
jquery-ui-rails (5.0.5)
|
69
73
|
railties (>= 3.2.16)
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
+
kaminari (1.0.1)
|
75
|
+
activesupport (>= 4.1.0)
|
76
|
+
kaminari-actionview (= 1.0.1)
|
77
|
+
kaminari-activerecord (= 1.0.1)
|
78
|
+
kaminari-core (= 1.0.1)
|
79
|
+
kaminari-actionview (1.0.1)
|
80
|
+
actionview
|
81
|
+
kaminari-core (= 1.0.1)
|
82
|
+
kaminari-activerecord (1.0.1)
|
83
|
+
activerecord
|
84
|
+
kaminari-core (= 1.0.1)
|
85
|
+
kaminari-core (1.0.1)
|
74
86
|
loofah (2.0.3)
|
75
87
|
nokogiri (>= 1.5.9)
|
76
|
-
mail (2.6.
|
88
|
+
mail (2.6.6)
|
77
89
|
mime-types (>= 1.16, < 4)
|
90
|
+
method_source (0.8.2)
|
78
91
|
mime-types (3.1)
|
79
92
|
mime-types-data (~> 3.2015)
|
80
93
|
mime-types-data (3.2016.0521)
|
81
|
-
mini_portile2 (2.
|
82
|
-
minitest (5.
|
94
|
+
mini_portile2 (2.2.0)
|
95
|
+
minitest (5.10.3)
|
83
96
|
nested_form (0.3.2)
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
rack (1.
|
89
|
-
rack-pjax (0.8.0)
|
97
|
+
nio4r (2.1.0)
|
98
|
+
nokogiri (1.8.0)
|
99
|
+
mini_portile2 (~> 2.2.0)
|
100
|
+
rack (2.0.3)
|
101
|
+
rack-pjax (1.0.0)
|
90
102
|
nokogiri (~> 1.5)
|
91
|
-
rack (
|
103
|
+
rack (>= 1.1)
|
92
104
|
rack-test (0.6.3)
|
93
105
|
rack (>= 1.0)
|
94
|
-
rails (
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
nokogiri (~> 1.6.0)
|
110
|
-
rails-deprecated_sanitizer (>= 1.0.1)
|
106
|
+
rails (5.1.3)
|
107
|
+
actioncable (= 5.1.3)
|
108
|
+
actionmailer (= 5.1.3)
|
109
|
+
actionpack (= 5.1.3)
|
110
|
+
actionview (= 5.1.3)
|
111
|
+
activejob (= 5.1.3)
|
112
|
+
activemodel (= 5.1.3)
|
113
|
+
activerecord (= 5.1.3)
|
114
|
+
activesupport (= 5.1.3)
|
115
|
+
bundler (>= 1.3.0)
|
116
|
+
railties (= 5.1.3)
|
117
|
+
sprockets-rails (>= 2.0.0)
|
118
|
+
rails-dom-testing (2.0.3)
|
119
|
+
activesupport (>= 4.2.0)
|
120
|
+
nokogiri (>= 1.6)
|
111
121
|
rails-html-sanitizer (1.0.3)
|
112
122
|
loofah (~> 2.0)
|
113
|
-
rails_admin (
|
123
|
+
rails_admin (1.2.0)
|
114
124
|
builder (~> 3.1)
|
115
125
|
coffee-rails (~> 4.0)
|
116
126
|
font-awesome-rails (>= 3.0, < 5)
|
117
|
-
haml (
|
127
|
+
haml (>= 4.0, < 6)
|
118
128
|
jquery-rails (>= 3.0, < 5)
|
119
129
|
jquery-ui-rails (~> 5.0)
|
120
|
-
kaminari (
|
130
|
+
kaminari (>= 0.14, < 2.0)
|
121
131
|
nested_form (~> 0.3)
|
122
|
-
rack-pjax (
|
123
|
-
rails (
|
124
|
-
remotipart (~> 1.
|
125
|
-
safe_yaml (~> 1.0)
|
132
|
+
rack-pjax (>= 0.7)
|
133
|
+
rails (>= 4.0, < 6)
|
134
|
+
remotipart (~> 1.3)
|
126
135
|
sass-rails (>= 4.0, < 6)
|
127
|
-
railties (
|
128
|
-
actionpack (=
|
129
|
-
activesupport (=
|
136
|
+
railties (5.1.3)
|
137
|
+
actionpack (= 5.1.3)
|
138
|
+
activesupport (= 5.1.3)
|
139
|
+
method_source
|
130
140
|
rake (>= 0.8.7)
|
131
141
|
thor (>= 0.18.1, < 2.0)
|
132
|
-
rake (
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
142
|
+
rake (12.0.0)
|
143
|
+
rb-fsevent (0.10.2)
|
144
|
+
rb-inotify (0.9.10)
|
145
|
+
ffi (>= 0.5.0, < 2)
|
146
|
+
remotipart (1.3.1)
|
147
|
+
sass (3.5.1)
|
148
|
+
sass-listen (~> 4.0.0)
|
149
|
+
sass-listen (4.0.0)
|
150
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
151
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
152
|
+
sass-rails (5.0.6)
|
153
|
+
railties (>= 4.0.0, < 6)
|
138
154
|
sass (~> 3.1)
|
139
155
|
sprockets (>= 2.8, < 4.0)
|
140
156
|
sprockets-rails (>= 2.0, < 4.0)
|
141
157
|
tilt (>= 1.1, < 3)
|
142
|
-
sprockets (3.
|
158
|
+
sprockets (3.7.1)
|
143
159
|
concurrent-ruby (~> 1.0)
|
144
160
|
rack (> 1, < 3)
|
145
|
-
sprockets-rails (3.0
|
161
|
+
sprockets-rails (3.2.0)
|
146
162
|
actionpack (>= 4.0)
|
147
163
|
activesupport (>= 4.0)
|
148
164
|
sprockets (>= 3.0.0)
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
165
|
+
temple (0.8.0)
|
166
|
+
thor (0.19.4)
|
167
|
+
thread_safe (0.3.6)
|
168
|
+
tilt (2.0.8)
|
169
|
+
tzinfo (1.2.3)
|
153
170
|
thread_safe (~> 0.1)
|
171
|
+
websocket-driver (0.6.5)
|
172
|
+
websocket-extensions (>= 0.1.0)
|
173
|
+
websocket-extensions (0.1.2)
|
154
174
|
|
155
175
|
PLATFORMS
|
156
176
|
ruby
|
@@ -161,4 +181,4 @@ DEPENDENCIES
|
|
161
181
|
rake
|
162
182
|
|
163
183
|
BUNDLED WITH
|
164
|
-
1.
|
184
|
+
1.15.3
|
@@ -30,7 +30,7 @@ module RailsAdmin
|
|
30
30
|
end
|
31
31
|
if params['id'].present?
|
32
32
|
begin
|
33
|
-
@object = @abstract_model.model.unscoped.find(params['id'])
|
33
|
+
@object = @abstract_model.model.unscoped.lock.find(params['id'])
|
34
34
|
@meth = params[:method]
|
35
35
|
@object.send(@meth + '=', params[:on] == '1' ? true : false)
|
36
36
|
if @object.save
|
@@ -18,6 +18,10 @@ module RailsAdmin
|
|
18
18
|
:boolean
|
19
19
|
end
|
20
20
|
|
21
|
+
register_instance_option :ajax do
|
22
|
+
true
|
23
|
+
end
|
24
|
+
|
21
25
|
register_instance_option :pretty_value do
|
22
26
|
def g_js
|
23
27
|
<<-END.strip_heredoc.gsub("\n", ' ').gsub(/ +/, ' ')
|
@@ -41,13 +45,21 @@ module RailsAdmin
|
|
41
45
|
return false;
|
42
46
|
END
|
43
47
|
end
|
48
|
+
|
44
49
|
def g_link(fv, on, badge)
|
50
|
+
options = { class: 'toggle-btn label ' + badge }
|
51
|
+
|
52
|
+
if self.ajax
|
53
|
+
options[:onclick] = g_js
|
54
|
+
else
|
55
|
+
options[:method] = :post
|
56
|
+
options[:onclick] = "$(this).html(\"<i class='fa fa-spinner fa-spin'></i>\");"
|
57
|
+
end
|
58
|
+
|
45
59
|
bindings[:view].link_to(
|
46
60
|
fv.html_safe,
|
47
|
-
toggle_path(model_name: @abstract_model, id: bindings[:object].id, method: name, on: on.to_s),
|
48
|
-
|
49
|
-
class: 'toggle-btn label ' + badge,
|
50
|
-
onclick: g_js
|
61
|
+
bindings[:view].toggle_path(model_name: @abstract_model, id: bindings[:object].id, method: name, on: on.to_s),
|
62
|
+
options
|
51
63
|
)
|
52
64
|
end
|
53
65
|
|
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
19
|
-
|
19
|
+
|
20
20
|
gem.add_dependency "rails_admin"
|
21
21
|
|
22
22
|
gem.add_development_dependency "bundler"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_admin_toggleable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gleb Tv
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails_admin
|
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
95
|
version: '0'
|
96
96
|
requirements: []
|
97
97
|
rubyforge_project:
|
98
|
-
rubygems_version: 2.
|
98
|
+
rubygems_version: 2.6.11
|
99
99
|
signing_key:
|
100
100
|
specification_version: 4
|
101
101
|
summary: Make any boolean field easily toggleable on\off from index view in rails
|