effective_memberships 0.4.12 → 0.4.13

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: 9e598cee90bcbc1349b12ff9d56babaf0686ddcc91f6ed162c8a8edc6c4b5c67
4
- data.tar.gz: 8ace8c8625d529b305e832b9f24c5377be98e3da711a7d146fdf67d613bf7a93
3
+ metadata.gz: 013c543f704442649f57e61b6d381da7abd27a181b8cfb00eafcca8713eec4d0
4
+ data.tar.gz: 71d84f67fad2d7f5718fd6186eed8ee3877ccc32292dcd56456fe93bd73918fe
5
5
  SHA512:
6
- metadata.gz: 2dadd826408201278a2cfcd8638399c140c755ceda775accdb015b8613e7f036d68dbd0776e39d77ff76bc41d0bec765972c33c1f859dc3dfcfc5ce3f57d965f
7
- data.tar.gz: 7d915acf40e2b27b05773674e536d70c45555ea217f3f7abaa34c330ee51c00d75c914681c91f8ec43d39d33c0fe2127a6614f1f5afc7fb8664b8af937b054cd
6
+ metadata.gz: f6e975206c149832fc53de2db37b08405c21b22021e1fdae0f5cbd6d619747f9288b86f38f22a943fe27e69a963af44fb9b201fa43cc3bac20d90211ea8cb557
7
+ data.tar.gz: 3ba98f86d83f2afc099d57463495aa7fa643a72af6b230156538eeebc0bb6b306bd2bae12726e651fc59b38cf1c2db353db881c6149049370d34aae189370657
@@ -24,6 +24,11 @@ module EffectiveMembershipsApplicant
24
24
  def categories
25
25
  ['Apply to Join', 'Apply to Reclassify']
26
26
  end
27
+
28
+ def transcripts_statuses
29
+ []
30
+ end
31
+
27
32
  end
28
33
 
29
34
  included do
@@ -48,6 +53,7 @@ module EffectiveMembershipsApplicant
48
53
  organization: 'Organization', # Organization only. Organization fields.
49
54
  education: 'Education',
50
55
  course_amounts: 'Courses',
56
+ transcripts: 'Transcripts',
51
57
  experience: 'Work Experience',
52
58
  references: 'References',
53
59
  files: 'Attach Files',
@@ -64,6 +70,10 @@ module EffectiveMembershipsApplicant
64
70
  log_changes(except: :wizard_steps) if respond_to?(:log_changes)
65
71
 
66
72
  has_many_attached :applicant_files
73
+ has_many_attached :transcripts
74
+
75
+ # Transcripts Step
76
+ attr_accessor :declare_will_send_transcripts
67
77
 
68
78
  # Declarations Step
69
79
  attr_accessor :declare_code_of_ethics
@@ -143,6 +153,11 @@ module EffectiveMembershipsApplicant
143
153
  applicant_experiences_months :integer
144
154
  applicant_experiences_details :text
145
155
 
156
+ # Transcripts
157
+ transcripts_received_on :date
158
+ transcripts_status :string
159
+ transcripts_details :text
160
+
146
161
  # Additional Information
147
162
  additional_information :text
148
163
 
@@ -284,6 +299,11 @@ module EffectiveMembershipsApplicant
284
299
  end
285
300
  end
286
301
 
302
+ # Transcripts step
303
+ with_options(if: -> { current_step == :transcripts }) do
304
+ validates :declare_will_send_transcripts, acceptance: true
305
+ end
306
+
287
307
  # Declarations Step
288
308
  with_options(if: -> { current_step == :declarations }) do
289
309
  validates :declare_code_of_ethics, acceptance: true
@@ -548,16 +568,33 @@ module EffectiveMembershipsApplicant
548
568
  category&.min_applicant_references.to_i
549
569
  end
550
570
 
571
+ def applicant_references_required?
572
+ min_applicant_references > 0
573
+ end
574
+
551
575
  # Endorsements Step
552
576
  def min_applicant_endorsements
553
577
  category&.min_applicant_endorsements.to_i
554
578
  end
555
579
 
580
+ def applicant_endorsements_required?
581
+ min_applicant_endorsements > 0
582
+ end
583
+
556
584
  # Equivalences Step
557
585
  def min_applicant_equivalences
558
586
  category&.min_applicant_equivalences.to_i
559
587
  end
560
588
 
589
+ # Transcripts Step
590
+ def transcripts_received?
591
+ transcripts_received_on_was.present?
592
+ end
593
+
594
+ def transcripts_required?
595
+ category.applicant_wizard_steps.include?(:transcripts)
596
+ end
597
+
561
598
  # Files Step
562
599
  def min_applicant_files
563
600
  category&.min_applicant_files.to_i
@@ -573,26 +610,22 @@ module EffectiveMembershipsApplicant
573
610
  )
574
611
  end
575
612
 
576
- def applicant_endorsements_required?
577
- min_applicant_endorsements > 0
578
- end
579
-
580
- def applicant_references_required?
581
- min_applicant_references > 0
582
- end
583
-
584
613
  # When an application is submitted, these must be done to go to completed.
585
614
  # An Admin can override this and just set them to completed.
586
615
  def completed_requirements
587
616
  requirements = {}
588
617
  return requirements unless category.present?
589
618
 
619
+ if category.applicant_wizard_steps.include?(:endorsements) || applicant_endorsements_required?
620
+ requirements['Applicant Endorsements'] = (!applicant_endorsements_required? || applicant_endorsements.count(&:completed?) >= min_applicant_endorsements)
621
+ end
622
+
590
623
  if category.applicant_wizard_steps.include?(:references) || applicant_references_required?
591
624
  requirements['Applicant References'] = (!applicant_references_required? || applicant_references.count(&:completed?) >= min_applicant_references)
592
625
  end
593
626
 
594
- if category.applicant_wizard_steps.include?(:endorsements) || applicant_endorsements_required?
595
- requirements['Applicant Endorsements'] = (!applicant_endorsements_required? || applicant_endorsements.count(&:completed?) >= min_applicant_endorsements)
627
+ if category.applicant_wizard_steps.include?(:transcripts) || transcripts_required?
628
+ requirements['Applicant Transcripts'] = (!transcripts_required? || transcripts_received?)
596
629
  end
597
630
 
598
631
  requirements
@@ -29,6 +29,10 @@
29
29
  = tab 'Endorsements' do
30
30
  .mb-4= render_inline_datatable(Admin::EffectiveApplicantEndorsementsDatatable.new(applicant: applicant))
31
31
 
32
+ - if applicant.transcripts_required?
33
+ = tab 'Transcripts' do
34
+ = render 'admin/applicants/form_transcripts', applicant: applicant
35
+
32
36
  - if applicant.fees.present? || applicant.orders.present?
33
37
  = tab 'Fees' do
34
38
  .mb-4
@@ -0,0 +1,12 @@
1
+ = effective_form_with(model: [:admin, applicant], engine: true) do |f|
2
+ = f.date_field :transcripts_received_on
3
+
4
+ - statuses = f.object.class.transcripts_statuses
5
+
6
+ - if statuses.present?
7
+ = f.select_field :transcripts_status, statuses
8
+
9
+ = f.file_field :transcripts
10
+ = f.text_area :transcripts_details, hint: 'These details will be displayed to the applicant'
11
+
12
+ = f.submit 'Save Transcripts', border: false, center: true
@@ -0,0 +1,30 @@
1
+ = wizard_card(applicant) do
2
+ %table.table
3
+ %tbody
4
+ %tr
5
+ %th Status
6
+ %td
7
+ - if applicant.transcripts_received?
8
+ Received on #{applicant.transcripts_received_on.strftime('%F')}
9
+ - else
10
+ Not yet received
11
+
12
+ - if applicant.transcripts_status.present?
13
+ %tr
14
+ %th Transcripts Status
15
+ %td= applicant.transcripts_status
16
+
17
+ - if applicant.transcripts_details.present?
18
+ %tr
19
+ %th Details
20
+ %td= applicant.transcripts_details
21
+
22
+ - if applicant.transcripts.present?
23
+ %tr
24
+ %th Transcripts Upload
25
+ %td
26
+ - applicant.transcripts.each do |file|
27
+ %p= link_to(file.filename, url_for(file), target: '_blank')
28
+
29
+ - unless applicant.transcripts_received?
30
+ = render('effective/applicants/transcripts_requirements', applicant: applicant)
@@ -0,0 +1,14 @@
1
+ %p
2
+ Official transcripts must be mailed directly from the institution
3
+ where the credential was granted to:
4
+
5
+ %p.text-center
6
+ TODO
7
+ %br
8
+ %br
9
+ %br
10
+
11
+ %p
12
+ = succeed('.') do
13
+ Institutions must send the electronic transcripts to
14
+ = mail_to 'todo@example.com'
@@ -0,0 +1,13 @@
1
+ = render 'layout' do
2
+ = render 'effective/applicants/content', resource: resource
3
+
4
+ = card do
5
+ .mb-2= render('transcripts_requirements', applicant: resource)
6
+
7
+ = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
8
+ = f.hidden_field :id
9
+
10
+ = f.check_box :declare_will_send_transcripts,
11
+ label: "Yes, I will request my transcripts be sent directly from the insitiution to the registrar.", required: true
12
+
13
+ = f.save 'Save and Continue'
@@ -209,6 +209,11 @@ class CreateEffectiveMemberships < ActiveRecord::Migration[6.0]
209
209
  t.integer :applicant_experiences_months
210
210
  t.text :applicant_experiences_details
211
211
 
212
+ # Transcripts
213
+ t.date :transcripts_received_on
214
+ t.string :transcripts_status
215
+ t.text :transcripts_details
216
+
212
217
  # Additional Information
213
218
  t.text :additional_information
214
219
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveMemberships
2
- VERSION = '0.4.12'
2
+ VERSION = '0.4.13'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_memberships
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.12
4
+ version: 0.4.13
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: 2022-07-01 00:00:00.000000000 Z
11
+ date: 2022-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -342,6 +342,7 @@ files:
342
342
  - app/views/admin/applicants/_form_decline.html.haml
343
343
  - app/views/admin/applicants/_form_missing_info.html.haml
344
344
  - app/views/admin/applicants/_form_process.html.haml
345
+ - app/views/admin/applicants/_form_transcripts.html.haml
345
346
  - app/views/admin/applicants/_status.html.haml
346
347
  - app/views/admin/categories/_form.html.haml
347
348
  - app/views/admin/categories/_form_applicant.html.haml
@@ -407,6 +408,8 @@ files:
407
408
  - app/views/effective/applicants/_select_organization.html.haml
408
409
  - app/views/effective/applicants/_stamp.html.haml
409
410
  - app/views/effective/applicants/_summary.html.haml
411
+ - app/views/effective/applicants/_transcripts.html.haml
412
+ - app/views/effective/applicants/_transcripts_requirements.html.haml
410
413
  - app/views/effective/applicants/billing.html.haml
411
414
  - app/views/effective/applicants/checkout.html.haml
412
415
  - app/views/effective/applicants/course_amounts.html.haml
@@ -424,6 +427,7 @@ files:
424
427
  - app/views/effective/applicants/start.html.haml
425
428
  - app/views/effective/applicants/submitted.html.haml
426
429
  - app/views/effective/applicants/summary.html.haml
430
+ - app/views/effective/applicants/transcripts.html.haml
427
431
  - app/views/effective/fee_payments/_content.html.haml
428
432
  - app/views/effective/fee_payments/_dashboard.html.haml
429
433
  - app/views/effective/fee_payments/_declarations.html.haml