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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3129ecc7a827c1e0f9d4052d2661751d8ed18124dd041b616694b6b74edfc511
4
- data.tar.gz: 03d88fa2f813a8b841aa64f5de94439d7c4392e30e729641dc2f46076741d35b
3
+ metadata.gz: 79618eaca45b5eb8b3d9cd135b50e8b06e5fee7790a81fbaaa43a4cae1b7f2dd
4
+ data.tar.gz: 77fc4fa78545ed55feeae82e229eb807008faaf2086d538779ed6e53b372efe9
5
5
  SHA512:
6
- metadata.gz: 50b9a7a2e813c0526da48a17c2dc72ed8ce72cdadc4618e30b832ba48a7913c94e211f34954c5c16e67b1b655a5b96d8b1219fa23d028420bb15b5f34e39d625
7
- data.tar.gz: b45b8846a4ccae25bea17e4eda5573931f6346b913ff16029b09bac721b82f90c77911085b0e76133584ff6920160d97414be02394c0a191286fdab53623df01
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
- 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,5 +1,5 @@
1
1
  .active-scaffold-header div.actions a.show_export {
2
- background-image: url(<%= asset_path 'export.png' %>);
2
+ background-image: url('active_scaffold/export.png');
3
3
  background-position: 1px 50%;
4
4
  background-repeat: no-repeat;
5
5
  padding-left: 19px;
@@ -1,5 +1,4 @@
1
- <% export_config = active_scaffold_config.export %>
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, !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>
@@ -16,32 +15,19 @@
16
15
  &nbsp;
17
16
  </div>
18
17
  <div class="separator"></div>
19
- <h3><%=as_(:options)%></h3>
18
+ <h5><%=as_(:options)%></h5>
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>
@@ -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.clone
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,7 +1,7 @@
1
1
  module ActiveScaffoldExport
2
2
  module Version
3
3
  MAJOR = 3
4
- MINOR = 10
4
+ MINOR = 11
5
5
  PATCH = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
@@ -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.10.1
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: 2025-06-26 00:00:00.000000000 Z
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.erb
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