effective_cpd 0.3.1 → 0.3.2
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/models/effective/cpd_audit.rb +6 -3
- data/app/views/admin/cpd_audits/_form.html.haml +3 -0
- data/app/views/admin/cpd_audits/_form_deadlines.html.haml +12 -0
- data/app/views/effective/cpd_audits/conflict.html.haml +1 -1
- data/app/views/effective/cpd_audits/exemption.html.haml +1 -1
- data/app/views/effective/cpd_audits/extension.html.haml +1 -1
- data/db/migrate/01_create_effective_cpd.rb.erb +2 -0
- data/lib/effective_cpd/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf98009925976387ffeafade80664bc5b17f9790b7172d0be90b84ed0ee86707
|
4
|
+
data.tar.gz: 073aa23104da3dbbf673798f27a6ffe80ea999b34fdc6df9cd7d08b5765897ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0b842326dc273ea10fe3232bbaea3266dd3ca43f248e0798fb5cee1db386da08befaa56f8880fcc43b5558d039926a9823000ea293d2d71f06f2e4dee9fa978
|
7
|
+
data.tar.gz: efb3b2c91cbf7976156f8bc169fd7f483399f10894a335b0a936cfd75f0235350d6af3e79e846ee22f40c6b91ed3f3c891cefe931b7212057073c5fcec2d5055
|
@@ -76,6 +76,9 @@ module Effective
|
|
76
76
|
# Final determination
|
77
77
|
determination :string
|
78
78
|
|
79
|
+
# Override Deadlines
|
80
|
+
ignore_deadlines :boolean
|
81
|
+
|
79
82
|
# Auditee response
|
80
83
|
conflict_of_interest :boolean
|
81
84
|
conflict_of_interest_reason :text
|
@@ -130,17 +133,17 @@ module Effective
|
|
130
133
|
validates :extension_request_date, presence: true, if: -> { extension_request? }
|
131
134
|
validates :extension_request_reason, presence: true, if: -> { extension_request? }
|
132
135
|
|
133
|
-
validate(if: -> { current_step == :conflict && conflict_of_interest? }) do
|
136
|
+
validate(if: -> { current_step == :conflict && conflict_of_interest? && !ignore_deadlines? }) do
|
134
137
|
deadline = deadline_to_conflict_of_interest()
|
135
138
|
self.errors.add(:base, 'deadline to declare conflict of interest has already passed') if deadline && deadline < Time.zone.now
|
136
139
|
end
|
137
140
|
|
138
|
-
validate(if: -> { current_step == :exemption && exemption_request? }) do
|
141
|
+
validate(if: -> { current_step == :exemption && exemption_request? && !ignore_deadlines? }) do
|
139
142
|
deadline = deadline_to_exemption()
|
140
143
|
self.errors.add(:base, 'deadline to request exemption has already passed') if deadline && deadline < Time.zone.now
|
141
144
|
end
|
142
145
|
|
143
|
-
validate(if: -> { current_step == :extension && extension_request? }) do
|
146
|
+
validate(if: -> { current_step == :extension && extension_request? && !ignore_deadlines? }) do
|
144
147
|
deadline = deadline_to_extension()
|
145
148
|
self.errors.add(:base, 'deadline to request extension has already passed') if deadline && deadline < Time.zone.now
|
146
149
|
end
|
@@ -17,6 +17,9 @@
|
|
17
17
|
= tab 'Audit' do
|
18
18
|
= render 'effective/cpd_audits/cpd_audit', cpd_audit: cpd_audit
|
19
19
|
|
20
|
+
= tab 'Deadlines' do
|
21
|
+
= render 'admin/cpd_audits/form_deadlines', cpd_audit: cpd_audit
|
22
|
+
|
20
23
|
= tab 'Statements' do
|
21
24
|
- datatable = Admin::EffectiveCpdStatementsDatatable.new(user_id: cpd_audit.user.id, user_type: cpd_audit.user.class.name)
|
22
25
|
= render_datatable(datatable, inline: true, simple: true)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
= card('Deadlines') do
|
2
|
+
= effective_form_with(model: [:admin, cpd_audit], engine: true) do |f|
|
3
|
+
%p The audittee has the following deadlines:
|
4
|
+
|
5
|
+
%ul
|
6
|
+
%li To declare conflict of interest: #{f.object.deadline_to_conflict_of_interest}
|
7
|
+
%li To request exemption: #{f.object.deadline_to_exemption}
|
8
|
+
%li To request extension: #{f.object.deadline_to_extension}
|
9
|
+
|
10
|
+
= f.check_box :ignore_deadlines, label: 'Yes, ignore audittee deadlines and allow these actions to be performed'
|
11
|
+
|
12
|
+
= f.submit 'Save', center: true
|
@@ -5,7 +5,7 @@
|
|
5
5
|
- resource.cpd_audit_reviews.each do |cpd_audit_review|
|
6
6
|
%li #{cpd_audit_review.user} <#{mail_to(cpd_audit_review.user.email)}>
|
7
7
|
|
8
|
-
- if resource.deadline_to_conflict_of_interest.present?
|
8
|
+
- if resource.deadline_to_conflict_of_interest.present? && !resource.ignore_deadlines?
|
9
9
|
%p The deadline to declare a conflict of interest is: #{resource.deadline_to_conflict_of_interest.strftime('%F')}.
|
10
10
|
|
11
11
|
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
- if resource.was_exemption_requested?
|
3
3
|
= render('effective/cpd_audits/exemption', cpd_audit: resource, step: :exemption)
|
4
4
|
|
5
|
-
- if resource.deadline_to_exemption.present?
|
5
|
+
- if resource.deadline_to_exemption.present? && !resource.ignore_deadlines?
|
6
6
|
%p The deadline to request an exemption is: #{resource.deadline_to_exemption.strftime('%F')}.
|
7
7
|
|
8
8
|
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
- if resource.was_extension_requested?
|
3
3
|
= render('effective/cpd_audits/extension', cpd_audit: resource, step: :extension)
|
4
4
|
|
5
|
-
- if resource.deadline_to_extension.present?
|
5
|
+
- if resource.deadline_to_extension.present? && !resource.ignore_deadlines?
|
6
6
|
%p The deadline to request an extension is: #{resource.deadline_to_extension.strftime('%F')}.
|
7
7
|
|
8
8
|
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_cpd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
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-03-
|
11
|
+
date: 2022-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -246,6 +246,7 @@ files:
|
|
246
246
|
- app/views/admin/cpd_audits/_auditee_fields.html.haml
|
247
247
|
- app/views/admin/cpd_audits/_form.html.haml
|
248
248
|
- app/views/admin/cpd_audits/_form_conflict.html.haml
|
249
|
+
- app/views/admin/cpd_audits/_form_deadlines.html.haml
|
249
250
|
- app/views/admin/cpd_audits/_form_determination.html.haml
|
250
251
|
- app/views/admin/cpd_audits/_form_exemption.html.haml
|
251
252
|
- app/views/admin/cpd_audits/_form_extension.html.haml
|