active_scaffold_export 3.10.1 → 3.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +10 -2
- data/app/assets/stylesheets/{active_scaffold_export.css.erb → active_scaffold_export.css} +1 -1
- data/app/views/active_scaffold_overrides/_export_form_body.html.erb +14 -28
- data/lib/active_scaffold/actions/export.rb +1 -1
- data/lib/active_scaffold/helpers/export_helpers.rb +22 -0
- data/lib/active_scaffold_export/version.rb +1 -1
- data/lib/active_scaffold_export.rb +1 -3
- metadata +4 -4
- /data/app/assets/images/{export.png → active_scaffold/export.png} +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 79618eaca45b5eb8b3d9cd135b50e8b06e5fee7790a81fbaaa43a4cae1b7f2dd
|
|
4
|
+
data.tar.gz: 77fc4fa78545ed55feeae82e229eb807008faaf2086d538779ed6e53b372efe9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f01f9d182418c6b262082c692bd069d89126fc37de60487261b85b5bae074ef99d82476e17f80a4126056e848f266eb51fa1bc8f4b09d96a3880c7b408bfb0ef
|
|
7
|
+
data.tar.gz: 2a36267df4bc7b9f2ec8e3e7bc14dc27d36c7effdfccfc8ab29563637c9ff3a4d7135e31c8859be18e1fb3f4ba6dd0780cdd7f24b526e83aecab381f1f777801
|
data/README.md
CHANGED
|
@@ -39,6 +39,11 @@ conf.export.force_quotes = "true"
|
|
|
39
39
|
```
|
|
40
40
|
And enjoy happy exporting :)
|
|
41
41
|
|
|
42
|
+
### Configuring
|
|
43
|
+
|
|
44
|
+
There are other options for the action export, explained in the wiki [Export Configuration](https://github.com/activescaffold/active_scaffold_export/wiki/Export-Configuration),
|
|
45
|
+
and it's possible to define [helper overrides](https://github.com/activescaffold/active_scaffold_export/wiki/Helper-Overrides) to change the exported value.
|
|
46
|
+
|
|
42
47
|
### Security
|
|
43
48
|
It's controlled the same way as Active Scaffold. The extra actions added are:
|
|
44
49
|
* **:show_export** for the options form
|
|
@@ -56,8 +61,11 @@ active_scaffold:
|
|
|
56
61
|
```
|
|
57
62
|
|
|
58
63
|
### XLSX support
|
|
59
|
-
This support depends on caxlsx_rails and caxlsx of course
|
|
60
|
-
|
|
64
|
+
This support depends on caxlsx_rails and caxlsx of course, and supports changing the style of cells and headers, as explained
|
|
65
|
+
in the wiki [Cell Format Options](https://github.com/activescaffold/active_scaffold_export/wiki/Cell-Format-Options). Also,
|
|
66
|
+
the [helper overrides](https://github.com/activescaffold/active_scaffold_export/wiki/Helper-Overrides#column-helper) may return
|
|
67
|
+
a hash with format options besides the value.
|
|
68
|
+
|
|
61
69
|
NOTE: There's NO streaming support for xlsx format. Only CSV. So if your data is huge, set default_file_format to 'csv' instead.
|
|
62
70
|
Streaming in xlsx will never be supported since the entire file needs to be serialized and zipped to be a valid OOXML file.
|
|
63
71
|
So, rather than streaming, background jobs will be the most likely future approach.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
<h3><%=as_(:columns_for_export)%></h3>
|
|
1
|
+
<h5><%=as_(:columns_for_export)%></h5>
|
|
3
2
|
<%# TODO: use JS asset instead of inline JS %>
|
|
4
3
|
<%= link_to as_(:select_all), '#', onclick: 'jQuery(".columnCheckbox").prop("checked", true); return false', class: 'active-scaffold-footer' %>
|
|
5
4
|
|
|
|
@@ -8,7 +7,7 @@
|
|
|
8
7
|
<% export_columns_names(true).each_column do |column| -%>
|
|
9
8
|
<div class="column checkbox-wrapper">
|
|
10
9
|
<label>
|
|
11
|
-
<%= check_box_tag("export_columns[#{column.name}]", 1, !
|
|
10
|
+
<%= check_box_tag("export_columns[#{column.name}]", 1, !active_scaffold_config.export.default_deselected_columns.include?(column.name), :class => 'columnCheckbox') %>
|
|
12
11
|
<%= column_heading_label(column) %>
|
|
13
12
|
</label>
|
|
14
13
|
</div>
|
|
@@ -16,32 +15,19 @@
|
|
|
16
15
|
|
|
17
16
|
</div>
|
|
18
17
|
<div class="separator"></div>
|
|
19
|
-
<
|
|
18
|
+
<h5><%=as_(:options)%></h5>
|
|
20
19
|
<div class="options checkbox-list">
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<div class="option checkbox-wrapper">
|
|
33
|
-
<%= content_tag(:label, radio_button_tag('full_download', true, export_config.default_full_download) + " #{as_(:all_pages)}".html_safe) %>
|
|
34
|
-
</div>
|
|
35
|
-
<div class="separator"></div>
|
|
36
|
-
<% end %>
|
|
37
|
-
<% if export_config.formats.many? %>
|
|
38
|
-
<% export_config.formats.each do |format| %>
|
|
39
|
-
<div class="option checkbox-wrapper">
|
|
40
|
-
<%= content_tag(:label, safe_join([radio_button_tag('format', format, export_config.default_file_format.to_sym == format), format.upcase], ' ')) %>
|
|
41
|
-
</div>
|
|
42
|
-
<% end %>
|
|
43
|
-
<% else %>
|
|
44
|
-
<%= hidden_field_tag 'format', export_config.formats[0] %>
|
|
20
|
+
<% export_options.each do |row_optionss| %>
|
|
21
|
+
<% row_optionss.each do |(option, label)| %>
|
|
22
|
+
<div class="option checkbox-wrapper">
|
|
23
|
+
<% if label %>
|
|
24
|
+
<%= content_tag(:label, safe_join([option, label.is_a?(Symbol) ? as_(label) : label], ' ')) %>
|
|
25
|
+
<% else %>
|
|
26
|
+
<%= option %>
|
|
27
|
+
<% end %>
|
|
28
|
+
</div>
|
|
29
|
+
<% end %>
|
|
30
|
+
<div class="separator"></div>
|
|
45
31
|
<% end %>
|
|
46
32
|
|
|
47
33
|
</div>
|
|
@@ -163,7 +163,7 @@ module ActiveScaffold::Actions
|
|
|
163
163
|
# The default name of the downloaded file.
|
|
164
164
|
# You may override the method to specify your own file name generation.
|
|
165
165
|
def export_file_name
|
|
166
|
-
filename = self.controller_name.
|
|
166
|
+
filename = self.controller_name.dup
|
|
167
167
|
|
|
168
168
|
if params[:format] && active_scaffold_config.export.formats.map(&:to_s).include?(params[:format])
|
|
169
169
|
filename << ".#{params[:format]}"
|
|
@@ -94,6 +94,28 @@ module ActiveScaffold
|
|
|
94
94
|
end
|
|
95
95
|
end
|
|
96
96
|
|
|
97
|
+
def export_options
|
|
98
|
+
export_config = active_scaffold_config.export
|
|
99
|
+
rows = []
|
|
100
|
+
rows << [
|
|
101
|
+
[check_box_tag('skip_header', 1, export_config.default_skip_header), :omit_header],
|
|
102
|
+
[text_field_tag('delimiter', export_config.default_delimiter, :size => 1, :maxlength => 1), :delimiter]
|
|
103
|
+
]
|
|
104
|
+
if export_config.allow_full_download
|
|
105
|
+
rows << [
|
|
106
|
+
[radio_button_tag('full_download', false, !export_config.default_full_download), :this_page],
|
|
107
|
+
[radio_button_tag('full_download', true, export_config.default_full_download), :all_pages]
|
|
108
|
+
]
|
|
109
|
+
end
|
|
110
|
+
if export_config.formats.many?
|
|
111
|
+
rows << export_config.formats.map do |format|
|
|
112
|
+
[radio_button_tag('format', format, export_config.default_file_format.to_sym == format), format.upcase.to_s]
|
|
113
|
+
end
|
|
114
|
+
else
|
|
115
|
+
rows << [hidden_field_tag('format', export_config.formats[0])]
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
97
119
|
end
|
|
98
120
|
end
|
|
99
121
|
end
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
ACTIVE_SCAFFOLD_EXPORT_GEM = true
|
|
2
|
-
ActiveScaffold rescue throw "should have included ActiveScaffold plug in first. Please make sure that this plug-in comes alphabetically after the ActiveScaffold plug-in"
|
|
3
|
-
|
|
4
1
|
require 'active_scaffold_export/engine'
|
|
5
2
|
require 'active_scaffold_export/version'
|
|
6
3
|
|
|
@@ -26,3 +23,4 @@ module ActiveScaffold
|
|
|
26
23
|
end
|
|
27
24
|
|
|
28
25
|
ActionView::Base.send(:include, ActiveScaffold::Helpers::ExportHelpers)
|
|
26
|
+
ActiveScaffold.stylesheets << 'active_scaffold_export'
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: active_scaffold_export
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.11.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Volker Hochstein
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 2026-03-23 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: active_scaffold
|
|
@@ -36,8 +36,8 @@ extra_rdoc_files:
|
|
|
36
36
|
files:
|
|
37
37
|
- LICENSE.txt
|
|
38
38
|
- README.md
|
|
39
|
-
- app/assets/images/export.png
|
|
40
|
-
- app/assets/stylesheets/active_scaffold_export.css
|
|
39
|
+
- app/assets/images/active_scaffold/export.png
|
|
40
|
+
- app/assets/stylesheets/active_scaffold_export.css
|
|
41
41
|
- app/assets/stylesheets/export-stylesheet-ie.css
|
|
42
42
|
- app/views/active_scaffold_overrides/_export.csv.erb
|
|
43
43
|
- app/views/active_scaffold_overrides/_export_form_body.html.erb
|
|
File without changes
|