effective_memberships 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +114 -0
- data/Rakefile +18 -0
- data/app/assets/config/effective_memberships_manifest.js +3 -0
- data/app/assets/javascripts/effective_memberships/applicant_courses.js +29 -0
- data/app/assets/javascripts/effective_memberships/applicant_experiences.js +38 -0
- data/app/assets/javascripts/effective_memberships/base.js +0 -0
- data/app/assets/javascripts/effective_memberships.js +1 -0
- data/app/assets/stylesheets/effective_memberships/base.scss +5 -0
- data/app/assets/stylesheets/effective_memberships.scss +1 -0
- data/app/controllers/admin/applicant_course_areas_controller.rb +15 -0
- data/app/controllers/admin/applicant_course_names_controller.rb +15 -0
- data/app/controllers/admin/applicants_controller.rb +33 -0
- data/app/controllers/admin/categories_controller.rb +19 -0
- data/app/controllers/admin/fees_controller.rb +18 -0
- data/app/controllers/admin/registrar_actions_controller.rb +49 -0
- data/app/controllers/effective/applicant_references_controller.rb +37 -0
- data/app/controllers/effective/applicants_controller.rb +34 -0
- data/app/controllers/effective/fee_payments_controller.rb +29 -0
- data/app/datatables/admin/effective_applicant_course_areas_datatable.rb +17 -0
- data/app/datatables/admin/effective_applicant_course_names_datatable.rb +17 -0
- data/app/datatables/admin/effective_applicants_datatable.rb +55 -0
- data/app/datatables/admin/effective_categories_datatable.rb +23 -0
- data/app/datatables/admin/effective_fees_datatable.rb +69 -0
- data/app/datatables/admin/effective_membership_histories_datatable.rb +35 -0
- data/app/datatables/effective_applicant_courses_datatable.rb +30 -0
- data/app/datatables/effective_applicant_educations_datatable.rb +22 -0
- data/app/datatables/effective_applicant_experiences_datatable.rb +42 -0
- data/app/datatables/effective_applicant_references_datatable.rb +34 -0
- data/app/datatables/effective_applicants_datatable.rb +34 -0
- data/app/helpers/effective_memberships_helper.rb +15 -0
- data/app/mailers/effective/memberships_mailer.rb +84 -0
- data/app/models/concerns/effective_memberships_applicant.rb +612 -0
- data/app/models/concerns/effective_memberships_applicant_review.rb +149 -0
- data/app/models/concerns/effective_memberships_category.rb +196 -0
- data/app/models/concerns/effective_memberships_fee_payment.rb +229 -0
- data/app/models/concerns/effective_memberships_owner.rb +263 -0
- data/app/models/concerns/effective_memberships_registrar.rb +300 -0
- data/app/models/effective/applicant.rb +7 -0
- data/app/models/effective/applicant_course.rb +40 -0
- data/app/models/effective/applicant_course_area.rb +31 -0
- data/app/models/effective/applicant_course_name.rb +29 -0
- data/app/models/effective/applicant_education.rb +36 -0
- data/app/models/effective/applicant_experience.rb +79 -0
- data/app/models/effective/applicant_reference.rb +81 -0
- data/app/models/effective/applicant_review.rb +7 -0
- data/app/models/effective/category.rb +7 -0
- data/app/models/effective/fee.rb +142 -0
- data/app/models/effective/fee_payment.rb +7 -0
- data/app/models/effective/membership.rb +119 -0
- data/app/models/effective/membership_category.rb +11 -0
- data/app/models/effective/membership_history.rb +40 -0
- data/app/models/effective/registrar.rb +19 -0
- data/app/models/effective/registrar_action.rb +97 -0
- data/app/views/admin/applicant_course_areas/_form.html.haml +8 -0
- data/app/views/admin/applicant_course_areas/_form_applicant_course_area.html.haml +8 -0
- data/app/views/admin/applicant_course_areas/index.html.haml +8 -0
- data/app/views/admin/applicant_course_name/_form.html.haml +9 -0
- data/app/views/admin/applicants/_form.html.haml +38 -0
- data/app/views/admin/applicants/_form_approve.html.haml +34 -0
- data/app/views/admin/applicants/_form_decline.html.haml +11 -0
- data/app/views/admin/applicants/_form_process.html.haml +18 -0
- data/app/views/admin/applicants/_status.html.haml +133 -0
- data/app/views/admin/categories/_form.html.haml +14 -0
- data/app/views/admin/categories/_form_applicant.html.haml +12 -0
- data/app/views/admin/categories/_form_applicant_content.html.haml +19 -0
- data/app/views/admin/categories/_form_applicant_eligibility.html.haml +13 -0
- data/app/views/admin/categories/_form_applicant_fees.html.haml +29 -0
- data/app/views/admin/categories/_form_applicant_steps.html.haml +42 -0
- data/app/views/admin/categories/_form_category.html.haml +10 -0
- data/app/views/admin/categories/_form_fee_payment.html.haml +9 -0
- data/app/views/admin/categories/_form_fee_payment_content.html.haml +19 -0
- data/app/views/admin/categories/_form_fee_payment_steps.html.haml +9 -0
- data/app/views/admin/categories/_form_renewals.html.haml +32 -0
- data/app/views/admin/fees/_fee.html.haml +1 -0
- data/app/views/admin/fees/_form.html.haml +14 -0
- data/app/views/admin/memberships/_status.html.haml +6 -0
- data/app/views/admin/registrar_actions/_form.html.haml +10 -0
- data/app/views/admin/registrar_actions/_form_bad_standing.html.haml +43 -0
- data/app/views/admin/registrar_actions/_form_fees_paid.html.haml +30 -0
- data/app/views/admin/registrar_actions/_form_reclassify.html.haml +43 -0
- data/app/views/admin/registrar_actions/_form_register.html.haml +44 -0
- data/app/views/admin/registrar_actions/_form_remove.html.haml +17 -0
- data/app/views/effective/applicant_references/_applicant_reference.html.haml +51 -0
- data/app/views/effective/applicant_references/_datatable_actions.html.haml +4 -0
- data/app/views/effective/applicant_references/_form.html.haml +18 -0
- data/app/views/effective/applicant_references/_form_declaration.html.haml +37 -0
- data/app/views/effective/applicant_references/complete.html.haml +3 -0
- data/app/views/effective/applicant_references/edit.html.haml +8 -0
- data/app/views/effective/applicants/_applicant.html.haml +6 -0
- data/app/views/effective/applicants/_content.html.haml +10 -0
- data/app/views/effective/applicants/_course_amounts.html.haml +19 -0
- data/app/views/effective/applicants/_dashboard.html.haml +19 -0
- data/app/views/effective/applicants/_declarations.html.haml +16 -0
- data/app/views/effective/applicants/_demographics.html.haml +9 -0
- data/app/views/effective/applicants/_demographics_fields.html.haml +11 -0
- data/app/views/effective/applicants/_demographics_owner.html.haml +20 -0
- data/app/views/effective/applicants/_education.html.haml +14 -0
- data/app/views/effective/applicants/_experience.html.haml +28 -0
- data/app/views/effective/applicants/_files.html.haml +27 -0
- data/app/views/effective/applicants/_layout.html.haml +3 -0
- data/app/views/effective/applicants/_orders.html.haml +4 -0
- data/app/views/effective/applicants/_references.html.haml +15 -0
- data/app/views/effective/applicants/_summary.html.haml +40 -0
- data/app/views/effective/applicants/billing.html.haml +14 -0
- data/app/views/effective/applicants/checkout.html.haml +6 -0
- data/app/views/effective/applicants/course_amounts.html.haml +50 -0
- data/app/views/effective/applicants/declarations.html.haml +19 -0
- data/app/views/effective/applicants/demographics.html.haml +11 -0
- data/app/views/effective/applicants/education.html.haml +27 -0
- data/app/views/effective/applicants/experience.html.haml +51 -0
- data/app/views/effective/applicants/files.html.haml +14 -0
- data/app/views/effective/applicants/references.html.haml +24 -0
- data/app/views/effective/applicants/select.html.haml +27 -0
- data/app/views/effective/applicants/start.html.haml +18 -0
- data/app/views/effective/applicants/submitted.html.haml +44 -0
- data/app/views/effective/applicants/summary.html.haml +8 -0
- data/app/views/effective/fee_payments/_content.html.haml +8 -0
- data/app/views/effective/fee_payments/_declarations.html.haml +16 -0
- data/app/views/effective/fee_payments/_demographics.html.haml +9 -0
- data/app/views/effective/fee_payments/_demographics_fields.html.haml +11 -0
- data/app/views/effective/fee_payments/_demographics_owner.html.haml +20 -0
- data/app/views/effective/fee_payments/_fee_payment.html.haml +6 -0
- data/app/views/effective/fee_payments/_layout.html.haml +3 -0
- data/app/views/effective/fee_payments/_orders.html.haml +4 -0
- data/app/views/effective/fee_payments/billing.html.haml +14 -0
- data/app/views/effective/fee_payments/checkout.html.haml +6 -0
- data/app/views/effective/fee_payments/declarations.html.haml +20 -0
- data/app/views/effective/fee_payments/demographics.html.haml +12 -0
- data/app/views/effective/fee_payments/start.html.haml +20 -0
- data/app/views/effective/fee_payments/submitted.html.haml +14 -0
- data/app/views/effective/fee_payments/summary.html.haml +8 -0
- data/app/views/effective/fees/_dashboard.html.haml +22 -0
- data/app/views/effective/fees/_fee.html.haml +37 -0
- data/app/views/effective/memberships/_dashboard.html.haml +29 -0
- data/app/views/effective/memberships/_membership.html.haml +40 -0
- data/app/views/effective/memberships_mailer/applicant_approved.liquid +15 -0
- data/app/views/effective/memberships_mailer/applicant_declined.liquid +13 -0
- data/app/views/effective/memberships_mailer/applicant_reference_notification.liquid +15 -0
- data/app/views/layouts/effective_memberships_mailer_layout.html.haml +7 -0
- data/config/effective_memberships.rb +47 -0
- data/config/routes.rb +32 -0
- data/db/migrate/01_create_effective_memberships.rb.erb +380 -0
- data/db/seeds.rb +59 -0
- data/lib/effective_memberships/engine.rb +23 -0
- data/lib/effective_memberships/version.rb +3 -0
- data/lib/effective_memberships.rb +86 -0
- data/lib/generators/effective_memberships/install_generator.rb +40 -0
- data/lib/generators/templates/effective_memberships_mailer_preview.rb +4 -0
- data/lib/tasks/effective_memberships_tasks.rake +17 -0
- metadata +377 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
= render 'layout' do
|
2
|
+
= render 'effective/applicants/content', resource: resource
|
3
|
+
|
4
|
+
.card
|
5
|
+
.card-body
|
6
|
+
- fees = resource.owner.outstanding_fee_payment_fees
|
7
|
+
|
8
|
+
- if fees.present?
|
9
|
+
%p You have #{pluralize(fees.length , 'outstanding fee')}.
|
10
|
+
%p
|
11
|
+
Please
|
12
|
+
= link_to 'Make a fee payment', effective_memberships.new_fee_payment_path
|
13
|
+
before continuing with any applications
|
14
|
+
|
15
|
+
- if fees.blank?
|
16
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
17
|
+
= f.hidden_field :id
|
18
|
+
= f.save 'Save and Continue'
|
@@ -0,0 +1,44 @@
|
|
1
|
+
= render 'layout' do
|
2
|
+
= render 'effective/applicants/content', resource: resource
|
3
|
+
|
4
|
+
- raise('expected a submitted applicant') unless resource.was_submitted?
|
5
|
+
- raise('expected a purchased applicant submit_order') unless resource.submit_order&.purchased?
|
6
|
+
|
7
|
+
.alert.alert-success.mb-4
|
8
|
+
This application was submitted on
|
9
|
+
= resource.submit_order.purchased_at.strftime('%F')
|
10
|
+
|
11
|
+
- unless resource.approved?
|
12
|
+
.card
|
13
|
+
.card-body
|
14
|
+
%p
|
15
|
+
Your application must still be approved.
|
16
|
+
We will send
|
17
|
+
%strong= resource.owner.email
|
18
|
+
an email notifying you of the application's approval status.
|
19
|
+
|
20
|
+
.card
|
21
|
+
.card-body= render 'effective/applicants/summary', applicant: resource
|
22
|
+
|
23
|
+
- if resource.min_applicant_references.to_i > 0 || resource.applicant_references.present?
|
24
|
+
.card
|
25
|
+
.card-body
|
26
|
+
%h3 Confidential References
|
27
|
+
%p
|
28
|
+
References are automatically sent a reference request.
|
29
|
+
Click 'New' to add an additional reference, or click 'Notify' to resend the reference request.
|
30
|
+
|
31
|
+
= render_datatable(EffectiveApplicantReferencesDatatable.new(applicant_id: resource.id), inline: true, simple: true)
|
32
|
+
|
33
|
+
.mb-4
|
34
|
+
= collapse('Show application...', card_class: 'my-2') do
|
35
|
+
= render 'effective/applicants/applicant', applicant: resource
|
36
|
+
|
37
|
+
= render 'effective/applicants/orders', applicant: resource
|
38
|
+
|
39
|
+
-# - if resource.can_visit_step?(next_step)
|
40
|
+
-# = effective_form_with(model: resource, url: wizard_path(step)) do |f|
|
41
|
+
-# = f.hidden_field :current_step
|
42
|
+
-# = f.submit 'Save and Continue', class: 'btn btn-primary'
|
43
|
+
|
44
|
+
= link_to "Return to Dashboard", root_path, class: 'btn btn-lg btn-primary btn-block'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
= render 'layout' do
|
2
|
+
= render 'effective/applicants/content', resource: resource
|
3
|
+
|
4
|
+
= render('effective/applicants/applicant', applicant: resource)
|
5
|
+
|
6
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
7
|
+
= f.hidden_field :id
|
8
|
+
= f.submit 'Save and Continue', border: false, left: true
|
@@ -0,0 +1,8 @@
|
|
1
|
+
- all_steps_content = resource.category&.rich_text_fee_payment_all_steps_content
|
2
|
+
- step_content = resource.category&.send("rich_text_fee_payment_#{step}_content")
|
3
|
+
|
4
|
+
- if all_steps_content.present?
|
5
|
+
.mb-2= all_steps_content
|
6
|
+
|
7
|
+
- if step_content.present?
|
8
|
+
.mb-2= step_content
|
@@ -0,0 +1,16 @@
|
|
1
|
+
.card
|
2
|
+
.card-body
|
3
|
+
.row
|
4
|
+
.col-sm
|
5
|
+
%h5.card-title= fee_payment.wizard_step_title(:declarations)
|
6
|
+
.col-sm-auto.text-right
|
7
|
+
= link_to('Edit', wizard_path(:declarations)) if edit_effective_fee_payments_wizard?
|
8
|
+
|
9
|
+
%table.table
|
10
|
+
%tbody
|
11
|
+
%tr
|
12
|
+
%td= icon('check')
|
13
|
+
%td Yes, I hereby certify that I have read and will adhere to the Code of Ethics
|
14
|
+
%tr
|
15
|
+
%td= icon('check')
|
16
|
+
%td Yes, I hereby certify that the statements and information contained herein are correct
|
@@ -0,0 +1,9 @@
|
|
1
|
+
.card
|
2
|
+
.card-body
|
3
|
+
.row
|
4
|
+
.col-sm
|
5
|
+
%h5.card-title= fee_payment.wizard_step_title(:demographics)
|
6
|
+
.col-sm-auto.text-right
|
7
|
+
= link_to('Edit', wizard_path(:demographics)) if edit_effective_fee_payments_wizard?
|
8
|
+
|
9
|
+
= render 'effective/fee_payments/demographics_owner', fee_payment: fee_payment, owner: fee_payment.owner
|
@@ -0,0 +1,11 @@
|
|
1
|
+
- if f.object.respond_to?(:first_name)
|
2
|
+
= f.text_field :first_name
|
3
|
+
|
4
|
+
- if f.object.respond_to?(:last_name)
|
5
|
+
= f.text_field :last_name
|
6
|
+
|
7
|
+
- if f.object.respond_to?(:date_of_birth)
|
8
|
+
= f.date_field :date_of_birth
|
9
|
+
|
10
|
+
- if f.object.respond_to?(:phone)
|
11
|
+
= f.tel_field :phone
|
@@ -0,0 +1,20 @@
|
|
1
|
+
%table.table
|
2
|
+
%tbody
|
3
|
+
%tr
|
4
|
+
%th Name
|
5
|
+
%td= owner.to_s
|
6
|
+
|
7
|
+
- if owner.respond_to?(:email) && owner.email.present?
|
8
|
+
%tr
|
9
|
+
%th Email
|
10
|
+
%td= mail_to owner.email
|
11
|
+
|
12
|
+
- if owner.respond_to?(:date_of_birth) && owner.date_of_birth.present?
|
13
|
+
%tr
|
14
|
+
%th Date of Birth
|
15
|
+
%td= owner.date_of_birth.strftime('%F')
|
16
|
+
|
17
|
+
- if owner.respond_to?(:phone) && owner.phone.present?
|
18
|
+
%tr
|
19
|
+
%th Phone:
|
20
|
+
%td= owner.phone
|
@@ -0,0 +1,6 @@
|
|
1
|
+
.effective-fee-payment
|
2
|
+
- blacklist = EffectiveMemberships.FeePayment.required_wizard_steps
|
3
|
+
- steps = fee_payment.required_steps - blacklist
|
4
|
+
|
5
|
+
- steps.select { |step| fee_payment.has_completed_step?(step) }.each do |partial|
|
6
|
+
= render "effective/fee_payments/#{partial}", fee_payment: fee_payment, step: partial
|
@@ -0,0 +1,14 @@
|
|
1
|
+
= render 'layout' do
|
2
|
+
= render 'effective/fee_payments/content', resource: resource
|
3
|
+
|
4
|
+
- raise('expected owner to respond to billing_address') unless resource.owner.respond_to?(:billing_address)
|
5
|
+
|
6
|
+
.card
|
7
|
+
.card-body
|
8
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
9
|
+
= f.hidden_field :id
|
10
|
+
|
11
|
+
= f.fields_for(:owner, f.object.owner) do |fu|
|
12
|
+
= effective_address_fields(fu, :billing)
|
13
|
+
|
14
|
+
= f.save 'Save and Continue'
|
@@ -0,0 +1,6 @@
|
|
1
|
+
= render 'layout' do
|
2
|
+
= render 'effective/fee_payments/content', resource: resource
|
3
|
+
|
4
|
+
.card
|
5
|
+
.card-body
|
6
|
+
= render_checkout_step2(resource.submit_order, purchased_url: wizard_path(:submitted), deferred_url: wizard_path(:checkout), declined_url: wizard_path(:checkout))
|
@@ -0,0 +1,20 @@
|
|
1
|
+
= render 'layout' do
|
2
|
+
|
3
|
+
= render 'effective/fee_payments/content', resource: resource
|
4
|
+
|
5
|
+
- completed = resource.has_completed_step?(:declarations)
|
6
|
+
- resource.declare_code_of_ethics = completed
|
7
|
+
- resource.declare_truth = completed
|
8
|
+
|
9
|
+
.card
|
10
|
+
.card-body
|
11
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
12
|
+
= f.hidden_field :id
|
13
|
+
|
14
|
+
= f.check_box :declare_code_of_ethics,
|
15
|
+
label: 'Yes, I hereby certify that I have read and will adhere to the Code of Ethics'
|
16
|
+
|
17
|
+
= f.check_box :declare_truth,
|
18
|
+
label: 'Yes, I hereby certify that the statements and information contained herein are correct'
|
19
|
+
|
20
|
+
= f.save 'Save and Continue'
|
@@ -0,0 +1,12 @@
|
|
1
|
+
= render 'layout' do
|
2
|
+
= render 'effective/fee_payments/content', resource: resource
|
3
|
+
|
4
|
+
.card
|
5
|
+
.card-body
|
6
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
7
|
+
= f.hidden_field :id
|
8
|
+
|
9
|
+
= f.fields_for(:owner, f.object.owner) do |fu|
|
10
|
+
= render 'effective/fee_payments/demographics_fields', f: fu
|
11
|
+
|
12
|
+
= f.save 'Save and Continue'
|
@@ -0,0 +1,20 @@
|
|
1
|
+
= render 'layout' do
|
2
|
+
|
3
|
+
.card
|
4
|
+
.card-body
|
5
|
+
%p Welcome #{current_user.effective_memberships_owner}!
|
6
|
+
|
7
|
+
= render 'effective/fee_payments/content', resource: resource
|
8
|
+
|
9
|
+
- if resource.outstanding_fees.blank?
|
10
|
+
%p You have no fees due at this time.
|
11
|
+
= link_to 'Home', root_path, class: 'btn btn-primary'
|
12
|
+
|
13
|
+
- if resource.outstanding_fees.present?
|
14
|
+
%p You have the following fees due at this time:
|
15
|
+
|
16
|
+
= render_purchasables(resource.outstanding_fees)
|
17
|
+
|
18
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
19
|
+
= f.hidden_field :id
|
20
|
+
= f.save 'Save and Continue'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
= render 'layout' do
|
2
|
+
= render 'effective/fee_payments/content', resource: resource
|
3
|
+
|
4
|
+
- raise('expected a submitted fee_payment') unless resource.was_submitted?
|
5
|
+
- raise('expected a purchased fee_payment submit_order') unless resource.submit_order&.purchased?
|
6
|
+
|
7
|
+
.alert.alert-success.mb-4
|
8
|
+
Fee successfully paid on
|
9
|
+
= resource.submit_order.purchased_at.strftime('%F')
|
10
|
+
|
11
|
+
= render 'effective/fee_payments/fee_payment', fee_payment: resource
|
12
|
+
= render 'effective/fee_payments/orders', fee_payment: resource
|
13
|
+
|
14
|
+
= link_to "Return to Dashboard", root_path, class: 'btn btn-lg btn-primary btn-block'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
= render 'layout' do
|
2
|
+
= render 'effective/fee_payments/content', resource: resource
|
3
|
+
|
4
|
+
= render('effective/fee_payments/fee_payment', fee_payment: resource)
|
5
|
+
|
6
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
7
|
+
= f.hidden_field :id
|
8
|
+
= f.submit 'Save and Continue', class: 'btn btn-primary'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
%h2 Fees
|
2
|
+
- current_owner = current_user.effective_memberships_owner
|
3
|
+
|
4
|
+
- fees = current_owner.outstanding_fee_payment_fees
|
5
|
+
- membership = current_owner.membership
|
6
|
+
|
7
|
+
- if membership.present?
|
8
|
+
- if membership.category.create_renewal_fees?
|
9
|
+
- date = EffectiveMemberships.Registrar.renewal_fee_date(date: Time.zone.now)
|
10
|
+
%p Annual fees become available for purchase on #{date.strftime('%B %d')} of each year.
|
11
|
+
|
12
|
+
- if membership.category.create_late_fees?
|
13
|
+
- date = EffectiveMemberships.Registrar.late_fee_date(date: Time.zone.now)
|
14
|
+
%p Late fees will be applied on #{date.strftime('%B %d')}.
|
15
|
+
|
16
|
+
- if fees.present?
|
17
|
+
.alert.alert-warning.mb-3 You have #{pluralize(fees.length , 'outstanding fee')}.
|
18
|
+
|
19
|
+
%p= link_to 'Pay Fees', effective_memberships.new_fee_payment_path, class: 'btn btn-primary'
|
20
|
+
|
21
|
+
- else
|
22
|
+
%p You have no outstanding fees at this time. Thank you!
|
@@ -0,0 +1,37 @@
|
|
1
|
+
%table.table
|
2
|
+
%tbody
|
3
|
+
%tr
|
4
|
+
%th Category
|
5
|
+
%td= fee.category
|
6
|
+
|
7
|
+
- if fee.category.present?
|
8
|
+
%tr
|
9
|
+
%th Membership Category
|
10
|
+
%td
|
11
|
+
- if request.path.start_with?('/admin')
|
12
|
+
= link_to(fee.category, effective_memberships.edit_admin_category_path(fee.category))
|
13
|
+
- else
|
14
|
+
= fee.category
|
15
|
+
|
16
|
+
- if request.path.start_with?('/admin')
|
17
|
+
%tr
|
18
|
+
%th Owner
|
19
|
+
%td
|
20
|
+
- url = (edit_admin_user_path(fee.owner) rescue "/admin/users/#{fee.owner.to_param}/edit")
|
21
|
+
= link_to(fee.owner, url)
|
22
|
+
|
23
|
+
%tr
|
24
|
+
%th Purchased
|
25
|
+
%td
|
26
|
+
- if fee.purchased_order.present?
|
27
|
+
= link_to(fee.purchased_order, effective_orders.admin_order_path(fee.purchased_order))
|
28
|
+
- else
|
29
|
+
Not Purchased
|
30
|
+
|
31
|
+
%tr
|
32
|
+
%th Period
|
33
|
+
%td= fee.period
|
34
|
+
|
35
|
+
%tr
|
36
|
+
%th Price
|
37
|
+
%td= price_to_currency(fee.price)
|
@@ -0,0 +1,29 @@
|
|
1
|
+
%h2 Membership
|
2
|
+
- current_owner = current_user.effective_memberships_owner
|
3
|
+
- membership = current_owner.membership
|
4
|
+
|
5
|
+
- if membership.present?
|
6
|
+
- if membership.categories.length == 0
|
7
|
+
You are a member.
|
8
|
+
- elsif membership.categories.length == 1
|
9
|
+
%p You are a #{membership.category} member.
|
10
|
+
- else
|
11
|
+
%p You are a member of the following:
|
12
|
+
|
13
|
+
%ul
|
14
|
+
- membership.categories.each do |category|
|
15
|
+
%li= category
|
16
|
+
|
17
|
+
%p Your membership number is ##{membership.number} and you joined on #{membership.joined_on.strftime('%F')}.
|
18
|
+
|
19
|
+
- if membership.registration_on > membership.joined_on
|
20
|
+
%p You last changed categories on #{membership.registration_on.strftime('%F')}.
|
21
|
+
|
22
|
+
- if membership.bad_standing?
|
23
|
+
%p Your membership is in bad standing with the following reason: #{membership.bad_standing_reason}.
|
24
|
+
|
25
|
+
- elsif current_owner.membership_removed?
|
26
|
+
%p Your membership was removed on #{current_owner.membership_removed_on.strftime('%F')}.
|
27
|
+
|
28
|
+
- else
|
29
|
+
%p You are not a member.
|
@@ -0,0 +1,40 @@
|
|
1
|
+
%table.table
|
2
|
+
%tbody
|
3
|
+
%tr
|
4
|
+
%th Joined
|
5
|
+
%td= membership.joined_on.strftime('%F')
|
6
|
+
|
7
|
+
%tr
|
8
|
+
%th Registered
|
9
|
+
%td= membership.registration_on.strftime('%F')
|
10
|
+
|
11
|
+
- if membership.categories.length == 0
|
12
|
+
%tr
|
13
|
+
%th Category
|
14
|
+
%td None
|
15
|
+
- elsif membership.categories.length == 1
|
16
|
+
%tr
|
17
|
+
%th Category
|
18
|
+
%td= membership.category
|
19
|
+
- else
|
20
|
+
%tr
|
21
|
+
%th Categories
|
22
|
+
%td
|
23
|
+
- membership.categories.each do |category|
|
24
|
+
%div= category
|
25
|
+
|
26
|
+
%tr
|
27
|
+
%th Number
|
28
|
+
%td= membership.number
|
29
|
+
|
30
|
+
%tr
|
31
|
+
%th Fees Paid Through
|
32
|
+
%td= membership.fees_paid_through_period&.strftime('%F') || '-'
|
33
|
+
|
34
|
+
%tr
|
35
|
+
%th In Bad Standing
|
36
|
+
%td
|
37
|
+
- if membership.bad_standing?
|
38
|
+
%p Yes. #{membership.bad_standing_reason}
|
39
|
+
- else
|
40
|
+
= '-'
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
subject: 'Your application was approved!'
|
3
|
+
from: 'admin@example.com'
|
4
|
+
---
|
5
|
+
Hello {{ user.name }},
|
6
|
+
|
7
|
+
Your application for {{ applicant.to_category }} was approved!
|
8
|
+
|
9
|
+
Please log in and purchase any outstanding fees.
|
10
|
+
|
11
|
+
{{ applicant.url }}
|
12
|
+
|
13
|
+
Thank you.
|
14
|
+
|
15
|
+
Please contact us for assistance.
|
@@ -0,0 +1,13 @@
|
|
1
|
+
---
|
2
|
+
subject: 'Your application to join was declined'
|
3
|
+
from: 'admin@example.com'
|
4
|
+
---
|
5
|
+
Hello {{ user.name }},
|
6
|
+
|
7
|
+
Your application for {{ applicant.to_category }} has been declined with the following reason:
|
8
|
+
|
9
|
+
{{ applicant.declined_reason }}
|
10
|
+
|
11
|
+
Thank you.
|
12
|
+
|
13
|
+
Please contact us for assistance.
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
subject: 'Your reference has been requested'
|
3
|
+
from: 'admin@example.com'
|
4
|
+
---
|
5
|
+
Hello {{ reference.name }},
|
6
|
+
|
7
|
+
An applicant, {{ user.name }}, has added you as a reference.
|
8
|
+
|
9
|
+
Would you please complete the reference declaration form at this url:
|
10
|
+
|
11
|
+
{{ reference.url }}
|
12
|
+
|
13
|
+
Thank you.
|
14
|
+
|
15
|
+
Please contact us for assistance.
|
@@ -0,0 +1,47 @@
|
|
1
|
+
EffectiveMemberships.setup do |config|
|
2
|
+
config.categories_table_name = :categories
|
3
|
+
config.applicants_table_name = :applicants
|
4
|
+
config.applicant_reviews_table_name = :applicant_reviews
|
5
|
+
config.fee_payments_table_name = :fee_payments
|
6
|
+
|
7
|
+
# Layout Settings
|
8
|
+
# Configure the Layout per controller, or all at once
|
9
|
+
# config.layout = { application: 'application', admin: 'admin' }
|
10
|
+
|
11
|
+
# Membership Categories Settings
|
12
|
+
# Configure the class responsible for the membership categories.
|
13
|
+
# This should extend from Effective::Category
|
14
|
+
# And handle all the business logic for your membership categories.
|
15
|
+
# config.category_class_name = 'Effective::Category'
|
16
|
+
# config.applicant_class_name = 'Effective::Applicant'
|
17
|
+
# config.applicant_review_class_name = 'Effective::ApplicantReview'
|
18
|
+
# config.registrar_class_name = 'Effective::Registrar'
|
19
|
+
|
20
|
+
# Fee Categories
|
21
|
+
# The defaults include: Applicant, Prorated, Renewal, Late, Admin
|
22
|
+
# config.additional_fee_types = []
|
23
|
+
|
24
|
+
# Mailer Configuration
|
25
|
+
# Configure the class responsible to send e-mails.
|
26
|
+
# config.mailer = 'Effective::MembershipsMailer'
|
27
|
+
|
28
|
+
# Configure the parent class responsible to send e-mails.
|
29
|
+
# config.parent_mailer = 'ActionMailer::Base'
|
30
|
+
|
31
|
+
# Default deliver method
|
32
|
+
# config.deliver_method = :deliver_later
|
33
|
+
|
34
|
+
# Default layout
|
35
|
+
config.mailer_layout = 'effective_memberships_mailer_layout'
|
36
|
+
|
37
|
+
# Default From
|
38
|
+
config.mailer_sender = "no-reply@example.com"
|
39
|
+
|
40
|
+
# Send Admin correspondence To
|
41
|
+
config.mailer_admin = "admin@example.com"
|
42
|
+
|
43
|
+
# Will work with effective_email_templates gem:
|
44
|
+
# - The audit and audit review email content will be preopulated based off the template
|
45
|
+
# - Uses an EmailTemplatesMailer mailer instead of ActionMailer::Base for default parent_mailer
|
46
|
+
config.use_effective_email_templates = false
|
47
|
+
end
|
data/config/routes.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
Rails.application.routes.draw do
|
2
|
+
mount EffectiveMemberships::Engine => '/', as: 'effective_memberships'
|
3
|
+
end
|
4
|
+
|
5
|
+
EffectiveMemberships::Engine.routes.draw do
|
6
|
+
# Public routes
|
7
|
+
scope module: 'effective' do
|
8
|
+
resources :applicants, only: [:new, :show, :destroy] do
|
9
|
+
resources :build, controller: :applicants, only: [:show, :update]
|
10
|
+
end
|
11
|
+
|
12
|
+
resources :applicant_references, only: [:new, :create, :show, :update] do
|
13
|
+
post :notify, on: :member
|
14
|
+
end
|
15
|
+
|
16
|
+
resources :fee_payments, only: [:new, :show] do
|
17
|
+
resources :build, controller: :fee_payments, only: [:show, :update]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
namespace :admin do
|
22
|
+
resources :applicants, except: [:new, :create, :show]
|
23
|
+
resources :fees
|
24
|
+
resources :categories, except: [:show]
|
25
|
+
|
26
|
+
resources :applicant_course_areas, except: [:show]
|
27
|
+
resources :applicant_course_names, except: [:show]
|
28
|
+
|
29
|
+
resources :registrar_actions, only: [:create]
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|