effective_memberships 0.7.0 → 0.7.2
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 +4 -4
- data/app/datatables/admin/effective_applicants_datatable.rb +3 -2
- data/app/datatables/effective_applicants_datatable.rb +4 -4
- data/app/mailers/effective/memberships_mailer.rb +15 -5
- data/app/models/concerns/effective_memberships_applicant.rb +3 -1
- data/app/models/concerns/effective_memberships_owner.rb +19 -0
- data/app/models/effective/membership.rb +3 -0
- data/app/views/effective/applicant_endorsements/complete.html.haml +1 -1
- data/app/views/effective/applicant_references/complete.html.haml +1 -1
- data/app/views/effective/applicant_reviews/start.html.haml +1 -1
- data/app/views/effective/applicants/_summary.html.haml +1 -1
- data/app/views/effective/fees/_dashboard.html.haml +5 -5
- data/app/views/effective/memberships_mailer/applicant_approved.liquid +2 -2
- data/app/views/effective/memberships_mailer/applicant_completed.liquid +1 -1
- data/app/views/effective/memberships_mailer/applicant_review_submitted.liquid +1 -1
- data/app/views/effective/memberships_mailer/applicant_submitted.liquid +15 -0
- data/lib/effective_memberships/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85036ca2aa1362333f21d1da76e3ce330607f39922e8a9200f33794e01d326db
|
4
|
+
data.tar.gz: a266929f23d85a651aa70b353b70041088f442a46c576a28458674bf1959b286
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b054a795fd94aadadb7d6986b1a4c9b2e7e375f7db63b94b3c3ce9e39ec7c6d1e035030db076777724e3d8a7bb47b33acbdd7dec3c81fbd2f01237d35bff2709
|
7
|
+
data.tar.gz: 38e7942eb0fcae97c12153442b390dc8d239c2ad26a8981287be8fb30d01808d263d6019445af11eb0a6e5f6676b8b0f167140b8ab0a13658d2e82327082d137
|
@@ -8,7 +8,8 @@ module Admin
|
|
8
8
|
end
|
9
9
|
|
10
10
|
datatable do
|
11
|
-
order :
|
11
|
+
order :updated_at
|
12
|
+
|
12
13
|
col :id, visible: false
|
13
14
|
|
14
15
|
col :status, search: effective_memberships_status_collection()
|
@@ -27,7 +28,7 @@ module Admin
|
|
27
28
|
col :approved_at, label: 'Approved', visible: false, as: :date
|
28
29
|
|
29
30
|
col :user
|
30
|
-
col :organization
|
31
|
+
col :organization, visible: false
|
31
32
|
|
32
33
|
col :applicant_type
|
33
34
|
col :category, search: { collection: EffectiveMemberships.Category.all, polymorphic: false }
|
@@ -8,7 +8,9 @@ class EffectiveApplicantsDatatable < Effective::Datatable
|
|
8
8
|
col :category, label: 'Category'
|
9
9
|
col :status, search: effective_memberships_status_collection()
|
10
10
|
|
11
|
-
col :
|
11
|
+
col :orders
|
12
|
+
|
13
|
+
col :created_at, label: 'Created', as: :date, visible: false
|
12
14
|
col :updated_at, label: 'Updated', as: :date, visible: false
|
13
15
|
|
14
16
|
col :submitted_at, label: 'Submitted', as: :date
|
@@ -16,13 +18,11 @@ class EffectiveApplicantsDatatable < Effective::Datatable
|
|
16
18
|
col :missing_info_at, label: 'Missing Info', as: :date, visible: false
|
17
19
|
|
18
20
|
if EffectiveMemberships.applicant_reviews?
|
19
|
-
col :reviewed_at, label: 'Reviewed', as: :date
|
21
|
+
col :reviewed_at, label: 'Reviewed', as: :date, visible: false
|
20
22
|
end
|
21
23
|
|
22
24
|
col :approved_at, label: 'Approved', as: :date
|
23
25
|
|
24
|
-
col :orders
|
25
|
-
|
26
26
|
actions_col(show: false) do |applicant|
|
27
27
|
if applicant.draft?
|
28
28
|
dropdown_link_to('Continue', effective_memberships.applicant_build_path(applicant, applicant.next_step), 'data-turbolinks' => false)
|
@@ -4,11 +4,21 @@ module Effective
|
|
4
4
|
include EffectiveMailer
|
5
5
|
include EffectiveEmailTemplatesMailer if EffectiveMemberships.use_effective_email_templates
|
6
6
|
|
7
|
+
def applicant_submitted(resource, opts = {})
|
8
|
+
@assigns = assigns_for(resource)
|
9
|
+
@applicant = resource
|
10
|
+
|
11
|
+
subject = subject_for(__method__, "Applicant Submitted - #{resource}", resource, opts)
|
12
|
+
headers = headers_for(resource, opts)
|
13
|
+
|
14
|
+
mail(to: resource.user.email, subject: subject, **headers)
|
15
|
+
end
|
16
|
+
|
7
17
|
def applicant_completed(resource, opts = {})
|
8
18
|
@assigns = assigns_for(resource)
|
9
19
|
@applicant = resource
|
10
20
|
|
11
|
-
subject = subject_for(__method__,
|
21
|
+
subject = subject_for(__method__, "Applicant Completed - #{resource}", resource, opts)
|
12
22
|
headers = headers_for(resource, opts)
|
13
23
|
|
14
24
|
mail(to: resource.user.email, subject: subject, **headers)
|
@@ -18,7 +28,7 @@ module Effective
|
|
18
28
|
@assigns = assigns_for(resource)
|
19
29
|
@applicant = resource
|
20
30
|
|
21
|
-
subject = subject_for(__method__,
|
31
|
+
subject = subject_for(__method__, "Applicant Missing Info - #{resource}", resource, opts)
|
22
32
|
headers = headers_for(resource, opts)
|
23
33
|
|
24
34
|
mail(to: resource.user.email, subject: subject, **headers)
|
@@ -28,7 +38,7 @@ module Effective
|
|
28
38
|
@assigns = assigns_for(resource)
|
29
39
|
@applicant = resource
|
30
40
|
|
31
|
-
subject = subject_for(__method__,
|
41
|
+
subject = subject_for(__method__, "Applicant Approved - #{resource}", resource, opts)
|
32
42
|
headers = headers_for(resource, opts)
|
33
43
|
|
34
44
|
mail(to: resource.user.email, subject: subject, **headers)
|
@@ -38,7 +48,7 @@ module Effective
|
|
38
48
|
@assigns = assigns_for(resource)
|
39
49
|
@applicant = resource
|
40
50
|
|
41
|
-
subject = subject_for(__method__,
|
51
|
+
subject = subject_for(__method__, "Applicant Declined - #{resource}", resource, opts)
|
42
52
|
headers = headers_for(resource, opts)
|
43
53
|
|
44
54
|
mail(to: resource.user.email, subject: subject, **headers)
|
@@ -69,7 +79,7 @@ module Effective
|
|
69
79
|
@applicant_review = resource
|
70
80
|
@applicant = resource.applicant
|
71
81
|
|
72
|
-
subject = subject_for(__method__, "Applicant Review
|
82
|
+
subject = subject_for(__method__, "Applicant Review Submitted - #{resource.applicant}", resource, opts)
|
73
83
|
headers = headers_for(resource, opts)
|
74
84
|
|
75
85
|
mail(to: mailer_admin, subject: subject, **headers)
|
@@ -490,6 +490,8 @@ module EffectiveMembershipsApplicant
|
|
490
490
|
stamps.each { |stamp| stamp.submit! }
|
491
491
|
|
492
492
|
after_commit do
|
493
|
+
send_email(:applicant_submitted)
|
494
|
+
|
493
495
|
applicant_endorsements.each { |endorsement| endorsement.notify! if endorsement.submitted? }
|
494
496
|
applicant_references.each { |reference| reference.notify! if reference.submitted? }
|
495
497
|
end
|
@@ -571,7 +573,7 @@ module EffectiveMembershipsApplicant
|
|
571
573
|
when 'reviewed'
|
572
574
|
"This application has been reviewed and is now ready for an admin to approve or decline it. If approved, prorated fees will be generated."
|
573
575
|
when 'approved'
|
574
|
-
"The application has been approved
|
576
|
+
"The application has been approved. All done."
|
575
577
|
when 'declined'
|
576
578
|
"This application has been declined."
|
577
579
|
else
|
@@ -43,6 +43,11 @@ module EffectiveMembershipsOwner
|
|
43
43
|
without_role(:member).where(id: removed.select(:owner_id))
|
44
44
|
}
|
45
45
|
|
46
|
+
scope :membership_good_standing, -> {
|
47
|
+
bad_standing = Effective::Membership.where(bad_standing: false).where(owner_type: name)
|
48
|
+
where(id: bad_standing.select(:owner_id))
|
49
|
+
}
|
50
|
+
|
46
51
|
scope :membership_bad_standing, -> {
|
47
52
|
bad_standing = Effective::Membership.where(bad_standing: true).where(owner_type: name)
|
48
53
|
where(id: bad_standing.select(:owner_id))
|
@@ -71,6 +76,20 @@ module EffectiveMembershipsOwner
|
|
71
76
|
where(id: memberships.where(owner_type: name).select(:owner_id))
|
72
77
|
}
|
73
78
|
|
79
|
+
scope :membership_joined_before, -> (date) {
|
80
|
+
raise('expected a date') unless date.respond_to?(:strftime)
|
81
|
+
|
82
|
+
joined_before = Effective::Membership.joined_before(date).where(owner_type: name)
|
83
|
+
where(id: joined_before.select(:owner_id))
|
84
|
+
}
|
85
|
+
|
86
|
+
scope :membership_joined_after, -> (date) {
|
87
|
+
raise('expected a date') unless date.respond_to?(:strftime)
|
88
|
+
|
89
|
+
joined_after = Effective::Membership.joined_after(date).where(owner_type: name)
|
90
|
+
where(id: joined_after.select(:owner_id))
|
91
|
+
}
|
92
|
+
|
74
93
|
end
|
75
94
|
|
76
95
|
def assign_member_role
|
@@ -36,6 +36,9 @@ module Effective
|
|
36
36
|
|
37
37
|
scope :good_standing, -> { where(bad_standing: [nil, false]) }
|
38
38
|
|
39
|
+
scope :joined_before, -> (date) { where(arel_table[:joined_on].lt(date)) }
|
40
|
+
scope :joined_after, -> (date) { where(arel_table[:joined_on].gteq(date)) }
|
41
|
+
|
39
42
|
scope :with_paid_fees_through, -> (period = nil) {
|
40
43
|
where(arel_table[:fees_paid_period].gteq(period || EffectiveMemberships.Registrar.current_period))
|
41
44
|
}
|
@@ -1,2 +1,2 @@
|
|
1
1
|
= card do
|
2
|
-
%p Thank you
|
2
|
+
%p Thank you. The confidential endorsement has been completed.
|
@@ -1,2 +1,2 @@
|
|
1
1
|
= card do
|
2
|
-
%p Thank you
|
2
|
+
%p Thank you. The confidential reference has been completed.
|
@@ -31,7 +31,7 @@
|
|
31
31
|
- if membership.reregistered?
|
32
32
|
and last changed on #{membership.registration_on.strftime('%F')}
|
33
33
|
|
34
|
-
= collapse('show
|
34
|
+
= collapse('show membership history', card_class: '') do
|
35
35
|
%p #{applicant.owner} membership history
|
36
36
|
= render_datatable(Admin::EffectiveMembershipHistoriesDatatable.new(owner: applicant.owner, actions: false), simple: true)
|
37
37
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
%h2 Fees
|
1
|
+
%h2 Fees and Dues
|
2
2
|
|
3
3
|
- memberships = current_user.memberships
|
4
4
|
- outstanding_owners = current_user.memberships_owners.select { |owner| owner.outstanding_fee_payment_fees.present? }
|
@@ -6,7 +6,7 @@
|
|
6
6
|
- if memberships.present?
|
7
7
|
- if memberships.any? { |membership| membership.category.create_renewal_fees? }
|
8
8
|
- date = EffectiveMemberships.Registrar.renewal_fee_date(date: Time.zone.now)
|
9
|
-
%p Annual
|
9
|
+
%p Annual dues become available for purchase on #{date.strftime('%B %e')} of each year.
|
10
10
|
|
11
11
|
- if memberships.any? { |membership| membership.category.create_late_fees? }
|
12
12
|
- date = EffectiveMemberships.Registrar.late_fee_date(date: Time.zone.now)
|
@@ -14,10 +14,10 @@
|
|
14
14
|
|
15
15
|
- if memberships.any? { |membership| membership.category.create_bad_standing? }
|
16
16
|
- date = EffectiveMemberships.Registrar.bad_standing_date(date: Time.zone.now)
|
17
|
-
%p Memberships with unpaid fees will be marked in bad standing on #{date.strftime('%B %e')}.
|
17
|
+
%p Memberships with unpaid fees or dues will be marked in bad standing on #{date.strftime('%B %e')}.
|
18
18
|
|
19
19
|
- if outstanding_owners.present?
|
20
|
-
.alert.alert-warning.mb-3 You have outstanding fees ready to purchase.
|
20
|
+
.alert.alert-warning.mb-3 You have outstanding fees or dues ready to purchase.
|
21
21
|
|
22
22
|
%ul
|
23
23
|
- outstanding_owners.each do |owner|
|
@@ -31,4 +31,4 @@
|
|
31
31
|
%p= link_to 'Pay Fees', effective_memberships.new_fee_payment_path, class: 'btn btn-primary'
|
32
32
|
|
33
33
|
- else
|
34
|
-
%p You have no outstanding fees at this time. Thank you
|
34
|
+
%p You have no outstanding fees or dues at this time. Thank you.
|
@@ -1,10 +1,10 @@
|
|
1
1
|
---
|
2
|
-
subject: 'Your application was approved
|
2
|
+
subject: 'Your application was approved'
|
3
3
|
from: 'admin@example.com'
|
4
4
|
---
|
5
5
|
Hello {{ user.name }},
|
6
6
|
|
7
|
-
Your application for {{ applicant.to_category }} was approved
|
7
|
+
Your application for {{ applicant.to_category }} was approved.
|
8
8
|
|
9
9
|
Please log in and purchase any outstanding fees.
|
10
10
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
subject: 'Your application was successfully submitted'
|
3
|
+
from: 'admin@example.com'
|
4
|
+
---
|
5
|
+
Hello {{ user.name }},
|
6
|
+
|
7
|
+
We have received your application for {{ applicant.to_category }} #{{ applicant.to_status }}
|
8
|
+
|
9
|
+
For more details please visit
|
10
|
+
|
11
|
+
{{ applicant.url }}
|
12
|
+
|
13
|
+
Thank you.
|
14
|
+
|
15
|
+
Please contact us for assistance.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_memberships
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
@@ -487,6 +487,7 @@ files:
|
|
487
487
|
- app/views/effective/memberships_mailer/applicant_missing_info.liquid
|
488
488
|
- app/views/effective/memberships_mailer/applicant_reference_notification.liquid
|
489
489
|
- app/views/effective/memberships_mailer/applicant_review_submitted.liquid
|
490
|
+
- app/views/effective/memberships_mailer/applicant_submitted.liquid
|
490
491
|
- app/views/effective/organizations/_dashboard.html.haml
|
491
492
|
- app/views/effective/organizations/_form.html.haml
|
492
493
|
- app/views/effective/organizations/_form_organization.html.haml
|