effective_resources 2.36.3 → 2.36.5

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: 193c421cf2d3da6dd5e07185f71e7b1a37d3fcf9856f0aff4b5db47e69765dc0
4
- data.tar.gz: 3aa8cfeac216a782bee96aaf8058143051ecef58e619845da8e04c6779fdee28
3
+ metadata.gz: '086e9b2c0d5f9e843a39a880c48ca7467c454d96d426b7a789f474ed6db2d37f'
4
+ data.tar.gz: 7ad84343ab0180ecb8b2c73a767af2904f23b27f4d497fe3f45f729abed23337
5
5
  SHA512:
6
- metadata.gz: 943707c27e2717e7770b37a3ca6fbf33d99c2de91f73b949dac35539d21b677d82fe2944f8f0200a407501d29efe4da783f15a30dee4804e7a7839fb9f489770
7
- data.tar.gz: ff13a0c8e401cdf4b9d50b5f316298e784274bfb91c134508d03afe701d812bcecdd3f75bcfeca78bc482c4efd029b8ef0ae351a91314c871519bfb55c8300cf
6
+ metadata.gz: cf277644616c40600656c124b3982f5a39e27a87805b2b38d11adde65ae58672d974488d7745ee141724cf05a8a9a2dac9b37d8a42e1cfd05177a358e4be63dc
7
+ data.tar.gz: 0c70a0926f46a18b73edb4a045bd7b1764dccab54e610aa4e389ea129024c7b1e9f48e1c9f2b660d2087e4ea18b45dffbdbbc2f90764176141032058bf329e12
@@ -18,6 +18,17 @@ module Effective
18
18
  effective_resource.url_helpers.url_for(merged_url_options)
19
19
  end
20
20
 
21
+ # Override from wicked to support a fallback wizard step template
22
+ def render_step(the_step, options = {}, params = {})
23
+ if the_step.nil? || the_step.to_s == Wicked::FINISH_STEP
24
+ redirect_to_finish_wizard(options, params)
25
+ elsif lookup_context.exists?(the_step.to_s, lookup_context.prefixes)
26
+ render(the_step, options)
27
+ else
28
+ render('effective/acts_as_wizard/wizard_step', options)
29
+ end
30
+ end
31
+
21
32
  end
22
33
  end
23
34
  end
@@ -219,6 +219,13 @@ module ActsAsWizard
219
219
  end
220
220
  end
221
221
 
222
+ def render_partial_path
223
+ raise("expected render_path to be set") unless render_path.present?
224
+ raise("expected render_step to be set") unless render_step.present?
225
+
226
+ "#{render_path}/#{render_step}"
227
+ end
228
+
222
229
  private
223
230
 
224
231
  def can_revisit_completed_steps(step)
@@ -1,11 +1,3 @@
1
1
  = wizard_card(resource) do
2
2
  - partial = "#{resource.render_path}/#{resource.render_step}_fields"
3
-
4
- - if render_partial_exists?(partial)
5
- = effective_table_with(resource) { |f| render(partial, f: f) }
6
-
7
- - elsif Rails.env.development? || Rails.env.test?
8
- - names = partial.split('/')
9
- - name = names[0...-1].join('/') + '/_' + names.last + '.html.haml'
10
-
11
- %div.alert.alert-warning Unable to find partial: #{name}
3
+ = effective_table_with(resource) { |f| render(partial, f: f) }
@@ -0,0 +1,15 @@
1
+ - prefix = controller_path
2
+ - locals = { resource: resource, Effective::Resource.new(resource).name.to_sym => resource }
3
+
4
+ = render "#{prefix}/layout" do
5
+ = render_if_exists("#{prefix}/content", locals)
6
+
7
+ = card do
8
+ = render_if_exists("#{prefix}/#{step}_requirements", locals)
9
+
10
+ = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
11
+ = f.hidden_field :id
12
+
13
+ = render("#{prefix}/#{step}_fields", f: f)
14
+
15
+ = f.submit 'Save and Continue', left: true
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '2.36.3'.freeze
2
+ VERSION = '2.36.5'.freeze
3
3
  end
@@ -213,7 +213,7 @@ module EffectiveResources
213
213
  resource.datatable_name
214
214
  elsif resource.respond_to?(:model_name) == false # Just a string. Fees will do this
215
215
  value = I18n.t(resource)
216
- raise StandardError.new("Missing translation: #{resource}") if value.include?("Missing translation:")
216
+ raise StandardError.new("Missing translation: #{resource}") if value.include?(resource) || value.include?("Missing translation:")
217
217
  value
218
218
  elsif attribute.blank?
219
219
  resource.model_name.human
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.36.3
4
+ version: 2.36.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
@@ -266,6 +266,7 @@ files:
266
266
  - app/views/effective/acts_as_published/_fields.html.haml
267
267
  - app/views/effective/acts_as_slugged/_fields.html.haml
268
268
  - app/views/effective/acts_as_wizard/_wizard_step.html.haml
269
+ - app/views/effective/acts_as_wizard/wizard_step.html.haml
269
270
  - app/views/effective/resource/_actions.html.haml
270
271
  - app/views/effective/resource/_actions_dropleft.html.haml
271
272
  - app/views/effective/resource/_actions_glyphicons.html.haml