active_scaffold_export 3.10.1 → 3.11.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d5312e7623d39bea07a170c97a09ded3d0b8e4098be2f0a6a5f25a89a0e8504
|
4
|
+
data.tar.gz: 0a97a570324341b12eba83242da5f13bd98b93c0d84bae2c5bb07616fc981ce1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07610bac0c7d18ff5ce0875cc4c0eac12e65a8283f49bc3842ac39bfc397de99d932279bbe331f3114896bf9e6f675cd241f9d0788ce914e46c18a938ebaf1ff
|
7
|
+
data.tar.gz: 53d34e052c132b57229c27daff2af74f3ba8dcb1a522097fff9dc63c681b12372baaf155fadf65e3b483cf039a26f3a679324a34d7fa723fda5dcee70e8c8cc7
|
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,4 +1,3 @@
|
|
1
|
-
<% export_config = active_scaffold_config.export %>
|
2
1
|
<h3><%=as_(:columns_for_export)%></h3>
|
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' %>
|
@@ -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>
|
@@ -18,30 +17,17 @@
|
|
18
17
|
<div class="separator"></div>
|
19
18
|
<h3><%=as_(:options)%></h3>
|
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>
|
@@ -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
|
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.0
|
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: 2025-
|
13
|
+
date: 2025-09-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: active_scaffold
|