active_scaffold_export_vho 3.0.1 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/active_scaffold_export_vho.gemspec +12 -17
- data/{frontends/default → app/assets}/images/export.png +0 -0
- data/{frontends/default/stylesheets/export-stylesheet.css → app/assets/stylesheets/active_scaffold_export.css.erb} +10 -0
- data/{frontends/default → app/assets}/stylesheets/export-stylesheet-ie.css +0 -0
- data/frontends/default/views/_export.csv.erb +4 -1
- data/lib/active_scaffold/actions/export.rb +1 -0
- data/lib/active_scaffold/helpers/export_helpers.rb +0 -16
- data/lib/active_scaffold_export.rb +4 -14
- data/lib/active_scaffold_export/engine.rb +8 -0
- data/lib/active_scaffold_export/version.rb +2 -2
- metadata +25 -55
data/Rakefile
CHANGED
@@ -22,7 +22,7 @@ Jeweler::Tasks.new do |gem|
|
|
22
22
|
gem.description = %Q{Exporting Records with ActiveScaffold}
|
23
23
|
gem.email = "activescaffold@googlegroups.com"
|
24
24
|
gem.authors = ["Volker Hochstein"]
|
25
|
-
gem.add_runtime_dependency 'active_scaffold_vho', '~> 3.
|
25
|
+
gem.add_runtime_dependency 'active_scaffold_vho', '~> 3.1'
|
26
26
|
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
27
27
|
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
28
28
|
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{active_scaffold_export_vho}
|
8
|
-
s.version = "3.0
|
8
|
+
s.version = "3.1.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Volker Hochstein"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-11-23}
|
13
13
|
s.description = %q{Exporting Records with ActiveScaffold}
|
14
14
|
s.email = %q{activescaffold@googlegroups.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -22,9 +22,9 @@ Gem::Specification.new do |s|
|
|
22
22
|
"README",
|
23
23
|
"Rakefile",
|
24
24
|
"active_scaffold_export_vho.gemspec",
|
25
|
-
"
|
26
|
-
"
|
27
|
-
"
|
25
|
+
"app/assets/images/export.png",
|
26
|
+
"app/assets/stylesheets/active_scaffold_export.css.erb",
|
27
|
+
"app/assets/stylesheets/export-stylesheet-ie.css",
|
28
28
|
"frontends/default/views/_export.csv.erb",
|
29
29
|
"frontends/default/views/_export_form_body.html.erb",
|
30
30
|
"frontends/default/views/_show_export.html.erb",
|
@@ -35,6 +35,7 @@ Gem::Specification.new do |s|
|
|
35
35
|
"lib/active_scaffold/helpers/export_helpers.rb",
|
36
36
|
"lib/active_scaffold_export.rb",
|
37
37
|
"lib/active_scaffold_export/config/core.rb",
|
38
|
+
"lib/active_scaffold_export/engine.rb",
|
38
39
|
"lib/active_scaffold_export/version.rb",
|
39
40
|
"lib/active_scaffold_export_vho.rb"
|
40
41
|
]
|
@@ -49,24 +50,18 @@ Gem::Specification.new do |s|
|
|
49
50
|
s.specification_version = 3
|
50
51
|
|
51
52
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
52
|
-
s.add_development_dependency(%q<
|
53
|
-
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
54
|
-
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
|
53
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
55
54
|
s.add_development_dependency(%q<rcov>, [">= 0"])
|
56
|
-
s.add_runtime_dependency(%q<active_scaffold_vho>, ["~> 3.
|
55
|
+
s.add_runtime_dependency(%q<active_scaffold_vho>, ["~> 3.1"])
|
57
56
|
else
|
58
|
-
s.add_dependency(%q<
|
59
|
-
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
60
|
-
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
57
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
61
58
|
s.add_dependency(%q<rcov>, [">= 0"])
|
62
|
-
s.add_dependency(%q<active_scaffold_vho>, ["~> 3.
|
59
|
+
s.add_dependency(%q<active_scaffold_vho>, ["~> 3.1"])
|
63
60
|
end
|
64
61
|
else
|
65
|
-
s.add_dependency(%q<
|
66
|
-
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
67
|
-
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
62
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
68
63
|
s.add_dependency(%q<rcov>, [">= 0"])
|
69
|
-
s.add_dependency(%q<active_scaffold_vho>, ["~> 3.
|
64
|
+
s.add_dependency(%q<active_scaffold_vho>, ["~> 3.1"])
|
70
65
|
end
|
71
66
|
end
|
72
67
|
|
File without changes
|
@@ -1,4 +1,5 @@
|
|
1
1
|
.active-scaffold-header div.actions a.show_export {
|
2
|
+
background-image: url(<%= asset_path 'export.png' %>);
|
2
3
|
background-image: url(../../../images/active_scaffold/default/export.png);
|
3
4
|
background-position: 1px 50%;
|
4
5
|
background-repeat: no-repeat;
|
@@ -25,3 +26,12 @@
|
|
25
26
|
.active-scaffold div.show_export-view label #delimiter {
|
26
27
|
font-family: monospace;
|
27
28
|
}
|
29
|
+
|
30
|
+
.as_touch .active-scaffold-header div.actions a.show_export {
|
31
|
+
padding: 7px 5px 7px 25px;
|
32
|
+
}
|
33
|
+
|
34
|
+
.as_touch .active-scaffold .active-scaffold-header div.actions > a.show_export {
|
35
|
+
padding: 7px 5px 7px 25px;
|
36
|
+
background-position: 5px 50%;
|
37
|
+
}
|
File without changes
|
@@ -1,4 +1,6 @@
|
|
1
1
|
<%
|
2
|
+
require 'csv' if RUBY_VERSION >= "1.9"
|
3
|
+
|
2
4
|
fcsv_options = {
|
3
5
|
:row_sep => "\n",
|
4
6
|
:col_sep => params[:delimiter],
|
@@ -6,7 +8,8 @@
|
|
6
8
|
:headers => @export_columns.collect { |column| format_export_column_header_name(column) }
|
7
9
|
}
|
8
10
|
|
9
|
-
|
11
|
+
csv_lib = Object.const_defined?('CSV') ? CSV : FasterCSV
|
12
|
+
data = csv_lib.generate(fcsv_options) do |csv|
|
10
13
|
csv << fcsv_options[:headers] unless params[:skip_header] == 'true'
|
11
14
|
@records.each do |record|
|
12
15
|
csv << @export_columns.collect { |column|
|
@@ -66,6 +66,7 @@ module ActiveScaffold::Actions
|
|
66
66
|
do_segment_search rescue nil
|
67
67
|
unless params[:full_download] == 'true'
|
68
68
|
find_options.merge!({
|
69
|
+
:pagination => active_scaffold_config.list.pagination,
|
69
70
|
:per_page => active_scaffold_config.list.user.per_page,
|
70
71
|
:page => active_scaffold_config.list.user.page
|
71
72
|
})
|
@@ -2,22 +2,6 @@ module ActiveScaffold
|
|
2
2
|
module Helpers
|
3
3
|
# Helpers that assist with the rendering of a Export Column
|
4
4
|
module ExportHelpers
|
5
|
-
def self.included(base)
|
6
|
-
base.alias_method_chain :active_scaffold_stylesheets, :export
|
7
|
-
base.alias_method_chain :active_scaffold_ie_stylesheets, :export
|
8
|
-
end
|
9
|
-
|
10
|
-
# Provides stylesheets to include with +stylesheet_link_tag+
|
11
|
-
def active_scaffold_stylesheets_with_export(frontend = :default)
|
12
|
-
active_scaffold_stylesheets_without_export.to_a << ActiveScaffold::Config::Core.asset_path("export-stylesheet.css", frontend)
|
13
|
-
end
|
14
|
-
|
15
|
-
|
16
|
-
# Provides stylesheets for IE to include with +stylesheet_link_tag+
|
17
|
-
def active_scaffold_ie_stylesheets_with_export(frontend = :default)
|
18
|
-
active_scaffold_ie_stylesheets_without_export.to_a << ActiveScaffold::Config::Core.asset_path("export-stylesheet-ie.css", frontend)
|
19
|
-
end
|
20
|
-
|
21
5
|
## individual columns can be overridden by defining
|
22
6
|
# a helper method <column_name>_export_column(record)
|
23
7
|
# You can customize the output of all columns by
|
@@ -1,5 +1,8 @@
|
|
1
1
|
ActiveScaffold rescue throw "should have included ActiveScaffold plug in first. Please make sure that this plug-in comes alphabetically after the ActiveScaffold plug-in"
|
2
2
|
|
3
|
+
require 'active_scaffold_export/engine'
|
4
|
+
require 'active_scaffold_export/version'
|
5
|
+
|
3
6
|
# Load our overrides
|
4
7
|
require "active_scaffold_export/config/core.rb"
|
5
8
|
|
@@ -23,17 +26,4 @@ module ActiveScaffold
|
|
23
26
|
end
|
24
27
|
end
|
25
28
|
|
26
|
-
ActionView::Base.send(:include, ActiveScaffold::Helpers::ExportHelpers)
|
27
|
-
|
28
|
-
|
29
|
-
##
|
30
|
-
## Run the install assets script, too, just to make sure
|
31
|
-
## But at least rescue the action in production
|
32
|
-
##
|
33
|
-
Rails::Application.initializer("active_scaffold_export.install_assets", :after => "active_scaffold.install_assets") do
|
34
|
-
begin
|
35
|
-
ActiveScaffoldAssets.copy_to_public(ActiveScaffoldExport.root)
|
36
|
-
rescue
|
37
|
-
raise $! unless Rails.env == 'production'
|
38
|
-
end
|
39
|
-
end if defined?(ACTIVE_SCAFFOLD_EXPORT_GEM)
|
29
|
+
ActionView::Base.send(:include, ActiveScaffold::Helpers::ExportHelpers)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_scaffold_export_vho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 5
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 3
|
8
|
-
- 0
|
9
7
|
- 1
|
10
|
-
|
8
|
+
- 0
|
9
|
+
segments_generated: true
|
10
|
+
version: 3.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Volker Hochstein
|
@@ -15,84 +15,52 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-11-23 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
-
|
23
|
-
|
24
|
-
version_requirements: &id001 !ruby/object:Gem::Requirement
|
22
|
+
name: jeweler
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
24
|
none: false
|
26
25
|
requirements:
|
27
26
|
- - ">="
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 3
|
30
28
|
segments:
|
31
29
|
- 0
|
30
|
+
segments_generated: true
|
32
31
|
version: "0"
|
33
|
-
requirement: *id001
|
34
|
-
type: :development
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
prerelease: false
|
37
|
-
name: bundler
|
38
|
-
version_requirements: &id002 !ruby/object:Gem::Requirement
|
39
|
-
none: false
|
40
|
-
requirements:
|
41
|
-
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
hash: 23
|
44
|
-
segments:
|
45
|
-
- 1
|
46
|
-
- 0
|
47
|
-
- 0
|
48
|
-
version: 1.0.0
|
49
|
-
requirement: *id002
|
50
32
|
type: :development
|
51
|
-
- !ruby/object:Gem::Dependency
|
52
33
|
prerelease: false
|
53
|
-
|
54
|
-
version_requirements: &id003 !ruby/object:Gem::Requirement
|
55
|
-
none: false
|
56
|
-
requirements:
|
57
|
-
- - ~>
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
hash: 7
|
60
|
-
segments:
|
61
|
-
- 1
|
62
|
-
- 5
|
63
|
-
- 2
|
64
|
-
version: 1.5.2
|
65
|
-
requirement: *id003
|
66
|
-
type: :development
|
34
|
+
version_requirements: *id001
|
67
35
|
- !ruby/object:Gem::Dependency
|
68
|
-
prerelease: false
|
69
36
|
name: rcov
|
70
|
-
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
71
38
|
none: false
|
72
39
|
requirements:
|
73
40
|
- - ">="
|
74
41
|
- !ruby/object:Gem::Version
|
75
|
-
hash: 3
|
76
42
|
segments:
|
77
43
|
- 0
|
44
|
+
segments_generated: true
|
78
45
|
version: "0"
|
79
|
-
requirement: *id004
|
80
46
|
type: :development
|
81
|
-
- !ruby/object:Gem::Dependency
|
82
47
|
prerelease: false
|
48
|
+
version_requirements: *id002
|
49
|
+
- !ruby/object:Gem::Dependency
|
83
50
|
name: active_scaffold_vho
|
84
|
-
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
85
52
|
none: false
|
86
53
|
requirements:
|
87
54
|
- - ~>
|
88
55
|
- !ruby/object:Gem::Version
|
89
|
-
hash: 7
|
90
56
|
segments:
|
91
57
|
- 3
|
92
|
-
-
|
93
|
-
|
94
|
-
|
58
|
+
- 1
|
59
|
+
segments_generated: true
|
60
|
+
version: "3.1"
|
95
61
|
type: :runtime
|
62
|
+
prerelease: false
|
63
|
+
version_requirements: *id003
|
96
64
|
description: Exporting Records with ActiveScaffold
|
97
65
|
email: activescaffold@googlegroups.com
|
98
66
|
executables: []
|
@@ -108,9 +76,9 @@ files:
|
|
108
76
|
- README
|
109
77
|
- Rakefile
|
110
78
|
- active_scaffold_export_vho.gemspec
|
111
|
-
-
|
112
|
-
-
|
113
|
-
-
|
79
|
+
- app/assets/images/export.png
|
80
|
+
- app/assets/stylesheets/active_scaffold_export.css.erb
|
81
|
+
- app/assets/stylesheets/export-stylesheet-ie.css
|
114
82
|
- frontends/default/views/_export.csv.erb
|
115
83
|
- frontends/default/views/_export_form_body.html.erb
|
116
84
|
- frontends/default/views/_show_export.html.erb
|
@@ -121,6 +89,7 @@ files:
|
|
121
89
|
- lib/active_scaffold/helpers/export_helpers.rb
|
122
90
|
- lib/active_scaffold_export.rb
|
123
91
|
- lib/active_scaffold_export/config/core.rb
|
92
|
+
- lib/active_scaffold_export/engine.rb
|
124
93
|
- lib/active_scaffold_export/version.rb
|
125
94
|
- lib/active_scaffold_export_vho.rb
|
126
95
|
has_rdoc: true
|
@@ -137,18 +106,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
137
106
|
requirements:
|
138
107
|
- - ">="
|
139
108
|
- !ruby/object:Gem::Version
|
140
|
-
hash:
|
109
|
+
hash: -1505145558479518699
|
141
110
|
segments:
|
142
111
|
- 0
|
112
|
+
segments_generated: true
|
143
113
|
version: "0"
|
144
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
115
|
none: false
|
146
116
|
requirements:
|
147
117
|
- - ">="
|
148
118
|
- !ruby/object:Gem::Version
|
149
|
-
hash: 3
|
150
119
|
segments:
|
151
120
|
- 0
|
121
|
+
segments_generated: true
|
152
122
|
version: "0"
|
153
123
|
requirements: []
|
154
124
|
|