effective_cpd 0.3.2 → 0.4.1

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: cf98009925976387ffeafade80664bc5b17f9790b7172d0be90b84ed0ee86707
4
- data.tar.gz: 073aa23104da3dbbf673798f27a6ffe80ea999b34fdc6df9cd7d08b5765897ec
3
+ metadata.gz: df7d2dbe808caefa87a85d090eba1d4b965b70bf968aa9531871b0d516d789a8
4
+ data.tar.gz: a216335a0dd7f11b9401e62fba037e6ddca712f6d783ef23b255de0262e4971d
5
5
  SHA512:
6
- metadata.gz: e0b842326dc273ea10fe3232bbaea3266dd3ca43f248e0798fb5cee1db386da08befaa56f8880fcc43b5558d039926a9823000ea293d2d71f06f2e4dee9fa978
7
- data.tar.gz: efb3b2c91cbf7976156f8bc169fd7f483399f10894a335b0a936cfd75f0235350d6af3e79e846ee22f40c6b91ed3f3c891cefe931b7212057073c5fcec2d5055
6
+ metadata.gz: b89ca9e4f87072ce55077b1a5ba3549a9c14d55d382b1061bd1bb766ef4bcbce941294f257715381e651efd87d05e6caa310dd0bb39ee655968d872127b8d565
7
+ data.tar.gz: 4f9d6bc3fb1079f9799eb0c5ad25a7c301ea3cccfe281878cd795de4b3bd748365268d8b06e683d52b3dd24f431e914c904da4c9b733bc11745a58b7de822e79
@@ -2,8 +2,8 @@ module Admin
2
2
  class EffectiveCpdAuditReviewsDatatable < Effective::Datatable
3
3
  filters do
4
4
  scope :all
5
- scope :available, label: 'In Progress'
6
5
  scope :completed
6
+ scope :available, label: 'In Progress'
7
7
  end
8
8
 
9
9
  datatable do
@@ -12,7 +12,14 @@ module Admin
12
12
  col :id, visible: false
13
13
 
14
14
  col :cpd_audit
15
+
16
+ col :auditee do |cpd_audit_review|
17
+ user = cpd_audit_review.cpd_audit.user
18
+ link_to(user, edit_admin_user_path(user))
19
+ end
20
+
15
21
  col :user, label: 'Audit Reviewer'
22
+
16
23
  col :due_date
17
24
  col :submitted_at, as: :date, label: 'Submitted'
18
25
  col :conflict_of_interest
@@ -47,6 +47,29 @@ module Admin
47
47
  col :due_date
48
48
 
49
49
  col :status
50
+
51
+ col(:cpd_audit_recommendations, label: 'Recommendation', visible: false) do |cpd_audit|
52
+ cpd_audit.cpd_audit_reviews.map(&:recommendation).map do |recommendation|
53
+ content_tag(:div, recommendation.to_s, class: 'col-resource_item')
54
+ end.join.html_safe
55
+ end
56
+
57
+ col(:cpd_audit_reveiw_item_recommendations, label: 'Item Recommendations', search: :string, visible: false) do |cpd_audit|
58
+ recommendations = cpd_audit.cpd_audit_reviews.map(&:recommendation)
59
+ item_recommendations = cpd_audit.cpd_audit_reviews.flat_map { |r| r.cpd_audit_review_items.map(&:recommendation) }
60
+
61
+ reviews = ((recommendations + item_recommendations) - ['', nil]).uniq
62
+ reviews.to_sentence
63
+ end
64
+
65
+ col(:cpd_audit_comments, label: 'Reviewer Comments', search: :string, visible: false) do |cpd_audit|
66
+ item_comments = cpd_audit.cpd_audit_reviews.flat_map { |r| r.cpd_audit_review_items.map(&:comments) }.join
67
+
68
+ cpd_audit.cpd_audit_reviews.map(&:comments).map do |comments|
69
+ content_tag(:div, simple_format(comments.to_s + item_comments), class: 'col-resource_item')
70
+ end.join.html_safe
71
+ end
72
+
50
73
  col :determination
51
74
 
52
75
  col(:auditee_cpd_statements, label: 'Auditee Statements', visible: false) do |cpd_audit|
@@ -7,7 +7,12 @@
7
7
  .row
8
8
  .col
9
9
  = f.text_field :title, label: 'Title'
10
- = f.rich_text_area :body, label: 'Body (optional)'
10
+
11
+ - if defined?(EffectiveArticleEditor)
12
+ = f.article_editor :body, label: 'Body (optional)'
13
+ - else
14
+ = f.rich_text_area :body, label: 'Body (optional)'
15
+
11
16
  .col
12
17
  = f.text_field :amount_label,
13
18
  hint: 'hours of work, papers written, courses attended'
@@ -5,7 +5,11 @@
5
5
  = f.select :cpd_audit_level_section_id, Effective::CpdAuditLevelSection.sorted.all
6
6
 
7
7
  = f.text_field :title, label: 'Question Title'
8
- = f.rich_text_area :body, label: 'Body (optional)'
8
+
9
+ - if defined?(EffectiveArticleEditor)
10
+ = f.article_editor :body, label: 'Body (optional)'
11
+ - else
12
+ = f.rich_text_area :body, label: 'Body (optional)'
9
13
 
10
14
  = f.check_box :required, hint: 'A response to this question will be required'
11
15
  = f.select :category, Effective::CpdAuditLevelQuestion::CATEGORIES
@@ -2,14 +2,18 @@
2
2
 
3
3
  = effective_form_with(model: [:admin, cpd_audit_level], engine: true) do |f|
4
4
  = card("All Steps Content") do
5
- = f.rich_text_area "rich_text_all_steps_audit_content", label: false,
6
- hint: "displayed on all steps"
5
+ - if defined?(EffectiveArticleEditor)
6
+ = f.article_editor "rich_text_all_steps_audit_content", label: false, hint: "displayed on all steps"
7
+ - else
8
+ = f.rich_text_area "rich_text_all_steps_audit_content", label: false, hint: "displayed on all steps"
7
9
 
8
10
  %hr
9
11
 
10
12
  - Effective::CpdAudit::WIZARD_STEPS.each do |step, title|
11
13
  = card("#{title} Content") do
12
- = f.rich_text_area "rich_text_#{step}_audit_content", label: false,
13
- hint: "displayed on the auditee wizard #{step} wizard step only"
14
+ - if defined?(EffectiveArticleEditor)
15
+ = f.article_editor "rich_text_#{step}_audit_content", label: false, hint: "displayed on the auditee wizard #{step} wizard step only"
16
+ - else
17
+ = f.rich_text_area "rich_text_#{step}_audit_content", label: false, hint: "displayed on the auditee wizard #{step} wizard step only"
14
18
 
15
19
  = f.submit
@@ -2,14 +2,18 @@
2
2
 
3
3
  = effective_form_with(model: [:admin, cpd_audit_level], engine: true) do |f|
4
4
  = card("All Steps Content") do
5
- = f.rich_text_area "rich_text_all_steps_audit_review_content", label: false,
6
- hint: "displayed on all steps"
5
+ - if defined?(EffectiveArticleEditor)
6
+ = f.article_editor "rich_text_all_steps_audit_review_content", label: false, hint: "displayed on all steps"
7
+ - else
8
+ = f.rich_text_area "rich_text_all_steps_audit_review_content", label: false, hint: "displayed on all steps"
7
9
 
8
10
  %hr
9
11
 
10
12
  - Effective::CpdAuditReview::WIZARD_STEPS.each do |step, title|
11
13
  = card("#{title} Content") do
12
- = f.rich_text_area "rich_text_#{step}_audit_review_content", label: false,
13
- hint: "displayed on the audit reviewer #{step} wizard step only"
14
+ - if defined?(EffectiveArticleEditor)
15
+ = f.article_editor "rich_text_#{step}_audit_review_content", label: false, hint: "displayed on the audit reviewer #{step} wizard step only"
16
+ - else
17
+ = f.rich_text_area "rich_text_#{step}_audit_review_content", label: false, hint: "displayed on the audit reviewer #{step} wizard step only"
14
18
 
15
19
  = f.submit
@@ -1,5 +1,9 @@
1
1
  = effective_form_with(model: [:admin, cpd_category], engine: true) do |f|
2
2
  = f.text_field :title
3
- = f.rich_text_area :body
3
+
4
+ - if defined?(EffectiveArticleEditor)
5
+ = f.article_editor :body
6
+ - else
7
+ = f.rich_text_area :body
4
8
 
5
9
  = effective_submit(f)
@@ -4,37 +4,58 @@
4
4
  .card.mb-4
5
5
  .card-body
6
6
  %h5.card-title All Steps Content
7
- = f.rich_text_area :all_steps_content, label: false, hint: 'displayed on all statement steps'
7
+ - if defined?(EffectiveArticleEditor)
8
+ = f.article_editor :all_steps_content, label: false, hint: 'displayed on all statement steps'
9
+ - else
10
+ = f.rich_text_area :all_steps_content, label: false, hint: 'displayed on all statement steps'
8
11
 
9
12
  .card.mb-4
10
13
  .card-body
11
14
  %h5.card-title Sidebar Content
12
- = f.rich_text_area :sidebar_content, label: false, hint: 'displayed on the sidebar on all statement steps'
15
+ - if defined?(EffectiveArticleEditor)
16
+ = f.article_editor :sidebar_content, label: false, hint: 'displayed on the sidebar on all statement steps'
17
+ - else
18
+ = f.rich_text_area :sidebar_content, label: false, hint: 'displayed on the sidebar on all statement steps'
13
19
 
14
20
  %h2 Individual Steps Content
15
21
  .card.mb-4
16
22
  .card-body
17
23
  %h5.card-title Start Step
18
- = f.rich_text_area :start_content, label: false, hint: 'displayed on the start step only'
24
+ - if defined?(EffectiveArticleEditor)
25
+ = f.article_editor :start_content, label: false, hint: 'displayed on the start step only'
26
+ - else
27
+ = f.rich_text_area :start_content, label: false, hint: 'displayed on the start step only'
19
28
 
20
29
  .card.mb-4
21
30
  .card-body
22
31
  %h5.card-title Activities Step
23
- = f.rich_text_area :activities_content, label: false, hint: 'displayed on the activities step only'
32
+ - if defined?(EffectiveArticleEditor)
33
+ = f.article_editor :activities_content, label: false, hint: 'displayed on the activities step only'
34
+ - else
35
+ = f.rich_text_area :activities_content, label: false, hint: 'displayed on the activities step only'
24
36
 
25
37
  .card.mb-4
26
38
  .card-body
27
39
  %h5.card-title Agreements Step
28
- = f.rich_text_area :agreements_content, label: false, hint: 'displayed on the agreements step only'
40
+ - if defined?(EffectiveArticleEditor)
41
+ = f.article_editor :agreements_content, label: false, hint: 'displayed on the agreements step only'
42
+ - else
43
+ = f.rich_text_area :agreements_content, label: false, hint: 'displayed on the agreements step only'
29
44
 
30
45
  .card.mb-4
31
46
  .card-body
32
47
  %h5.card-title Submit Step
33
- = f.rich_text_area :submit_content, label: false, hint: 'displayed on the submit step only'
48
+ - if defined?(EffectiveArticleEditor)
49
+ = f.article_editor :submit_content, label: false, hint: 'displayed on the submit step only'
50
+ - else
51
+ = f.rich_text_area :submit_content, label: false, hint: 'displayed on the submit step only'
34
52
 
35
53
  .card.mb-4
36
54
  .card-body
37
55
  %h5.card-title Complete Step
38
- = f.rich_text_area :complete_content, label: false, hint: 'displayed on the complete step only'
56
+ - if defined?(EffectiveArticleEditor)
57
+ = f.article_editor :complete_content, label: false, hint: 'displayed on the complete step only'
58
+ - else
59
+ = f.rich_text_area :complete_content, label: false, hint: 'displayed on the complete step only'
39
60
 
40
61
  = f.submit
@@ -0,0 +1,39 @@
1
+ %h2 Continuing Professional Development
2
+
3
+ - # Auditee datatables (4)
4
+ - auditing = EffectiveCpdAvailableAuditsDatatable.new(self)
5
+ - if auditing.present?
6
+ .mt-4
7
+ %p You have been selected for audit:
8
+ = render_datatable(auditing, simple: true)
9
+
10
+ - audited = EffectiveCpdCompletedAuditsDatatable.new(self)
11
+ - if audited.present?
12
+ .mt-4
13
+ %p You have completed these past audits:
14
+ = render_datatable(audited, simple: true)
15
+
16
+ - available = EffectiveCpdAvailableCyclesDatatable.new(self)
17
+ - if available.present?
18
+ .mt-4
19
+ %p Please submit a CPD statement for the following available #{cpd_cycles_label}:
20
+ = render_datatable(available, simple: true)
21
+
22
+ - completed = EffectiveCpdCompletedStatementsDatatable.new(self)
23
+ - if completed.present?
24
+ .mt-4
25
+ %p You have completed these past statements:
26
+ = render_datatable(completed, simple: true)
27
+
28
+ - # Auditor / Audit reviewer datatables (2)
29
+ - reviewing = EffectiveCpdAvailableAuditReviewsDatatable.new(self)
30
+ - if reviewing.present?
31
+ .mt-4
32
+ %p You have been selected to assess the following audits:
33
+ = render_datatable(reviewing, simple: true)
34
+
35
+ - reviewed = EffectiveCpdCompletedAuditReviewsDatatable.new(self)
36
+ - if reviewed.present?
37
+ .mt-4
38
+ %p You have completed these past audit assessments:
39
+ = render_datatable(reviewed, simple: true)
@@ -1,3 +1,3 @@
1
1
  module EffectiveCpd
2
- VERSION = '0.3.2'
2
+ VERSION = '0.4.1'
3
3
  end
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.2
4
+ version: 0.4.1
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-08 00:00:00.000000000 Z
11
+ date: 2022-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -261,6 +261,7 @@ files:
261
261
  - app/views/admin/cpd_cycles/_form_cpd_special_rules.html.haml
262
262
  - app/views/admin/cpd_special_rules/_form.html.haml
263
263
  - app/views/admin/cpd_statements/_cpd_statement.html.haml
264
+ - app/views/effective/cpd/_dashboard.html.haml
264
265
  - app/views/effective/cpd_audit_level_questions/_cpd_audit_level_question.html.haml
265
266
  - app/views/effective/cpd_audit_responses/_cpd_audit_response.html.haml
266
267
  - app/views/effective/cpd_audit_responses/_fields.html.haml