effective_memberships 0.5.2 → 0.5.3

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: 0e562d7ef78e3298066d1051a02aee3f0e81515a5221f5210f0782403d4634a6
4
- data.tar.gz: 7951880cdf0b2fd8f0a4dfbff341b58ef61853cab50d36da54ed31ee5f16f457
3
+ metadata.gz: 20013e5735497e62dd4c8224ef8fe0a97f9cc12d285871541cea4ceaefa13796
4
+ data.tar.gz: 0b652f51e8b7ac62c99c11b7a6a5fe6961e8b79a579048aaa7e06b8ad5dca204
5
5
  SHA512:
6
- metadata.gz: 3a46a6e3b2117e117aef3dd3ee1d28e4f6cb9790ce22144193549c54cd6c96253f2268287e6f228083e7d526b14d6b1091cb196091caf1f7da7eec9df5f5ac65
7
- data.tar.gz: 5cf7629541e967ce4ffd3c06a1e0953cc0d36fa2528e4fb85a4418ce1c5ff77e71f13ea172e77d1fea3d9f2f73623dc5b285079099e51be2df385ad0f572587b
6
+ metadata.gz: bde5324d4cadb8f64caca5fa6cc8eb0910015514df5bcad58170a78be4e27e736fcbd1d306b3fa19f919a49183d4a0e940b82b17d2f7401d6d87927b5c9a36b6
7
+ data.tar.gz: b3cd7c41dc00b22804ab6e8df8904807b0099758ce479807f682e2686cd5c64362fd0be534af0181868a29f8c2935e4f7dd7c72d6b1d2f3e56f78ebcc543d2c2
@@ -0,0 +1,20 @@
1
+ # For the Endorser's dashboard to display endorsements to complete
2
+ class EffectiveApplicantEndorsersDatatable < Effective::Datatable
3
+
4
+ datatable do
5
+ length :all
6
+
7
+ col :created_at
8
+ col :applicant
9
+
10
+ actions_col do |applicant_endorsement|
11
+ dropdown_link_to 'Show', effective_memberships.applicant_endorsement_path(applicant_endorsement)
12
+ end
13
+
14
+ end
15
+
16
+ collection do
17
+ Effective::ApplicantEndorsement.deep.needs_endorser.where(endorser: current_user)
18
+ end
19
+
20
+ end
@@ -28,6 +28,10 @@ module EffectiveMembershipsUser
28
28
 
29
29
  accepts_nested_attributes_for :representatives, allow_destroy: true
30
30
 
31
+ # I'm an endorser for these
32
+ has_many :applicant_endorsements, -> { Effective::ApplicantEndorsement.sorted },
33
+ class_name: 'Effective::ApplicantEndorsement', inverse_of: :endorser, as: :endorser, dependent: :nullify
34
+
31
35
  scope :membership_applying, -> {
32
36
  applicants = EffectiveMemberships.Applicant.all
33
37
  without_role(:member).where(id: applicants.select(:user_id))
@@ -39,6 +39,9 @@ module Effective
39
39
  end
40
40
 
41
41
  scope :deep, -> { all }
42
+ scope :sorted, -> { order(:id) }
43
+
44
+ scope :needs_endorser, -> { where(status: :submitted).where(applicant_id: EffectiveMemberships.Applicant.not_draft) }
42
45
 
43
46
  # All step validations
44
47
  validates :applicant, presence: true
@@ -0,0 +1,10 @@
1
+ - datatable = EffectiveApplicantEndorsersDatatable.new(self, endorser: current_user)
2
+
3
+ %h2 Endorsements
4
+
5
+ - if datatable.present?
6
+ %p Your endorsement has been requested on the following applicants:
7
+ = render_simple_datatable(datatable)
8
+
9
+ - else
10
+ %p There are no applicant endorsements to complete.
@@ -1,3 +1,3 @@
1
1
  module EffectiveMemberships
2
- VERSION = '0.5.2'
2
+ VERSION = '0.5.3'
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.5.2
4
+ version: 0.5.3
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-08-19 00:00:00.000000000 Z
11
+ date: 2022-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -292,6 +292,7 @@ files:
292
292
  - app/datatables/effective_applicant_courses_datatable.rb
293
293
  - app/datatables/effective_applicant_educations_datatable.rb
294
294
  - app/datatables/effective_applicant_endorsements_datatable.rb
295
+ - app/datatables/effective_applicant_endorsers_datatable.rb
295
296
  - app/datatables/effective_applicant_equivalences_datatable.rb
296
297
  - app/datatables/effective_applicant_experiences_datatable.rb
297
298
  - app/datatables/effective_applicant_references_datatable.rb
@@ -391,6 +392,7 @@ files:
391
392
  - app/views/effective/applicant_endorsements/_form_declaration.html.haml
392
393
  - app/views/effective/applicant_endorsements/complete.html.haml
393
394
  - app/views/effective/applicant_endorsements/edit.html.haml
395
+ - app/views/effective/applicant_endorsers/_dashboard.html.haml
394
396
  - app/views/effective/applicant_references/_applicant_reference.html.haml
395
397
  - app/views/effective/applicant_references/_datatable_actions.html.haml
396
398
  - app/views/effective/applicant_references/_form.html.haml