effective_resources 2.25.3 → 2.25.5

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: 109b49a58f8065098757d3ddcc03b01598cf088c05c635134f359aab00eaa2a3
4
- data.tar.gz: 80dc0801db689a5abeebc2d1e2c7d08b726f20dc8b3731993a435e119b138cfa
3
+ metadata.gz: 97c4d9e57cbb9190a61fa28058ded7f0e66462849da488234cb7850d6ff3f3b5
4
+ data.tar.gz: 6d5d739a219cc0468ea5d3074e45da0d35eb59dbbb52bd2ba33f851dfbec9497
5
5
  SHA512:
6
- metadata.gz: e2eb4ae03a4ee413ffe9ecae44679e1c12dc45167f1515a971cd20bdcfb773dac587cba1cbf31bfa38205b447b4fc8d00a9842b26aaf94cb58be4ce91cbf10a1
7
- data.tar.gz: 99fdfe50066864c0618a460ab4c5e78fb97f66daf37ac7f46323781e2c7bc6a99f49e562002c71a0fd9749ea443b1f0effff1deb9142082c4f76ac5e87d6ad68
6
+ metadata.gz: c2dc4d8ad8923d37e16d133ff9543d23d3ef98e5d99a0e21fa93d761d8ea67d3ae555c225d3a6acc66e8603c7c467761f0a9bc5527823e87b98a6c37ca39c065
7
+ data.tar.gz: 2d0bdc822b307c8274e54a6992b75a95eadf9b54ef4fa5931e82b905859f4599ceb1d080fea04c4812ee6d9824f3be6922b8bbd818ccd1529b65b01d5198dff2
@@ -11,7 +11,7 @@ module EffectiveResourcesEmailHelper
11
11
  end
12
12
 
13
13
  # acts_as_email_form
14
- def email_form_fields(form, action = nil, skip: true, to: nil, variables: nil, partial: nil)
14
+ def email_form_fields(form, action = nil, skip: true, skip_link: nil, to: nil, variables: nil, partial: nil)
15
15
  raise('expected a form') unless form.respond_to?(:object)
16
16
 
17
17
  resource = form.object
@@ -26,7 +26,11 @@ module EffectiveResourcesEmailHelper
26
26
  action.kind_of?(Effective::EmailTemplate) ? action : Effective::EmailTemplate.where(template_name: action).first!
27
27
  end
28
28
 
29
+ # Display link to the admin email template
30
+ skip_link = !request.path.start_with?('/admin/') if skip_link.nil?
31
+
29
32
  # These defaults are only used when there is no email_template
33
+ # This can't happen right now.
30
34
  email_defaults = form.object.email_form_defaults(action) unless email_template.present?
31
35
 
32
36
  from = email_template&.from || email_defaults[:from] || EffectiveResources.mailer_froms.first
@@ -44,7 +48,8 @@ module EffectiveResourcesEmailHelper
44
48
  email_skip: skip,
45
49
  email_action: (action || true),
46
50
  email_template: email_template,
47
- email_variables: variables
51
+ email_variables: variables,
52
+ email_skip_link: skip_link
48
53
  }
49
54
 
50
55
  render(partial: (partial || 'effective/acts_as_email_form/fields'), locals: locals)
@@ -82,6 +82,11 @@ module ActsAsWizard
82
82
  wizard_step_keys
83
83
  end
84
84
 
85
+ # :submitted
86
+ def last_wizard_step
87
+ all_steps.last
88
+ end
89
+
85
90
  def completed_steps
86
91
  wizard_steps.keys
87
92
  end
@@ -1,5 +1,8 @@
1
1
  = form.hidden_field :email_form_action, value: email_action
2
2
 
3
+ - if email_template.present? && !email_skip_link
4
+ %p The following #{link_to(email_template, effective_email_templates.edit_admin_email_template_path(email_template), target: '_blank')} email will be sent:
5
+
3
6
  - if email_skip
4
7
  = form.check_box :email_form_skip, label: 'Do not send email'
5
8
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '2.25.3'.freeze
2
+ VERSION = '2.25.5'.freeze
3
3
  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.25.3
4
+ version: 2.25.5
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: 2024-06-28 00:00:00.000000000 Z
11
+ date: 2024-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails