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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd2143cd7b6548e1f54316be079f9767005949166a8ae747181db7c487a0de81
4
- data.tar.gz: e32b85cb8d4e9200e1ed6c8405ddfff5a503af801c56f56c912d7e0ab31b9438
3
+ metadata.gz: 31e09d4567b7c51be34c376f25ef74abd17969a9fd193dae5cddca70b9513455
4
+ data.tar.gz: b518f302ee57740c70ff98033ecd71890032b85f675731c9ee860d9f57fec222
5
5
  SHA512:
6
- metadata.gz: 12ade43eeaee46e8177196c65b2601bdd0d1936a3d5dddf6f55d14fa83fc53cb85b2df3ce251ebed3f6f567495904cef5abda0f64f17319e66798c91b47daf01
7
- data.tar.gz: 539d84a100330c1e88e07eac749af89b872955b61426a571d708c7f432edcec5ddb1d185738e355a549e2a97aa2b5321273e562bda8ec47fc7af747b79d1e546
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
 
@@ -0,0 +1,3 @@
1
+ = wizard_card(resource) do
2
+ = effective_table_with(resource) do |f|
3
+ = render(template: "#{resource.render_path}/#{resource.render_step}", f: f)
@@ -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.delegate(key, to: :config)
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.delegate("#{key}=", to: :config)
23
+ self.singleton_class.define_method("#{key}=") { |value| config()[key] = value }
24
24
  end
25
25
 
26
26
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '2.7.7'.freeze
2
+ VERSION = '2.7.9'.freeze
3
3
  end
@@ -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.exists?(path)
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.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-04-24 00:00:00.000000000 Z
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