effective_cpd 1.1.1 → 1.1.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: deb0da2dfd0958689944cea459a4e237ac5f765cecb2b5fc081e513b1b648f38
4
- data.tar.gz: 913951e4a77ffa9fa00c22fb8c153702c7b05d3a9aefdeb4eaa90d3af0495a7d
3
+ metadata.gz: 00e8ed14d47f2bb89d1a33e12c76bf8e99b0470e65f7abcd282f23e0ec8b3a96
4
+ data.tar.gz: 835ab26687db053debee149640fe8b06d6e05ce518bc4601cd5e5e8a7d4e0bec
5
5
  SHA512:
6
- metadata.gz: '08548deb0cbcbb5ad26f4f7d962b06ebda9d63e1e230ec7950c212f39ee83b97805bd133e1a9a807e77da7b8173e0e7443c60b3a19c86a93bb1bfa19c411c7ca'
7
- data.tar.gz: 9180db8bd3c9cb84fbf13bc136cda24a4996822ff8217b0a3ddfd88501e646160209698ecde6734f32ab2a831aae1e11ec5cbacea96bdc43c973750c983f2c44
6
+ metadata.gz: 79844be2e538ec196567018344f52de6bb233ff0fe24d6a29ae19fe83c3f8dc6065a9cf1413a6c909ed0027a107c222d9eb531d516d256c3ac35b799efce9cc6
7
+ data.tar.gz: 248e3a12c2a0500fff24054b09b89fce3fb84ed7851edebecc14c613f4bc36f513cdbfffdef09afe14fb229f3921ee8d839a5a3641c291a00a38c6b18dd1e4b9
@@ -68,6 +68,7 @@ module EffectiveCpdAudit
68
68
  start: 'Start',
69
69
  information: 'Information',
70
70
  instructions: 'Instructions',
71
+ demographics: 'Demographics', # Individual only. Users fields.
71
72
 
72
73
  # These 4 steps are determined by audit_level settings
73
74
  conflict: 'Conflict of Interest',
@@ -90,7 +91,9 @@ module EffectiveCpdAudit
90
91
 
91
92
  # App scoped
92
93
  belongs_to :cpd_audit_level, polymorphic: true
94
+
93
95
  belongs_to :user, polymorphic: true # The user being audited
96
+ accepts_nested_attributes_for :user
94
97
 
95
98
  has_many :cpd_audit_reviews, -> { order(:id) }, inverse_of: :cpd_audit, dependent: :destroy
96
99
  accepts_nested_attributes_for :cpd_audit_reviews, allow_destroy: true
@@ -238,7 +241,7 @@ module EffectiveCpdAudit
238
241
  end
239
242
 
240
243
  def required_steps
241
- steps = [:start, :information, :instructions]
244
+ steps = [:start, :information, :instructions, :demographics]
242
245
 
243
246
  steps << :conflict if cpd_audit_level.conflict_of_interest?
244
247
 
@@ -72,6 +72,9 @@ module EffectiveCpdAuditLevel
72
72
  scope :deep, -> { all }
73
73
  scope :sorted, -> { order(:title) }
74
74
 
75
+ # For the Admin new cpd audit form
76
+ scope :new_cpd_audit_level_collection, -> { sorted }
77
+
75
78
  validates :title, presence: true
76
79
  validates :determinations, presence: true
77
80
  validates :recommendations, presence: true
@@ -3,7 +3,7 @@
3
3
  %h2 Audit
4
4
  = f.hidden_field :cpd_audit_level_type, value: EffectiveCpd.CpdAuditLevel.name
5
5
 
6
- = f.select :cpd_audit_level_id, EffectiveCpd.CpdAuditLevel.all.sorted, label: 'Audit level'
6
+ = f.select :cpd_audit_level_id, EffectiveCpd.CpdAuditLevel.new_cpd_audit_level_collection, label: 'Audit level'
7
7
 
8
8
  = f.date_field :notification_date, label: 'Date of notification', required: false,
9
9
  hint: "the starting date for any deadline calculations. leave blank for today's date"
@@ -1,5 +1,18 @@
1
1
  %h2 Continuing Professional Development
2
2
 
3
+ - # In progress
4
+ - cpd_audit = current_user.cpd_audits.in_progress.first
5
+
6
+ - if cpd_audit.present? && cpd_audit.in_progress?
7
+ %p Your audit is in progress.
8
+
9
+ %p
10
+ Please
11
+ = link_to("Continue audit", effective_cpd.cpd_audit_build_path(cpd_audit, cpd_audit.next_step), 'data-turbolinks' => false, class: 'btn btn-primary')
12
+ to continue.
13
+
14
+ %hr
15
+
3
16
  - # Auditee datatables (4)
4
17
  - auditing = EffectiveCpdAvailableAuditsDatatable.new(self)
5
18
  - if auditing.present?
@@ -3,6 +3,7 @@
3
3
 
4
4
  - steps = cpd_audit.required_steps.select { |step| cpd_audit.has_completed_step?(step) }
5
5
  - blacklist = [:start, :information, :instructions, :waiting, :questionnaire, :submit, :submitted]
6
+ - blacklist += [:demographics] if cpd_audit.anonymous?
6
7
 
7
8
  - (steps - blacklist).each do |step|
8
9
  - cpd_audit.render_step = step
@@ -0,0 +1,3 @@
1
+ = wizard_card(cpd_audit) do
2
+ - raise('demographics should not be displayed on anonymous audit') if cpd_audit.anonymous?
3
+ = render 'users/demographics', parent: cpd_audit, user: cpd_audit.user
@@ -0,0 +1,9 @@
1
+ = render('layout') do
2
+
3
+ = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
4
+ = f.hidden_field :current_step
5
+
6
+ = f.fields_for(:user, f.object.user) do |fu|
7
+ = render 'users/fields_demographics', f: fu, user: f.object.user, parent: resource
8
+
9
+ = f.save 'Save and Continue'
@@ -0,0 +1,61 @@
1
+ -# This is a placeholder file that should be overriden by the main application
2
+
3
+ %p Placeholder
4
+
5
+ %table.table.table-sm
6
+ %tbody
7
+ %tr
8
+ %th Name
9
+ %td= user.to_s
10
+
11
+ %tr
12
+ %th Email
13
+ %td= mail_to user.email
14
+
15
+ - if user.respond_to?(:job_title)
16
+ %tr
17
+ %th Job Title:
18
+ %td= user.job_title.presence || '-'
19
+
20
+ - if user.respond_to?(:date_of_birth)
21
+ %tr
22
+ %th Date of Birth
23
+ %td= user.date_of_birth&.strftime('%F').presence || '-'
24
+
25
+ - if user.respond_to?(:phone)
26
+ %tr
27
+ %th Phone:
28
+ %td= user.phone.presence || '-'
29
+
30
+ - if user.respond_to?(:home_phone)
31
+ %tr
32
+ %th Home Phone:
33
+ %td= user.home_phone.presence || '-'
34
+
35
+ - if user.respond_to?(:cell_phone)
36
+ %tr
37
+ %th Cell Phone:
38
+ %td= user.cell_phone.presence || '-'
39
+
40
+ - if user.respond_to?(:fax)
41
+ %tr
42
+ %th Fax:
43
+ %td= user.fax.presence || '-'
44
+
45
+ - if user.respond_to?(:residential_address)
46
+ %tr
47
+ %th Residential Address:
48
+ %td
49
+ - if user.residential_address.present?
50
+ = user.residential_address.to_html
51
+ - else
52
+ = '-'
53
+
54
+ - if user.respond_to?(:billing_address)
55
+ %tr
56
+ %th Billing Address:
57
+ %td
58
+ - if user.billing_address.present?
59
+ = user.billing_address.to_html
60
+ - else
61
+ = '-'
@@ -0,0 +1,31 @@
1
+ -# This is a placeholder file that should be overriden by the main application
2
+
3
+ %p Placeholder
4
+
5
+ - if f.object.respond_to?(:first_name)
6
+ = f.text_field :first_name
7
+
8
+ - if f.object.respond_to?(:last_name)
9
+ = f.text_field :last_name
10
+
11
+ - if f.object.respond_to?(:job_title)
12
+ = f.text_field :job_title
13
+
14
+ - if f.object.respond_to?(:date_of_birth)
15
+ = f.date_field :date_of_birth
16
+
17
+ - if f.object.respond_to?(:phone)
18
+ = f.tel_field :phone
19
+
20
+ - if f.object.respond_to?(:home_phone)
21
+ = f.tel_field :home_phone
22
+
23
+ - if f.object.respond_to?(:cell_phone)
24
+ = f.tel_field :cell_phone
25
+
26
+ - if f.object.respond_to?(:fax)
27
+ = f.tel_field :fax
28
+
29
+ - if f.object.respond_to?(:billing_address)
30
+ %h2 Billing Address
31
+ = effective_address_fields(f, :billing_address)
@@ -1,3 +1,3 @@
1
1
  module EffectiveCpd
2
- VERSION = '1.1.1'
2
+ VERSION = '1.1.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_cpd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
@@ -349,6 +349,7 @@ files:
349
349
  - app/views/effective/cpd_audits/_cpd.html.haml
350
350
  - app/views/effective/cpd_audits/_cpd_audit.html.haml
351
351
  - app/views/effective/cpd_audits/_cpd_audit_level_section.html.haml
352
+ - app/views/effective/cpd_audits/_demographics.html.haml
352
353
  - app/views/effective/cpd_audits/_exemption.html.haml
353
354
  - app/views/effective/cpd_audits/_extension.html.haml
354
355
  - app/views/effective/cpd_audits/_files.html.haml
@@ -360,6 +361,7 @@ files:
360
361
  - app/views/effective/cpd_audits/conflict.html.haml
361
362
  - app/views/effective/cpd_audits/cpd.html.haml
362
363
  - app/views/effective/cpd_audits/cpd_audit_level_section.html.haml
364
+ - app/views/effective/cpd_audits/demographics.html.haml
363
365
  - app/views/effective/cpd_audits/exemption.html.haml
364
366
  - app/views/effective/cpd_audits/extension.html.haml
365
367
  - app/views/effective/cpd_audits/files.html.haml
@@ -402,6 +404,8 @@ files:
402
404
  - app/views/effective/cpd_statements/complete.html.haml
403
405
  - app/views/effective/cpd_statements/start.html.haml
404
406
  - app/views/effective/cpd_statements/submit.html.haml
407
+ - app/views/users/_demographics.html.haml
408
+ - app/views/users/_fields_demographics.html.haml
405
409
  - config/effective_cpd.rb
406
410
  - config/routes.rb
407
411
  - db/migrate/01_create_effective_cpd.rb.erb