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: 3129ecc7a827c1e0f9d4052d2661751d8ed18124dd041b616694b6b74edfc511
4
- data.tar.gz: 03d88fa2f813a8b841aa64f5de94439d7c4392e30e729641dc2f46076741d35b
3
+ metadata.gz: 2d5312e7623d39bea07a170c97a09ded3d0b8e4098be2f0a6a5f25a89a0e8504
4
+ data.tar.gz: 0a97a570324341b12eba83242da5f13bd98b93c0d84bae2c5bb07616fc981ce1
5
5
  SHA512:
6
- metadata.gz: 50b9a7a2e813c0526da48a17c2dc72ed8ce72cdadc4618e30b832ba48a7913c94e211f34954c5c16e67b1b655a5b96d8b1219fa23d028420bb15b5f34e39d625
7
- data.tar.gz: b45b8846a4ccae25bea17e4eda5573931f6346b913ff16029b09bac721b82f90c77911085b0e76133584ff6920160d97414be02394c0a191286fdab53623df01
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
- header styling override will be added soon.
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, !export_config.default_deselected_columns.include?(column.name), :class => 'columnCheckbox') %>
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
- <div class="option checkbox-wrapper">
22
- <%= content_tag(:label, check_box_tag('skip_header', 1, export_config.default_skip_header) + " #{as_(:omit_header)}".html_safe) %>
23
- </div>
24
- <div class="option checkbox-wrapper">
25
- <%= content_tag(:label, text_field_tag('delimiter', export_config.default_delimiter, :size => 1, :maxlength => 1) + " #{as_(:delimiter)}".html_safe) %>
26
- </div>
27
- <div class="separator"></div>
28
- <% if export_config.allow_full_download %>
29
- <div class="option checkbox-wrapper">
30
- <%= content_tag(:label, radio_button_tag('full_download', false, !export_config.default_full_download) + " #{as_(:this_page)}".html_safe) %>
31
- </div>
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
  &nbsp;
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
@@ -1,8 +1,8 @@
1
1
  module ActiveScaffoldExport
2
2
  module Version
3
3
  MAJOR = 3
4
- MINOR = 10
5
- PATCH = 1
4
+ MINOR = 11
5
+ PATCH = 0
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  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.10.1
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-06-26 00:00:00.000000000 Z
13
+ date: 2025-09-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: active_scaffold