effective_resources 2.7.8 → 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: 876509ce690f40009d985ee70ab314d1e7e626528f6314357a6a671803afed11
4
- data.tar.gz: 7c3f841ef1c7eb55e755acee2ad346352fdfc1df17816ecba720ee6203d4bf90
3
+ metadata.gz: 31e09d4567b7c51be34c376f25ef74abd17969a9fd193dae5cddca70b9513455
4
+ data.tar.gz: b518f302ee57740c70ff98033ecd71890032b85f675731c9ee860d9f57fec222
5
5
  SHA512:
6
- metadata.gz: d22deab3141c5b804a1ce147311cad65c3342ec7c866007cf321b582bb6f9e53bbc6b2cc2bb4e940abfdea2e71dbe8d85879702bedb0c4b6bc9da42f2e2ec8cf
7
- data.tar.gz: 496e8c8b2cfc6d990f947609afdd661f7b0a24c846886ec6df4396409f18a322a6fa7e76046d2f01d2da76c7bad3616320902c52011b833d4d8c6c8162a5809f
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)
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '2.7.8'.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.8
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