effective_memberships 0.2.2 → 0.2.3
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/controllers/admin/applicant_references_controller.rb +9 -0
- data/app/controllers/effective/applicant_references_controller.rb +3 -4
- data/app/datatables/admin/effective_applicant_references_datatable.rb +31 -0
- data/app/views/admin/applicant_references/_applicant_reference.html.haml +1 -0
- data/app/views/admin/applicants/_form.html.haml +4 -0
- data/app/views/admin/applicants/_status.html.haml +2 -2
- data/app/views/effective/applicant_references/_applicant_reference.html.haml +1 -1
- data/config/routes.rb +5 -0
- data/lib/effective_memberships/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 981aea653a25a94a440ce8599ab99cab71f429ac409a839f5f061d9731239d2e
|
4
|
+
data.tar.gz: b88503a72edd658d63e81b49d4b17c4402dde65d717692db4dff53f3b54c02fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67066fc2672c948a59c20cd1422e88d39a5b41be07aecf36ede4dcace2919e91c0d1058c165ebad70af7ed6dedcdc47015f447d89449c330d7cd1edf537a80cb
|
7
|
+
data.tar.gz: 7f46ea79c2d79e431f1150224180520850dbc683b399b9758801818d9ab213de67e6e4902a1e3861a1b16a5f54843fe048f5e0c5222d89cda27351ae5f6e28a6
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module Admin
|
2
|
+
class ApplicantReferencesController < ApplicationController
|
3
|
+
before_action(:authenticate_user!) if defined?(Devise)
|
4
|
+
before_action { EffectiveResources.authorize!(self, :admin, :effective_memberships) }
|
5
|
+
|
6
|
+
include Effective::CrudController
|
7
|
+
|
8
|
+
end
|
9
|
+
end
|
@@ -24,12 +24,11 @@ module Effective
|
|
24
24
|
|
25
25
|
def permitted_params
|
26
26
|
permitted = params.require(:effective_applicant_reference).permit!.except(:token, :last_notified_at, :status, :status_steps)
|
27
|
-
authorized = current_user.effective_memberships_owners.include?(resource.applicant.owner) == false
|
28
27
|
|
29
|
-
if
|
30
|
-
permitted
|
31
|
-
else
|
28
|
+
if current_user && current_user.effective_memberships_owners.include?(resource.applicant&.owner)
|
32
29
|
permitted.except(:reservations, :reservations_reason, :work_history, :accept_declaration)
|
30
|
+
else
|
31
|
+
permitted
|
33
32
|
end
|
34
33
|
|
35
34
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
class Admin::EffectiveApplicantReferencesDatatable < Effective::Datatable
|
2
|
+
|
3
|
+
datatable do
|
4
|
+
order :name
|
5
|
+
|
6
|
+
col :applicant
|
7
|
+
|
8
|
+
col :name
|
9
|
+
col :email
|
10
|
+
col :phone
|
11
|
+
|
12
|
+
col :status do |reference|
|
13
|
+
if reference.submitted?
|
14
|
+
'Waiting on response'
|
15
|
+
elsif reference.completed?
|
16
|
+
'Completed'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
col :last_notified_at do |reference|
|
21
|
+
reference.last_notified_at&.strftime('%F') unless reference.completed?
|
22
|
+
end
|
23
|
+
|
24
|
+
actions_col
|
25
|
+
end
|
26
|
+
|
27
|
+
collection do
|
28
|
+
Effective::ApplicantReference.deep.all
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
= render '/effective/applicant_references/applicant_reference', applicant_reference: applicant_reference, skip_actions: true
|
@@ -21,6 +21,10 @@
|
|
21
21
|
= tab 'Process' do
|
22
22
|
= render 'admin/applicants/form_process', applicant: applicant
|
23
23
|
|
24
|
+
- if applicant.applicant_references.present?
|
25
|
+
= tab 'References' do
|
26
|
+
.mb-4= render_inline_datatable(Admin::EffectiveApplicantReferencesDatatable.new(applicant: applicant))
|
27
|
+
|
24
28
|
- if applicant.fees.present?
|
25
29
|
= tab 'Fees' do
|
26
30
|
.mb-4= render_inline_datatable(Admin::EffectiveFeesDatatable.new(applicant_id: applicant.to_param))
|
@@ -51,9 +51,9 @@
|
|
51
51
|
= applicant.min_applicant_references
|
52
52
|
Required References Responded
|
53
53
|
- else
|
54
|
-
- if applicant.applicant_references.
|
54
|
+
- if applicant.applicant_references.present?
|
55
55
|
%p
|
56
|
-
= applicant.applicant_references.count(&:
|
56
|
+
= applicant.applicant_references.count(&:completed?)
|
57
57
|
= '/'
|
58
58
|
= applicant.applicant_references.count
|
59
59
|
References Responded
|
@@ -23,7 +23,7 @@
|
|
23
23
|
- elsif reference.completed?
|
24
24
|
Response completed
|
25
25
|
|
26
|
-
-
|
26
|
+
- unless reference.applicant.was_approved?
|
27
27
|
%tr
|
28
28
|
%th Last Notified at
|
29
29
|
%td= reference.last_notified_at&.strftime('%F') || 'Never'
|
data/config/routes.rb
CHANGED
@@ -22,6 +22,11 @@ EffectiveMemberships::Engine.routes.draw do
|
|
22
22
|
|
23
23
|
namespace :admin do
|
24
24
|
resources :applicants, except: [:new, :create, :show]
|
25
|
+
|
26
|
+
resources :applicant_references, only: [:show] do
|
27
|
+
post :notify, on: :member
|
28
|
+
end
|
29
|
+
|
25
30
|
resources :fees
|
26
31
|
resources :categories, except: [:show]
|
27
32
|
|
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.2.
|
4
|
+
version: 0.2.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-01-
|
11
|
+
date: 2022-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -240,6 +240,7 @@ files:
|
|
240
240
|
- app/assets/stylesheets/effective_memberships/base.scss
|
241
241
|
- app/controllers/admin/applicant_course_areas_controller.rb
|
242
242
|
- app/controllers/admin/applicant_course_names_controller.rb
|
243
|
+
- app/controllers/admin/applicant_references_controller.rb
|
243
244
|
- app/controllers/admin/applicants_controller.rb
|
244
245
|
- app/controllers/admin/categories_controller.rb
|
245
246
|
- app/controllers/admin/fee_payments_controller.rb
|
@@ -252,6 +253,7 @@ files:
|
|
252
253
|
- app/controllers/effective/memberships_directory_controller.rb
|
253
254
|
- app/datatables/admin/effective_applicant_course_areas_datatable.rb
|
254
255
|
- app/datatables/admin/effective_applicant_course_names_datatable.rb
|
256
|
+
- app/datatables/admin/effective_applicant_references_datatable.rb
|
255
257
|
- app/datatables/admin/effective_applicants_datatable.rb
|
256
258
|
- app/datatables/admin/effective_categories_datatable.rb
|
257
259
|
- app/datatables/admin/effective_fee_payments_datatable.rb
|
@@ -293,6 +295,7 @@ files:
|
|
293
295
|
- app/views/admin/applicant_course_areas/_form_applicant_course_area.html.haml
|
294
296
|
- app/views/admin/applicant_course_areas/index.html.haml
|
295
297
|
- app/views/admin/applicant_course_name/_form.html.haml
|
298
|
+
- app/views/admin/applicant_references/_applicant_reference.html.haml
|
296
299
|
- app/views/admin/applicants/_form.html.haml
|
297
300
|
- app/views/admin/applicants/_form_approve.html.haml
|
298
301
|
- app/views/admin/applicants/_form_decline.html.haml
|