administrate_exportable 0.4.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +103 -109
- data/README.md +4 -4
- data/administrate_exportable.gemspec +1 -1
- data/app/views/admin/application/_pagination.html.erb +1 -0
- data/app/views/admin/application/index.html.erb +4 -3
- data/lib/administrate_exportable/exporter.rb +1 -1
- data/lib/administrate_exportable/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c153e97f7f3678a5f424144b27e439d317dfd7dc3b35b4b763b7311f9e85040b
|
4
|
+
data.tar.gz: 4481c08660af65085ac925e07de371c83db4d545a17e76a39f11fdea1218a4eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d3b3306f68107196542c80bce17a06d107ebd3900daa6f48a65fb93bb47891eb299d0c272b7bcab6fc253751046f373fc6fe47f8d5c373e03df0aa54c39f8a0
|
7
|
+
data.tar.gz: 8f11708bc6fe6e362d59c3c193b0aacc1598a9b96986a1445565560e26e4ec16be0d8df790137862ea8b091ab2669c0d3a0be21e1a067b3ee966f268e8e8febe
|
data/Gemfile.lock
CHANGED
@@ -1,178 +1,172 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
administrate_exportable (0.
|
4
|
+
administrate_exportable (0.5.0)
|
5
5
|
actionview (>= 5.2.2.1)
|
6
|
-
administrate (>= 0.
|
6
|
+
administrate (>= 0.17.0)
|
7
7
|
rails (>= 4.2)
|
8
8
|
railties (>= 5.2.2.1)
|
9
9
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
actioncable (5.2.
|
14
|
-
actionpack (= 5.2.
|
13
|
+
actioncable (5.2.8)
|
14
|
+
actionpack (= 5.2.8)
|
15
15
|
nio4r (~> 2.0)
|
16
16
|
websocket-driver (>= 0.6.1)
|
17
|
-
actionmailer (5.2.
|
18
|
-
actionpack (= 5.2.
|
19
|
-
actionview (= 5.2.
|
20
|
-
activejob (= 5.2.
|
17
|
+
actionmailer (5.2.8)
|
18
|
+
actionpack (= 5.2.8)
|
19
|
+
actionview (= 5.2.8)
|
20
|
+
activejob (= 5.2.8)
|
21
21
|
mail (~> 2.5, >= 2.5.4)
|
22
22
|
rails-dom-testing (~> 2.0)
|
23
|
-
actionpack (5.2.
|
24
|
-
actionview (= 5.2.
|
25
|
-
activesupport (= 5.2.
|
23
|
+
actionpack (5.2.8)
|
24
|
+
actionview (= 5.2.8)
|
25
|
+
activesupport (= 5.2.8)
|
26
26
|
rack (~> 2.0, >= 2.0.8)
|
27
27
|
rack-test (>= 0.6.3)
|
28
28
|
rails-dom-testing (~> 2.0)
|
29
29
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
30
|
-
actionview (5.2.
|
31
|
-
activesupport (= 5.2.
|
30
|
+
actionview (5.2.8)
|
31
|
+
activesupport (= 5.2.8)
|
32
32
|
builder (~> 3.1)
|
33
33
|
erubi (~> 1.4)
|
34
34
|
rails-dom-testing (~> 2.0)
|
35
35
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
36
|
-
activejob (5.2.
|
37
|
-
activesupport (= 5.2.
|
36
|
+
activejob (5.2.8)
|
37
|
+
activesupport (= 5.2.8)
|
38
38
|
globalid (>= 0.3.6)
|
39
|
-
activemodel (5.2.
|
40
|
-
activesupport (= 5.2.
|
41
|
-
activerecord (5.2.
|
42
|
-
activemodel (= 5.2.
|
43
|
-
activesupport (= 5.2.
|
39
|
+
activemodel (5.2.8)
|
40
|
+
activesupport (= 5.2.8)
|
41
|
+
activerecord (5.2.8)
|
42
|
+
activemodel (= 5.2.8)
|
43
|
+
activesupport (= 5.2.8)
|
44
44
|
arel (>= 9.0)
|
45
|
-
activestorage (5.2.
|
46
|
-
actionpack (= 5.2.
|
47
|
-
activerecord (= 5.2.
|
48
|
-
marcel (~> 0.
|
49
|
-
activesupport (5.2.
|
45
|
+
activestorage (5.2.8)
|
46
|
+
actionpack (= 5.2.8)
|
47
|
+
activerecord (= 5.2.8)
|
48
|
+
marcel (~> 1.0.0)
|
49
|
+
activesupport (5.2.8)
|
50
50
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
51
51
|
i18n (>= 0.7, < 2)
|
52
52
|
minitest (~> 5.1)
|
53
53
|
tzinfo (~> 1.1)
|
54
|
-
administrate (0.
|
55
|
-
actionpack (>=
|
56
|
-
actionview (>=
|
57
|
-
activerecord (>=
|
58
|
-
autoprefixer-rails (>= 6.0)
|
54
|
+
administrate (0.17.0)
|
55
|
+
actionpack (>= 5.0)
|
56
|
+
actionview (>= 5.0)
|
57
|
+
activerecord (>= 5.0)
|
59
58
|
datetime_picker_rails (~> 0.0.7)
|
60
59
|
jquery-rails (>= 4.0)
|
61
60
|
kaminari (>= 1.0)
|
62
61
|
momentjs-rails (~> 2.8)
|
63
62
|
sassc-rails (~> 2.1)
|
64
63
|
selectize-rails (~> 0.6)
|
65
|
-
administrate-field-enumerate (0.0.
|
64
|
+
administrate-field-enumerate (0.0.2)
|
66
65
|
administrate
|
67
66
|
enumerate_it
|
68
|
-
rails (>= 4.2, <
|
67
|
+
rails (>= 4.2, < 7.0)
|
69
68
|
arel (9.0.0)
|
70
|
-
autoprefixer-rails (10.2.4.0)
|
71
|
-
execjs
|
72
69
|
builder (3.2.4)
|
73
|
-
byebug (11.
|
74
|
-
coderay (1.1.
|
75
|
-
concurrent-ruby (1.1.
|
70
|
+
byebug (11.1.3)
|
71
|
+
coderay (1.1.3)
|
72
|
+
concurrent-ruby (1.1.10)
|
76
73
|
crass (1.0.6)
|
77
74
|
datetime_picker_rails (0.0.7)
|
78
75
|
momentjs-rails (>= 2.8.1)
|
79
|
-
diff-lcs (1.
|
80
|
-
enumerate_it (2.
|
81
|
-
activesupport (>=
|
76
|
+
diff-lcs (1.5.0)
|
77
|
+
enumerate_it (3.2.2)
|
78
|
+
activesupport (>= 5.0.7.2)
|
82
79
|
erubi (1.10.0)
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
i18n (1.8.9)
|
80
|
+
ffi (1.15.5)
|
81
|
+
globalid (1.0.0)
|
82
|
+
activesupport (>= 5.0)
|
83
|
+
i18n (1.10.0)
|
88
84
|
concurrent-ruby (~> 1.0)
|
89
85
|
jquery-rails (4.4.0)
|
90
86
|
rails-dom-testing (>= 1, < 3)
|
91
87
|
railties (>= 4.2.0)
|
92
88
|
thor (>= 0.14, < 2.0)
|
93
|
-
kaminari (1.2.
|
89
|
+
kaminari (1.2.2)
|
94
90
|
activesupport (>= 4.1.0)
|
95
|
-
kaminari-actionview (= 1.2.
|
96
|
-
kaminari-activerecord (= 1.2.
|
97
|
-
kaminari-core (= 1.2.
|
98
|
-
kaminari-actionview (1.2.
|
91
|
+
kaminari-actionview (= 1.2.2)
|
92
|
+
kaminari-activerecord (= 1.2.2)
|
93
|
+
kaminari-core (= 1.2.2)
|
94
|
+
kaminari-actionview (1.2.2)
|
99
95
|
actionview
|
100
|
-
kaminari-core (= 1.2.
|
101
|
-
kaminari-activerecord (1.2.
|
96
|
+
kaminari-core (= 1.2.2)
|
97
|
+
kaminari-activerecord (1.2.2)
|
102
98
|
activerecord
|
103
|
-
kaminari-core (= 1.2.
|
104
|
-
kaminari-core (1.2.
|
105
|
-
loofah (2.
|
99
|
+
kaminari-core (= 1.2.2)
|
100
|
+
kaminari-core (1.2.2)
|
101
|
+
loofah (2.18.0)
|
106
102
|
crass (~> 1.0.2)
|
107
103
|
nokogiri (>= 1.5.9)
|
108
104
|
mail (2.7.1)
|
109
105
|
mini_mime (>= 0.1.1)
|
110
|
-
marcel (0.
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
minitest (5.14.4)
|
117
|
-
momentjs-rails (2.20.1)
|
106
|
+
marcel (1.0.2)
|
107
|
+
method_source (1.0.0)
|
108
|
+
mini_mime (1.1.2)
|
109
|
+
mini_portile2 (2.8.0)
|
110
|
+
minitest (5.15.0)
|
111
|
+
momentjs-rails (2.29.1.1)
|
118
112
|
railties (>= 3.1)
|
119
|
-
nio4r (2.5.
|
120
|
-
nokogiri (1.
|
121
|
-
mini_portile2 (~> 2.
|
113
|
+
nio4r (2.5.8)
|
114
|
+
nokogiri (1.13.6)
|
115
|
+
mini_portile2 (~> 2.8.0)
|
122
116
|
racc (~> 1.4)
|
123
|
-
pry (0.
|
124
|
-
coderay (~> 1.1
|
125
|
-
method_source (~>
|
126
|
-
pry-byebug (3.
|
117
|
+
pry (0.13.1)
|
118
|
+
coderay (~> 1.1)
|
119
|
+
method_source (~> 1.0)
|
120
|
+
pry-byebug (3.9.0)
|
127
121
|
byebug (~> 11.0)
|
128
|
-
pry (~> 0.
|
129
|
-
racc (1.
|
122
|
+
pry (~> 0.13.0)
|
123
|
+
racc (1.6.0)
|
130
124
|
rack (2.2.3)
|
131
125
|
rack-test (1.1.0)
|
132
126
|
rack (>= 1.0, < 3)
|
133
|
-
rails (5.2.
|
134
|
-
actioncable (= 5.2.
|
135
|
-
actionmailer (= 5.2.
|
136
|
-
actionpack (= 5.2.
|
137
|
-
actionview (= 5.2.
|
138
|
-
activejob (= 5.2.
|
139
|
-
activemodel (= 5.2.
|
140
|
-
activerecord (= 5.2.
|
141
|
-
activestorage (= 5.2.
|
142
|
-
activesupport (= 5.2.
|
127
|
+
rails (5.2.8)
|
128
|
+
actioncable (= 5.2.8)
|
129
|
+
actionmailer (= 5.2.8)
|
130
|
+
actionpack (= 5.2.8)
|
131
|
+
actionview (= 5.2.8)
|
132
|
+
activejob (= 5.2.8)
|
133
|
+
activemodel (= 5.2.8)
|
134
|
+
activerecord (= 5.2.8)
|
135
|
+
activestorage (= 5.2.8)
|
136
|
+
activesupport (= 5.2.8)
|
143
137
|
bundler (>= 1.3.0)
|
144
|
-
railties (= 5.2.
|
138
|
+
railties (= 5.2.8)
|
145
139
|
sprockets-rails (>= 2.0.0)
|
146
140
|
rails-dom-testing (2.0.3)
|
147
141
|
activesupport (>= 4.2.0)
|
148
142
|
nokogiri (>= 1.6)
|
149
|
-
rails-html-sanitizer (1.
|
143
|
+
rails-html-sanitizer (1.4.2)
|
150
144
|
loofah (~> 2.3)
|
151
|
-
railties (5.2.
|
152
|
-
actionpack (= 5.2.
|
153
|
-
activesupport (= 5.2.
|
145
|
+
railties (5.2.8)
|
146
|
+
actionpack (= 5.2.8)
|
147
|
+
activesupport (= 5.2.8)
|
154
148
|
method_source
|
155
149
|
rake (>= 0.8.7)
|
156
150
|
thor (>= 0.19.0, < 2.0)
|
157
|
-
rake (13.0.
|
151
|
+
rake (13.0.6)
|
158
152
|
rb-readline (0.5.5)
|
159
|
-
rspec-core (3.
|
160
|
-
rspec-support (~> 3.
|
161
|
-
rspec-expectations (3.
|
153
|
+
rspec-core (3.9.3)
|
154
|
+
rspec-support (~> 3.9.3)
|
155
|
+
rspec-expectations (3.9.4)
|
162
156
|
diff-lcs (>= 1.2.0, < 2.0)
|
163
|
-
rspec-support (~> 3.
|
164
|
-
rspec-mocks (3.
|
157
|
+
rspec-support (~> 3.9.0)
|
158
|
+
rspec-mocks (3.9.1)
|
165
159
|
diff-lcs (>= 1.2.0, < 2.0)
|
166
|
-
rspec-support (~> 3.
|
167
|
-
rspec-rails (3.
|
160
|
+
rspec-support (~> 3.9.0)
|
161
|
+
rspec-rails (3.9.1)
|
168
162
|
actionpack (>= 3.0)
|
169
163
|
activesupport (>= 3.0)
|
170
164
|
railties (>= 3.0)
|
171
|
-
rspec-core (~> 3.
|
172
|
-
rspec-expectations (~> 3.
|
173
|
-
rspec-mocks (~> 3.
|
174
|
-
rspec-support (~> 3.
|
175
|
-
rspec-support (3.
|
165
|
+
rspec-core (~> 3.9.0)
|
166
|
+
rspec-expectations (~> 3.9.0)
|
167
|
+
rspec-mocks (~> 3.9.0)
|
168
|
+
rspec-support (~> 3.9.0)
|
169
|
+
rspec-support (3.9.4)
|
176
170
|
sassc (2.4.0)
|
177
171
|
ffi (~> 1.9)
|
178
172
|
sassc-rails (2.1.2)
|
@@ -182,20 +176,20 @@ GEM
|
|
182
176
|
sprockets-rails
|
183
177
|
tilt
|
184
178
|
selectize-rails (0.12.6)
|
185
|
-
sprockets (4.0.
|
179
|
+
sprockets (4.0.3)
|
186
180
|
concurrent-ruby (~> 1.0)
|
187
181
|
rack (> 1, < 3)
|
188
|
-
sprockets-rails (3.
|
189
|
-
actionpack (>=
|
190
|
-
activesupport (>=
|
182
|
+
sprockets-rails (3.4.2)
|
183
|
+
actionpack (>= 5.2)
|
184
|
+
activesupport (>= 5.2)
|
191
185
|
sprockets (>= 3.0.0)
|
192
|
-
sqlite3 (1.4.
|
193
|
-
thor (1.1
|
186
|
+
sqlite3 (1.4.2)
|
187
|
+
thor (1.2.1)
|
194
188
|
thread_safe (0.3.6)
|
195
189
|
tilt (2.0.10)
|
196
190
|
tzinfo (1.2.9)
|
197
191
|
thread_safe (~> 0.1)
|
198
|
-
websocket-driver (0.7.
|
192
|
+
websocket-driver (0.7.5)
|
199
193
|
websocket-extensions (>= 0.1.0)
|
200
194
|
websocket-extensions (0.1.5)
|
201
195
|
|
@@ -203,7 +197,7 @@ PLATFORMS
|
|
203
197
|
ruby
|
204
198
|
|
205
199
|
DEPENDENCIES
|
206
|
-
administrate (~> 0.
|
200
|
+
administrate (~> 0.17.0)
|
207
201
|
administrate-field-enumerate
|
208
202
|
administrate_exportable!
|
209
203
|
byebug
|
@@ -217,4 +211,4 @@ RUBY VERSION
|
|
217
211
|
ruby 2.7.2p137
|
218
212
|
|
219
213
|
BUNDLED WITH
|
220
|
-
2.
|
214
|
+
2.2.17
|
data/README.md
CHANGED
@@ -56,7 +56,7 @@ ATTRIBUTE_TYPES = {
|
|
56
56
|
|
57
57
|
By default the gem adds the Export button to the view `views/admin/application/index.html.erb`. But if you have your own Administrate `index` views, you can add the link manually:
|
58
58
|
```ruby
|
59
|
-
link_to('Export', [:export, namespace, page.resource_name.to_s.pluralize, sanitized_order_params(page, :id).to_h.merge(format: :csv)], class: 'button') if valid_action?(:export)
|
59
|
+
link_to('Export', [:export, namespace.to_sym, page.resource_name.to_s.pluralize.to_sym, sanitized_order_params(page, :id).to_h.merge(format: :csv)], class: 'button') if valid_action?(:export)
|
60
60
|
```
|
61
61
|
|
62
62
|
Example:
|
@@ -69,15 +69,15 @@ Example:
|
|
69
69
|
"administrate.actions.new_resource",
|
70
70
|
name: page.resource_name.titleize.downcase
|
71
71
|
),
|
72
|
-
[:new, namespace, page.resource_path],
|
72
|
+
[:new, namespace.to_sym, page.resource_path.to_sym],
|
73
73
|
class: "button",
|
74
74
|
) if valid_action?(:new) && show_action?(:new, new_resource) %>
|
75
75
|
|
76
76
|
<%= link_to(
|
77
77
|
'Export',
|
78
|
-
[:export, namespace, page.resource_name.to_s.pluralize, sanitized_order_params(page, :id).to_h.merge(format: :csv)],
|
78
|
+
[:export, namespace.to_sym, page.resource_name.to_s.pluralize.to_sym, sanitized_order_params(page, :id).to_h.merge(format: :csv)],
|
79
79
|
class: 'button'
|
80
|
-
) if valid_action?(:export) %>
|
80
|
+
) if valid_action?(:export) %>
|
81
81
|
</div>
|
82
82
|
....
|
83
83
|
```
|
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.add_development_dependency "rake", "~> 10.0"
|
34
34
|
spec.add_development_dependency "rspec", "~> 3.0"
|
35
35
|
spec.add_development_dependency "pry-byebug", "~> 3.0"
|
36
|
-
spec.add_dependency 'administrate','>= 0.
|
36
|
+
spec.add_dependency 'administrate','>= 0.17.0'
|
37
37
|
spec.add_dependency 'rails', '>= 4.2'
|
38
38
|
spec.add_dependency 'actionview', '>= 5.2.2.1'
|
39
39
|
spec.add_dependency 'railties', '>= 5.2.2.1'
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= paginate resources, param_name: AdministrateExportable::PAGE_PARAM %>
|
@@ -47,8 +47,9 @@ It renders the `_table` partial to display details about the resources.
|
|
47
47
|
) if valid_action?(:new) && show_action?(:new, new_resource) %>
|
48
48
|
<%= link_to(
|
49
49
|
'Export',
|
50
|
-
[:export, namespace, page.resource_name.to_s.pluralize, sanitized_order_params(page, :id).to_h.merge(format: :csv)],
|
51
|
-
class: 'button'
|
50
|
+
[:export, namespace, page.resource_name.to_s.pluralize.to_sym, sanitized_order_params(page, :id).to_h.merge(format: :csv)],
|
51
|
+
class: 'button',
|
52
|
+
target: '_blank'
|
52
53
|
) if valid_action?(:export) && show_action?(:export, resource_name) %>
|
53
54
|
</div>
|
54
55
|
</header>
|
@@ -63,5 +64,5 @@ It renders the `_table` partial to display details about the resources.
|
|
63
64
|
table_title: "page-title"
|
64
65
|
) %>
|
65
66
|
|
66
|
-
<%=
|
67
|
+
<%= render("pagination", resources: resources) %>
|
67
68
|
</section>
|
@@ -11,7 +11,7 @@ module AdministrateExportable
|
|
11
11
|
define_method(:export) do
|
12
12
|
search_term = params[:search].to_s.strip
|
13
13
|
resources = Administrate::Search.new(scoped_resource,
|
14
|
-
|
14
|
+
dashboard,
|
15
15
|
search_term).run
|
16
16
|
resources = apply_collection_includes(resources)
|
17
17
|
resources = order.apply(resources)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: administrate_exportable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jônatas Rancan
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-09-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -73,14 +73,14 @@ dependencies:
|
|
73
73
|
requirements:
|
74
74
|
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: 0.
|
76
|
+
version: 0.17.0
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: 0.
|
83
|
+
version: 0.17.0
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: rails
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,6 +140,7 @@ files:
|
|
140
140
|
- README.md
|
141
141
|
- Rakefile
|
142
142
|
- administrate_exportable.gemspec
|
143
|
+
- app/views/admin/application/_pagination.html.erb
|
143
144
|
- app/views/admin/application/index.html.erb
|
144
145
|
- bin/console
|
145
146
|
- bin/setup
|