effective_polls 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/mailers/effective/polls_mailer.rb +1 -2
- data/app/models/effective/poll_notification.rb +2 -4
- data/app/views/admin/poll_notifications/_form.html.haml +6 -9
- data/config/effective_polls.rb +2 -2
- data/lib/effective_polls/version.rb +1 -1
- data/lib/effective_polls.rb +1 -1
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e014f4462a07752d6e06f332934f392c6b396c0f7f6279501f11036005d627fa
|
4
|
+
data.tar.gz: a108863da8039d6aa608d10aa043fef580b435c5c8dff564d382e69120338027
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e790818639b367c3357f162ff66ee9f795242e337f01d79bab869d0fd63da2b6a9b7b82b097793149f8e1576460253945535161d5e982023e471fa7f3c47b431
|
7
|
+
data.tar.gz: 7197c7a2dcec5fb46a781e5979998ed9602e2dda492f9c885b1f8b3b0be28dc9796255b0e7a9f9a7ccf42b3a4ced34f6e61b81d32fc8fa8cb41699b4fe13d196
|
@@ -2,7 +2,7 @@ module Effective
|
|
2
2
|
class PollsMailer < EffectivePolls.parent_mailer_class
|
3
3
|
|
4
4
|
include EffectiveMailer
|
5
|
-
include EffectiveEmailTemplatesMailer
|
5
|
+
include EffectiveEmailTemplatesMailer
|
6
6
|
|
7
7
|
def poll_upcoming_reminder(poll_notification, user)
|
8
8
|
@assigns = effective_email_templates_assigns(poll_notification, user)
|
@@ -70,7 +70,6 @@ module Effective
|
|
70
70
|
raise('expected poll to be persisted') unless poll&.persisted?
|
71
71
|
|
72
72
|
{
|
73
|
-
subject: poll_notification.subject,
|
74
73
|
available_date: poll.available_date,
|
75
74
|
title: poll.title,
|
76
75
|
url: effective_polls.poll_url(poll),
|
@@ -72,10 +72,8 @@ module Effective
|
|
72
72
|
validates :subject, presence: true
|
73
73
|
validates :body, presence: true
|
74
74
|
|
75
|
-
|
76
|
-
|
77
|
-
validates :subject, liquid: true
|
78
|
-
end
|
75
|
+
validates :body, liquid: true
|
76
|
+
validates :subject, liquid: true
|
79
77
|
|
80
78
|
validates :reminder, if: -> { reminder? || upcoming_reminder? || before_poll_ends? },
|
81
79
|
presence: true, uniqueness: { scope: [:poll_id, :category], message: 'already exists' }
|
@@ -14,18 +14,15 @@
|
|
14
14
|
= f.show_if :category, category do
|
15
15
|
.my-3= render "/admin/poll_notifications/form_#{template}", f: f
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
- if f.object.category == category
|
17
|
+
- if f.object.category == category && f.object.persisted?
|
18
|
+
= f.select :from, mailer_froms_collection(), label: 'From'
|
20
19
|
= f.text_field :subject
|
21
20
|
= f.text_area :body, rows: 10
|
22
|
-
|
23
|
-
- elsif EffectivePolls.use_effective_email_templates == false
|
24
|
-
= f.text_field :subject, value: ''
|
25
|
-
= f.text_area :body, rows: 10, value: ''
|
26
|
-
|
27
21
|
- else
|
28
22
|
- email_template = Effective::EmailTemplate.where(template_name: template).first!
|
23
|
+
- from_value = email_template.from || EffectiveResources.mailer_froms.first
|
24
|
+
|
25
|
+
= f.select :from, mailer_froms_collection(), label: 'From', value: from_value
|
29
26
|
= f.text_field :subject, value: email_template.subject
|
30
27
|
= f.text_area :body, rows: 10, value: email_template.body
|
31
28
|
|
@@ -35,6 +32,6 @@
|
|
35
32
|
- Effective::PollNotification::EMAIL_TEMPLATE_VARIABLES.each do |variable|
|
36
33
|
%li {{ #{variable} }}
|
37
34
|
|
38
|
-
%small.text-muted
|
35
|
+
%small.text-muted Please contact us to add additional variables
|
39
36
|
|
40
37
|
= effective_submit(f)
|
data/config/effective_polls.rb
CHANGED
@@ -21,7 +21,7 @@ EffectivePolls.setup do |config|
|
|
21
21
|
# config.mailer_sender = nil # Default From value
|
22
22
|
# config.mailer_froms = nil # Default Froms collection
|
23
23
|
# config.mailer_admin = nil # Default To value for Admin correspondence
|
24
|
+
#
|
25
|
+
# We always use effective_email_templates
|
24
26
|
|
25
|
-
# Use effective email templates for event notifications
|
26
|
-
config.use_effective_email_templates = true
|
27
27
|
end
|
data/lib/effective_polls.rb
CHANGED
@@ -8,7 +8,7 @@ module EffectivePolls
|
|
8
8
|
def self.config_keys
|
9
9
|
[
|
10
10
|
:layout,
|
11
|
-
:mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_froms, :mailer_admin, :mailer_subject
|
11
|
+
:mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_froms, :mailer_admin, :mailer_subject
|
12
12
|
]
|
13
13
|
end
|
14
14
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_polls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
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-10-
|
11
|
+
date: 2023-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 4.0.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: effective_email_templates
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: effective_resources
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: wicked
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
@@ -95,13 +95,13 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: sassc
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
|
-
type: :
|
104
|
+
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: sqlite3
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
@@ -123,7 +123,7 @@ dependencies:
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: devise
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - ">="
|
@@ -137,7 +137,7 @@ dependencies:
|
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
140
|
+
name: haml
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - ">="
|
@@ -151,7 +151,7 @@ dependencies:
|
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
154
|
+
name: pry-byebug
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
157
|
- - ">="
|
@@ -165,7 +165,7 @@ dependencies:
|
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
168
|
+
name: effective_test_bot
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
171
|
- - ">="
|