effective_resources 2.7.7 → 2.7.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/effective_resources_wizard_helper.rb +16 -0
- data/app/models/concerns/acts_as_wizard.rb +2 -1
- data/app/views/effective/acts_as_wizard/_wizard_step.html.haml +3 -0
- data/lib/effective_resources/effective_gem.rb +2 -2
- data/lib/effective_resources/version.rb +1 -1
- data/lib/effective_resources.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31e09d4567b7c51be34c376f25ef74abd17969a9fd193dae5cddca70b9513455
|
4
|
+
data.tar.gz: b518f302ee57740c70ff98033ecd71890032b85f675731c9ee860d9f57fec222
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1721954e1ed150209853308b56f3e0f29b2f4a98bf4f9327bf17ec005cc65a9033debde9c78db025947c86bbaeb5f89941b63c63089dfd281ff3893d01a3c4bc
|
7
|
+
data.tar.gz: 7134665aee289d98d4e158c63f40ac67e006b14920b26de1f43e150f956ab300c232a7b91da6b77a72ba08c5ff1e5862f7e35c190900ffa0c1971bfd3620addc
|
@@ -42,4 +42,20 @@ module EffectiveResourcesWizardHelper
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
+
def render_wizard_resource(resource, as: nil, path: nil)
|
46
|
+
effective_resource = Effective::Resource.new(resource)
|
47
|
+
|
48
|
+
as ||= effective_resource.name
|
49
|
+
path ||= effective_resource.view_file_path(nil)
|
50
|
+
raise('expected a path') unless path.present?
|
51
|
+
|
52
|
+
resource.render_path = path.to_s.chomp('/')
|
53
|
+
|
54
|
+
resource.render_steps.map do |partial|
|
55
|
+
resource.render_step = partial
|
56
|
+
|
57
|
+
render_if_exists("#{path}/#{partial}", as.to_sym => resource) || render('effective/acts_as_wizard/wizard_step', resource: resource, resource_path: path)
|
58
|
+
end.join.html_safe
|
59
|
+
end
|
60
|
+
|
45
61
|
end
|
@@ -31,6 +31,7 @@ module ActsAsWizard
|
|
31
31
|
|
32
32
|
# Used by the view when rendering each partial. Not the current step.
|
33
33
|
attr_accessor :render_step
|
34
|
+
attr_accessor :render_path
|
34
35
|
|
35
36
|
if Rails.env.test? # So our tests can override the required_steps method
|
36
37
|
cattr_accessor :test_required_steps
|
@@ -92,7 +93,7 @@ module ActsAsWizard
|
|
92
93
|
|
93
94
|
# For use in the summary partials. Does not include summary.
|
94
95
|
def render_steps
|
95
|
-
blacklist = [:start, :billing, :checkout, :submitted, :summary]
|
96
|
+
blacklist = [:start, :billing, :checkout, :submit, :submitted, :summary]
|
96
97
|
((required_steps | completed_steps) - blacklist).select { |step| has_completed_step?(step) }
|
97
98
|
end
|
98
99
|
|
@@ -15,12 +15,12 @@ module EffectiveGem
|
|
15
15
|
|
16
16
|
# Define getters
|
17
17
|
(config_keys - EXCLUDED_GETTERS).each do |key|
|
18
|
-
self.singleton_class.
|
18
|
+
self.singleton_class.define_method(key) { config()[key] }
|
19
19
|
end
|
20
20
|
|
21
21
|
# Define setters
|
22
22
|
config_keys.each do |key|
|
23
|
-
self.singleton_class.
|
23
|
+
self.singleton_class.define_method("#{key}=") { |value| config()[key] = value }
|
24
24
|
end
|
25
25
|
|
26
26
|
end
|
data/lib/effective_resources.rb
CHANGED
@@ -153,7 +153,7 @@ module EffectiveResources
|
|
153
153
|
path = service.path_for(blob.key)
|
154
154
|
duplicate_path = service.path_for(duplicate.key)
|
155
155
|
FileUtils.mkdir_p(File.dirname(duplicate_path))
|
156
|
-
FileUtils.ln(path, duplicate_path) if File.
|
156
|
+
FileUtils.ln(path, duplicate_path) if File.exist?(path)
|
157
157
|
else
|
158
158
|
raise "unknown storage service #{service.class.name}"
|
159
159
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -207,6 +207,7 @@ files:
|
|
207
207
|
- app/views/application/show.js.erb
|
208
208
|
- app/views/application/update.js.erb
|
209
209
|
- app/views/effective/acts_as_email_form/_fields.html.haml
|
210
|
+
- app/views/effective/acts_as_wizard/_wizard_step.html.haml
|
210
211
|
- app/views/effective/resource/_actions.html.haml
|
211
212
|
- app/views/effective/resource/_actions_dropleft.html.haml
|
212
213
|
- app/views/effective/resource/_actions_glyphicons.html.haml
|