effective_memberships 0.9.3 → 0.9.4

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: f57ff3c095107ed08c1fb5d61bdb0a942199a18401a35f5a4eb58628ada269e3
4
- data.tar.gz: c73dd52a349cc82ef354d022fe896d4b6ede70e8e0f049f4b37027e4042a9c71
3
+ metadata.gz: 611d01eb6651211b44bbc681c6060aa4a74541a08ec9ac59d3b0d1972ceacbfc
4
+ data.tar.gz: 78796ebd87001ae6e9448f48892d61b034077637ceea0437084a259746824e57
5
5
  SHA512:
6
- metadata.gz: 976725ff16f1b3cf32613f0a5ac941e28fdb26ba417dd70e1d4f11518ac76417de00a769839c65d849ea746f8bbddf5ff95e381ede4c5b03a978f4af0eb28033
7
- data.tar.gz: de46c665dbe1985743eeddafd51e9b56b67bd06bd301140111c238953e903f0abf69ee50e52a4cd409be9d28a77e5adb923096930b481fd301be119fc1d41185
6
+ metadata.gz: 60bd9e7864f520588a47b4ef69a9460c5cbadbc7fbd0718086566787a16e785348666e87c16c41a6e95826c6b4cd5b93a5c9c67a239b14a5ed82699681e6c279
7
+ data.tar.gz: 5032cf5a31bda06e919a7abc9009c00ae2d3fcaf25c2889453184839b625cdaa8987c88c95ae7c462c0fb501d6303126b1f2a0b8f14778bbb7d945d49574c9ff
@@ -6,15 +6,21 @@ class EffectiveApplicantReviewsDatatable < Effective::Datatable
6
6
  col :created_at, visible: false
7
7
  col :id, visible: false
8
8
 
9
- col :applicant
9
+ val :applicant, search: :string
10
10
  col :reviewer, visible: false
11
11
 
12
12
  col :submitted_at, label: 'Reviewed', as: :date
13
+
14
+ col :reviews do |applicant_review|
15
+ pluralize(applicant_review.applicant.applicant_reviews.count { |review| review.submitted? }, 'review')
16
+ end
17
+
13
18
  col :recommendation
14
19
  col :comments
15
20
 
16
21
  actions_col(show: false) do |applicant_review|
17
22
  dropdown_link_to('Show', effective_memberships.applicant_applicant_review_path(applicant_review.applicant, applicant_review))
23
+ dropdown_link_to('Review Again', effective_memberships.new_applicant_applicant_review_path(applicant_review.applicant))
18
24
  end
19
25
  end
20
26
 
@@ -7,15 +7,18 @@ class EffectiveAvailableApplicantReviewsDatatable < Effective::Datatable
7
7
 
8
8
  col :created_at, label: 'Created', as: :date, visible: false
9
9
  col :updated_at, label: 'Updated', as: :date, visible: false
10
- col :submitted_at, label: 'Submitted', as: :date, visible: false
11
10
 
12
11
  # This is when they become available for review
13
- col :completed_at, label: 'Date', as: :date
12
+ col :submitted_at, label: 'Submitted', as: :date
14
13
 
15
14
  col :user
16
15
  col :category, label: 'Category'
17
16
  col :to_status, label: 'Status'
18
17
 
18
+ col :reviews do |applicant|
19
+ pluralize(applicant.applicant_reviews.count { |review| review.submitted? }, 'review')
20
+ end
21
+
19
22
  actions_col(show: false) do |applicant|
20
23
  applicant_review = applicant.applicant_review(reviewer: current_user)
21
24
 
@@ -187,7 +187,7 @@ module EffectiveMembershipsApplicant
187
187
 
188
188
  scope :not_draft, -> { where.not(status: :draft) }
189
189
 
190
- scope :reviewable, -> { where(status: :completed) }
190
+ scope :reviewable, -> { where.not(status: [:draft, :declined, :approved]) }
191
191
 
192
192
  scope :for, -> (user) {
193
193
  raise('expected a effective memberships user') unless user.class.try(:effective_memberships_user?)
@@ -59,7 +59,7 @@ module EffectiveMembershipsApplicantReview
59
59
  timestamps
60
60
  end
61
61
 
62
- scope :deep, -> { includes(:reviewer, applicant: :user) }
62
+ scope :deep, -> { includes(:reviewer, applicant: [:user, :applicant_reviews]) }
63
63
 
64
64
  scope :for, -> (user) {
65
65
  raise('expected a effective memberships user') unless user.class.try(:effective_memberships_user?)
@@ -26,11 +26,11 @@
26
26
  - if available.present?
27
27
  %p The following applicants are available for your review:
28
28
 
29
- = render_simple_datatable(available)
29
+ = render_datatable(available, simple: true)
30
30
  - else
31
31
  %p There are no applicants available for your review. When there are, we'll show them here.
32
32
 
33
33
  - if datatable.present?
34
34
  .mt-4
35
35
  %h2 Review History
36
- = render_datatable(datatable, simple: true)
36
+ = render_datatable(datatable)
@@ -0,0 +1,7 @@
1
+ - other_reviews = applicant_review.applicant.applicant_reviews.select { |review| review != applicant_review }
2
+
3
+ - if other_reviews.present?
4
+ .mb-4
5
+ = collapse('Show other reviews') do
6
+ - other_reviews.each do |applicant_review|
7
+ = render('effective/applicant_reviews/applicant_review', applicant_review: applicant_review)
@@ -8,6 +8,8 @@
8
8
  = collapse('Show application...', card_class: 'my-2') do
9
9
  = render 'effective/applicants/applicant', applicant: resource.applicant
10
10
 
11
+ = render 'effective/applicant_reviews/other_reviews', applicant_review: resource
12
+
11
13
  = card('Recommendation') do
12
14
 
13
15
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
@@ -5,6 +5,8 @@
5
5
  = render 'effective/applicants/summary', applicant: resource.applicant
6
6
  = render 'effective/applicants/applicant', applicant: resource.applicant
7
7
 
8
+ = render 'effective/applicant_reviews/other_reviews', applicant_review: resource
9
+
8
10
  = card do
9
11
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
10
12
  = f.hidden_field :id
@@ -10,6 +10,8 @@
10
10
  = collapse('Show application...', card_class: 'my-2') do
11
11
  = render 'effective/applicants/applicant', applicant: resource.applicant
12
12
 
13
+ = render 'effective/applicant_reviews/other_reviews', applicant_review: resource
14
+
13
15
  = render 'effective/applicant_reviews/applicant_review', applicant_review: resource
14
16
 
15
- = link_to "Return to Dashboard", root_path, class: 'btn btn-lg btn-primary btn-block'
17
+ = link_to "Return to Dashboard", return_to_dashboard_path, class: 'btn btn-lg btn-primary btn-block'
@@ -39,4 +39,4 @@
39
39
  = collapse('Show orders...', card_class: 'my-2') do
40
40
  = render 'effective/applicants/orders', applicant: resource
41
41
 
42
- = link_to "Return to Dashboard", root_path, class: 'btn btn-lg btn-primary btn-block'
42
+ = link_to "Return to Dashboard", return_to_dashboard_path, class: 'btn btn-lg btn-primary btn-block'
@@ -7,7 +7,7 @@
7
7
  .alert.alert-warning.mb-4
8
8
  Successfully paid on #{resource.submit_order.purchased_at.strftime('%F')}.
9
9
 
10
- = link_to "Return to Dashboard", root_path, class: 'btn btn-lg btn-primary mb-4'
10
+ = link_to "Return to Dashboard", return_to_dashboard_path, class: 'btn btn-lg btn-primary btn-block'
11
11
 
12
12
  = card do
13
13
  = render 'effective/fee_payments/summary', fee_payment: resource
@@ -20,4 +20,4 @@
20
20
  = collapse('Show orders...', card_class: 'my-2') do
21
21
  = render 'effective/fee_payments/orders', fee_payment: resource
22
22
 
23
- = link_to "Return to Dashboard", root_path, class: 'btn btn-lg btn-primary'
23
+ = link_to "Return to Dashboard", return_to_dashboard_path, class: 'btn btn-lg btn-primary btn-block'
@@ -1,3 +1,3 @@
1
1
  module EffectiveMemberships
2
- VERSION = '0.9.3'
2
+ VERSION = '0.9.4'
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.9.3
4
+ version: 0.9.4
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-11-23 00:00:00.000000000 Z
11
+ date: 2022-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -407,6 +407,7 @@ files:
407
407
  - app/views/effective/applicant_reviews/_content.html.haml
408
408
  - app/views/effective/applicant_reviews/_dashboard.html.haml
409
409
  - app/views/effective/applicant_reviews/_layout.html.haml
410
+ - app/views/effective/applicant_reviews/_other_reviews.html.haml
410
411
  - app/views/effective/applicant_reviews/_recommendation.html.haml
411
412
  - app/views/effective/applicant_reviews/_review.html.haml
412
413
  - app/views/effective/applicant_reviews/recommendation.html.haml