effective_cpd 0.0.1 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (182) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +122 -10
  3. data/app/assets/javascripts/effective_cpd/activities.js +6 -0
  4. data/app/controllers/admin/cpd_audit_level_questions_controller.rb +13 -0
  5. data/app/controllers/admin/cpd_audit_levels_controller.rb +13 -0
  6. data/app/controllers/admin/cpd_audit_reviews_controller.rb +13 -0
  7. data/app/controllers/admin/cpd_audits_controller.rb +41 -0
  8. data/app/controllers/admin/cpd_special_rules_controller.rb +13 -0
  9. data/app/controllers/effective/cpd_audit_reviews_controller.rb +60 -0
  10. data/app/controllers/effective/cpd_audits_controller.rb +55 -0
  11. data/app/controllers/effective/cpd_cycles_controller.rb +1 -0
  12. data/app/controllers/effective/cpd_statements_controller.rb +1 -3
  13. data/app/datatables/admin/effective_cpd_audit_level_questions_datatable.rb +30 -0
  14. data/app/datatables/admin/effective_cpd_audit_levels_datatable.rb +34 -0
  15. data/app/datatables/admin/effective_cpd_audit_reviews_datatable.rb +29 -0
  16. data/app/datatables/admin/effective_cpd_audits_datatable.rb +67 -0
  17. data/app/datatables/admin/effective_cpd_special_rules_datatable.rb +23 -0
  18. data/app/datatables/admin/effective_cpd_statements_datatable.rb +3 -3
  19. data/app/datatables/effective_cpd_available_audit_reviews_datatable.rb +37 -0
  20. data/app/datatables/effective_cpd_available_audits_datatable.rb +30 -0
  21. data/app/datatables/{effective_cpd_datatable.rb → effective_cpd_available_cycles_datatable.rb} +3 -4
  22. data/app/datatables/effective_cpd_completed_audit_reviews_datatable.rb +32 -0
  23. data/app/datatables/effective_cpd_completed_audits_datatable.rb +24 -0
  24. data/app/datatables/effective_cpd_completed_statements_datatable.rb +28 -0
  25. data/app/helpers/effective_cpd_audits_helper.rb +48 -0
  26. data/app/helpers/effective_cpd_helper.rb +10 -0
  27. data/app/mailers/effective/cpd_mailer.rb +155 -3
  28. data/app/models/concerns/effective_cpd_user.rb +29 -0
  29. data/app/models/effective/cpd_activity.rb +16 -3
  30. data/app/models/effective/cpd_audit.rb +380 -0
  31. data/app/models/effective/cpd_audit_level.rb +87 -0
  32. data/app/models/effective/cpd_audit_level_question.rb +91 -0
  33. data/app/models/effective/cpd_audit_level_question_option.rb +34 -0
  34. data/app/models/effective/cpd_audit_level_section.rb +50 -0
  35. data/app/models/effective/cpd_audit_response.rb +86 -0
  36. data/app/models/effective/cpd_audit_response_option.rb +6 -0
  37. data/app/models/effective/cpd_audit_review.rb +222 -0
  38. data/app/models/effective/cpd_audit_review_item.rb +34 -0
  39. data/app/models/effective/cpd_category.rb +12 -3
  40. data/app/models/effective/cpd_cycle.rb +18 -2
  41. data/app/models/effective/cpd_rule.rb +23 -6
  42. data/app/models/effective/cpd_scorer.rb +23 -1
  43. data/app/models/effective/cpd_special_rule.rb +54 -0
  44. data/app/models/effective/cpd_special_rule_mate.rb +6 -0
  45. data/app/models/effective/cpd_statement.rb +25 -11
  46. data/app/views/admin/cpd_activities/_form.html.haml +1 -1
  47. data/app/views/admin/cpd_audit_level_questions/_form.html.haml +100 -0
  48. data/app/views/admin/cpd_audit_levels/_form.html.haml +24 -0
  49. data/app/views/admin/cpd_audit_levels/_form_content_audit.html.haml +15 -0
  50. data/app/views/admin/cpd_audit_levels/_form_content_audit_review.html.haml +15 -0
  51. data/app/views/admin/cpd_audit_levels/_form_cpd_audit_level.html.haml +52 -0
  52. data/app/views/admin/cpd_audit_levels/_form_cpd_audit_level_section.html.haml +10 -0
  53. data/app/views/admin/cpd_audit_reviews/_cpd_audit_review.html.haml +1 -0
  54. data/app/views/admin/cpd_audit_reviews/_form.html.haml +13 -0
  55. data/app/views/admin/cpd_audits/_audit_reviewer_fields.html.haml +2 -0
  56. data/app/views/admin/cpd_audits/_auditee_fields.html.haml +2 -0
  57. data/app/views/admin/cpd_audits/_form.html.haml +46 -0
  58. data/app/views/admin/cpd_audits/_form_conflict.html.haml +24 -0
  59. data/app/views/admin/cpd_audits/_form_determination.html.haml +10 -0
  60. data/app/views/admin/cpd_audits/_form_exemption.html.haml +24 -0
  61. data/app/views/admin/cpd_audits/_form_extension.html.haml +24 -0
  62. data/app/views/admin/cpd_audits/_form_new.html.haml +28 -0
  63. data/app/views/admin/cpd_audits/_status.html.haml +121 -0
  64. data/app/views/admin/cpd_categories/_form.html.haml +1 -1
  65. data/app/views/admin/cpd_cycles/_form.html.haml +6 -3
  66. data/app/views/admin/cpd_cycles/_form_content.html.haml +8 -0
  67. data/app/views/admin/cpd_cycles/_form_cpd_cycle.html.haml +3 -0
  68. data/app/views/admin/cpd_cycles/_form_cpd_rules.html.haml +12 -7
  69. data/app/views/admin/cpd_cycles/_form_cpd_special_rules.html.haml +4 -0
  70. data/app/views/admin/cpd_special_rules/_form.html.haml +18 -0
  71. data/app/views/admin/cpd_statements/_cpd_statement.html.haml +7 -0
  72. data/app/views/effective/cpd_audit_level_questions/_cpd_audit_level_question.html.haml +5 -0
  73. data/app/views/effective/cpd_audit_responses/_cpd_audit_response.html.haml +4 -0
  74. data/app/views/effective/cpd_audit_responses/_fields.html.haml +13 -0
  75. data/app/views/effective/cpd_audit_responses/fields/_choose_one.html.haml +1 -0
  76. data/app/views/effective/cpd_audit_responses/fields/_date.html.haml +2 -0
  77. data/app/views/effective/cpd_audit_responses/fields/_email.html.haml +2 -0
  78. data/app/views/effective/cpd_audit_responses/fields/_long_answer.html.haml +1 -0
  79. data/app/views/effective/cpd_audit_responses/fields/_number.html.haml +2 -0
  80. data/app/views/effective/cpd_audit_responses/fields/_select_all_that_apply.html.haml +1 -0
  81. data/app/views/effective/cpd_audit_responses/fields/_select_up_to_1.html.haml +1 -0
  82. data/app/views/effective/cpd_audit_responses/fields/_select_up_to_2.html.haml +1 -0
  83. data/app/views/effective/cpd_audit_responses/fields/_select_up_to_3.html.haml +1 -0
  84. data/app/views/effective/cpd_audit_responses/fields/_select_up_to_4.html.haml +1 -0
  85. data/app/views/effective/cpd_audit_responses/fields/_select_up_to_5.html.haml +1 -0
  86. data/app/views/effective/cpd_audit_responses/fields/_short_answer.html.haml +1 -0
  87. data/app/views/effective/cpd_audit_responses/fields/_upload_file.html.haml +1 -0
  88. data/app/views/effective/cpd_audit_responses/responses/_choose_one.html.haml +1 -0
  89. data/app/views/effective/cpd_audit_responses/responses/_date.html.haml +1 -0
  90. data/app/views/effective/cpd_audit_responses/responses/_email.html.haml +1 -0
  91. data/app/views/effective/cpd_audit_responses/responses/_long_answer.html.haml +1 -0
  92. data/app/views/effective/cpd_audit_responses/responses/_number.html.haml +1 -0
  93. data/app/views/effective/cpd_audit_responses/responses/_select_all_that_apply.html.haml +5 -0
  94. data/app/views/effective/cpd_audit_responses/responses/_select_up_to_1.html.haml +1 -0
  95. data/app/views/effective/cpd_audit_responses/responses/_select_up_to_2.html.haml +5 -0
  96. data/app/views/effective/cpd_audit_responses/responses/_select_up_to_3.html.haml +5 -0
  97. data/app/views/effective/cpd_audit_responses/responses/_select_up_to_4.html.haml +5 -0
  98. data/app/views/effective/cpd_audit_responses/responses/_select_up_to_5.html.haml +5 -0
  99. data/app/views/effective/cpd_audit_responses/responses/_short_answer.html.haml +1 -0
  100. data/app/views/effective/cpd_audit_responses/responses/_upload_file.html.haml +4 -0
  101. data/app/views/effective/cpd_audit_review_items/_cpd_audit_review_item.html.haml +6 -0
  102. data/app/views/effective/cpd_audit_review_items/_fields.html.haml +11 -0
  103. data/app/views/effective/cpd_audit_reviews/_conflict.html.haml +15 -0
  104. data/app/views/effective/cpd_audit_reviews/_cpd_audit_level_section.html.haml +23 -0
  105. data/app/views/effective/cpd_audit_reviews/_cpd_audit_review.html.haml +17 -0
  106. data/app/views/effective/cpd_audit_reviews/_cpd_statement.html.haml +15 -0
  107. data/app/views/effective/cpd_audit_reviews/_layout.html.haml +24 -0
  108. data/app/views/effective/cpd_audit_reviews/_recommendation.html.haml +9 -0
  109. data/app/views/effective/cpd_audit_reviews/_summary.html.haml +47 -0
  110. data/app/views/effective/cpd_audit_reviews/complete.html.haml +20 -0
  111. data/app/views/effective/cpd_audit_reviews/conflict.html.haml +21 -0
  112. data/app/views/effective/cpd_audit_reviews/cpd_audit_level_section.html.haml +43 -0
  113. data/app/views/effective/cpd_audit_reviews/cpd_statement.html.haml +35 -0
  114. data/app/views/effective/cpd_audit_reviews/information.html.haml +5 -0
  115. data/app/views/effective/cpd_audit_reviews/instructions.html.haml +10 -0
  116. data/app/views/effective/cpd_audit_reviews/questionnaire.html.haml +8 -0
  117. data/app/views/effective/cpd_audit_reviews/recommendation.html.haml +21 -0
  118. data/app/views/effective/cpd_audit_reviews/start.html.haml +10 -0
  119. data/app/views/effective/cpd_audit_reviews/statements.html.haml +29 -0
  120. data/app/views/effective/cpd_audit_reviews/submit.html.haml +14 -0
  121. data/app/views/effective/cpd_audit_reviews/waiting.html.haml +9 -0
  122. data/app/views/effective/cpd_audits/_conflict.html.haml +15 -0
  123. data/app/views/effective/cpd_audits/_cpd_audit.html.haml +12 -0
  124. data/app/views/effective/cpd_audits/_cpd_audit_level_section.html.haml +14 -0
  125. data/app/views/effective/cpd_audits/_exemption.html.haml +26 -0
  126. data/app/views/effective/cpd_audits/_extension.html.haml +30 -0
  127. data/app/views/effective/cpd_audits/_files.html.haml +12 -0
  128. data/app/views/effective/cpd_audits/_layout.html.haml +33 -0
  129. data/app/views/effective/cpd_audits/_summary.html.haml +54 -0
  130. data/app/views/effective/cpd_audits/_waiting.html.haml +6 -0
  131. data/app/views/effective/cpd_audits/complete.html.haml +24 -0
  132. data/app/views/effective/cpd_audits/conflict.html.haml +22 -0
  133. data/app/views/effective/cpd_audits/cpd_audit_level_section.html.haml +20 -0
  134. data/app/views/effective/cpd_audits/exemption.html.haml +19 -0
  135. data/app/views/effective/cpd_audits/extension.html.haml +21 -0
  136. data/app/views/effective/cpd_audits/files.html.haml +7 -0
  137. data/app/views/effective/cpd_audits/information.html.haml +5 -0
  138. data/app/views/effective/cpd_audits/instructions.html.haml +5 -0
  139. data/app/views/effective/cpd_audits/questionnaire.html.haml +5 -0
  140. data/app/views/effective/cpd_audits/start.html.haml +11 -0
  141. data/app/views/effective/cpd_audits/submit.html.haml +15 -0
  142. data/app/views/effective/cpd_audits/waiting.html.haml +24 -0
  143. data/app/views/effective/cpd_mailer/README.md +1 -0
  144. data/app/views/effective/cpd_mailer/cpd_audit_closed.liquid +15 -0
  145. data/app/views/effective/cpd_mailer/cpd_audit_conflict_resolved.liquid +15 -0
  146. data/app/views/effective/cpd_mailer/cpd_audit_conflicted.liquid +13 -0
  147. data/app/views/effective/cpd_mailer/cpd_audit_exemption_denied.liquid +13 -0
  148. data/app/views/effective/cpd_mailer/cpd_audit_exemption_granted.liquid +13 -0
  149. data/app/views/effective/cpd_mailer/cpd_audit_exemption_request.liquid +13 -0
  150. data/app/views/effective/cpd_mailer/cpd_audit_extension_denied.liquid +13 -0
  151. data/app/views/effective/cpd_mailer/cpd_audit_extension_granted.liquid +13 -0
  152. data/app/views/effective/cpd_mailer/cpd_audit_extension_request.liquid +13 -0
  153. data/app/views/effective/cpd_mailer/cpd_audit_opened.liquid +13 -0
  154. data/app/views/effective/cpd_mailer/cpd_audit_review_opened.liquid +15 -0
  155. data/app/views/effective/cpd_mailer/cpd_audit_review_ready.liquid +13 -0
  156. data/app/views/effective/cpd_mailer/cpd_audit_review_submitted.liquid +11 -0
  157. data/app/views/effective/cpd_mailer/cpd_audit_reviewed.liquid +13 -0
  158. data/app/views/effective/cpd_mailer/cpd_audit_submitted.liquid +13 -0
  159. data/app/views/effective/cpd_statement_activities/_cpd_statement_activity.html.haml +65 -0
  160. data/app/views/effective/cpd_statement_activities/_form.html.haml +10 -10
  161. data/app/views/effective/cpd_statements/_activities.html.haml +3 -64
  162. data/app/views/effective/cpd_statements/_activities_edit.html.haml +2 -0
  163. data/app/views/effective/cpd_statements/_activities_new.html.haml +3 -0
  164. data/app/views/effective/cpd_statements/_activities_table.html.haml +64 -0
  165. data/app/views/effective/cpd_statements/_agreements.html.haml +19 -5
  166. data/app/views/effective/cpd_statements/_cpd_statement.html.haml +6 -3
  167. data/app/views/effective/cpd_statements/_layout.html.haml +3 -4
  168. data/app/views/effective/cpd_statements/_summary.html.haml +26 -31
  169. data/app/views/effective/cpd_statements/activities.html.haml +1 -1
  170. data/app/views/effective/cpd_statements/agreements.html.haml +7 -1
  171. data/app/views/effective/cpd_statements/submit.html.haml +2 -3
  172. data/config/effective_cpd.rb +49 -10
  173. data/config/routes.rb +19 -1
  174. data/db/migrate/01_create_effective_cpd.rb.erb +175 -1
  175. data/db/seeds.rb +16 -13
  176. data/lib/effective_cpd.rb +42 -3
  177. data/lib/effective_cpd/engine.rb +7 -0
  178. data/lib/effective_cpd/version.rb +1 -1
  179. data/lib/generators/effective_cpd/install_generator.rb +18 -3
  180. metadata +175 -9
  181. data/app/datatables/effective_cpd_statements_datatable.rb +0 -23
  182. data/app/views/admin/cpd_statements/_form.html.haml +0 -6
@@ -3,8 +3,8 @@
3
3
  = render 'admin/cpd_cycles/form_cpd_cycle', cpd_cycle: cpd_cycle
4
4
 
5
5
  - if cpd_cycle.persisted?
6
- = tab 'Content' do
7
- = render 'admin/cpd_cycles/form_content', cpd_cycle: cpd_cycle
6
+ = tab 'Special Rules' do
7
+ = render 'admin/cpd_cycles/form_cpd_special_rules', cpd_cycle: cpd_cycle
8
8
 
9
9
  = tab 'Category and Activity Rules' do
10
10
  = tabs do
@@ -12,6 +12,9 @@
12
12
  = tab(cpd_category.to_s) do
13
13
  = render 'admin/cpd_cycles/form_cpd_rules', cpd_cycle: cpd_cycle, cpd_category: cpd_category
14
14
 
15
+ = tab 'Content' do
16
+ = render 'admin/cpd_cycles/form_content', cpd_cycle: cpd_cycle
17
+
15
18
  - if cpd_cycle.respond_to?(:log_changes_datatable)
16
19
  = tab 'Logs' do
17
- = render_datatable(cpd_cycle.log_changes_datatable)
20
+ = render_inline_datatable(cpd_cycle.log_changes_datatable)
@@ -1,9 +1,17 @@
1
1
  = effective_form_with(model: [:admin, cpd_cycle], engine: true) do |f|
2
+ %h2 All Steps Content
3
+
2
4
  .card.mb-4
3
5
  .card-body
4
6
  %h5.card-title All Steps Content
5
7
  = f.rich_text_area :all_steps_content, label: false, hint: 'displayed on all statement steps'
6
8
 
9
+ .card.mb-4
10
+ .card-body
11
+ %h5.card-title Sidebar Content
12
+ = f.rich_text_area :sidebar_content, label: false, hint: 'displayed on the sidebar on all statement steps'
13
+
14
+ %h2 Individual Steps Content
7
15
  .card.mb-4
8
16
  .card-body
9
17
  %h5.card-title Start Step
@@ -8,6 +8,9 @@
8
8
  = f.date_field :end_at,
9
9
  hint: "The last date statements may be created for this #{cpd_cycle_label}. leave blank for no end date."
10
10
 
11
+ = f.number_field :required_score,
12
+ hint: "The minimum required #{cpd_credits_label} to submit statements for this #{cpd_cycle_label}. leave blank to submit any score."
13
+
11
14
  - if f.object.new_record?
12
15
  - latest_cycle = Effective::CpdCycle.latest_cycle
13
16
 
@@ -6,12 +6,17 @@
6
6
  %p= link_to 'Edit Category', edit_path, target: '_blank'
7
7
 
8
8
  = f.fields_for :cpd_rules, cpd_cycle.rule_for(cpd_category) do |fc|
9
- = fc.number_field :max_credits_per_cycle,
10
- label: "Max #{cpd_credits_label} per #{cpd_cycle_label}",
11
- hint: "The maximum number of #{cpd_credits_label} that may be earned in this category for this #{cpd_cycle_label}. Leave blank for no limit."
12
-
13
- = fc.text_field :credit_description,
14
- hint: "A simple description of the maximum #{cpd_credits_label} and carry forward policy of activities for this category"
9
+ .row
10
+ .col
11
+ = fc.number_field :max_credits_per_cycle,
12
+ label: "Max #{cpd_credits_label} per #{cpd_cycle_label}",
13
+ hint: "The maximum number of #{cpd_credits_label} that may be earned in this category for this #{cpd_cycle_label}. Leave blank for no limit."
14
+ .col
15
+ = f.select :cpd_special_rule_ids, cpd_cycle.cpd_special_rules,
16
+ label: 'Special Rules', hint: "Special rules operate on more than one category at a time"
17
+
18
+ = fc.rich_text_area :category_credit_description,
19
+ hint: "A description of the maximum #{cpd_credits_label} and carry forward policy of activities for this category"
15
20
 
16
21
  = fc.check_box :unavailable, label: "Unavailable in this #{cpd_cycle_label}"
17
22
 
@@ -49,7 +54,7 @@
49
54
 
50
55
  = fa.number_field :max_cycles_can_carry_forward,
51
56
  label: "Max #{cpd_cycles_label} can carry forward",
52
- hint: "leave blank for no limit"
57
+ hint: "leave blank for no limit. enter zero for no carry forward."
53
58
 
54
59
  = fa.check_box :unavailable, label: "Unavailable in this #{cpd_cycle_label}"
55
60
 
@@ -0,0 +1,4 @@
1
+ %p Special rules operate on more than one category at a time.
2
+
3
+ - datatable = Admin::EffectiveCpdSpecialRulesDatatable.new(cpd_cycle_id: cpd_cycle.id)
4
+ = render_datatable(datatable, inline: true)
@@ -0,0 +1,18 @@
1
+ = effective_form_with(model: [:admin, cpd_special_rule], engine: true) do |f|
2
+ - if inline_datatable?
3
+ = f.hidden_field :cpd_cycle_id
4
+ - else
5
+ = f.select :cpd_cycle_id, Effective::CpdCycle.sorted.all, label: cpd_cycle_label.titleize
6
+
7
+ = f.select :category, Effective::CpdSpecialRule::CATEGORIES
8
+
9
+ = f.show_if :category, 'cumulative max credits' do
10
+ = f.number_field :max_credits_per_cycle, label: "Cumulative max credits per #{cpd_cycle_label}",
11
+ hint: "The cumulative max #{cpd_credits_label} per #{cpd_cycle_label} that can be earned between the following categories."
12
+
13
+ - cpd_category_rules = cpd_special_rule.cpd_cycle.cpd_rules.select(&:category?)
14
+
15
+ = f.select :cpd_rule_ids, cpd_category_rules, label: 'Cumulative max included categories',
16
+ hint: "These categories will shared a maximum cumulative #{cpd_credits_label} per #{cpd_cycle_label}."
17
+
18
+ = effective_submit(f)
@@ -0,0 +1,7 @@
1
+ = tabs do
2
+ = tab 'Statement' do
3
+ = render('effective/cpd_statements/cpd_statement', cpd_statement: cpd_statement)
4
+
5
+ - if cpd_statement.persisted? && cpd_statement.respond_to?(:log_changes_datatable)
6
+ = tab 'Logs' do
7
+ = render_inline_datatable(cpd_statement.log_changes_datatable)
@@ -0,0 +1,5 @@
1
+ .cpd-audit-level-question
2
+ = cpd_audit_level_question
3
+
4
+ - if cpd_audit_level_question.body.present?
5
+ = cpd_audit_level_question.body
@@ -0,0 +1,4 @@
1
+ - partial = 'effective/cpd_audit_responses/responses/' + cpd_audit_response.category_partial
2
+
3
+ .cpd-audit-response
4
+ = render(partial, cpd_audit_response: cpd_audit_response)
@@ -0,0 +1,13 @@
1
+ .row
2
+ .col
3
+ = render(cpd_audit_level_question)
4
+
5
+ %p.text-muted
6
+ %small= cpd_audit_level_question.category
7
+
8
+ = f.hidden_field :cpd_audit_id
9
+ = f.hidden_field :cpd_audit_level_question_id
10
+
11
+ - cpd_audit_response = f.object
12
+ - partial = 'effective/cpd_audit_responses/fields/' + cpd_audit_level_question.category_partial
13
+ = render(partial, f: f, cpd_audit_response: cpd_audit_response, cpd_audit_level_question: cpd_audit_level_question)
@@ -0,0 +1 @@
1
+ = f.radios :cpd_audit_level_question_option_ids, cpd_audit_level_question.cpd_audit_level_question_options, label: false, required: cpd_audit_level_question.required?
@@ -0,0 +1,2 @@
1
+ .row
2
+ .col-sm-6= f.date_field :date, label: false, required: cpd_audit_level_question.required?
@@ -0,0 +1,2 @@
1
+ .row
2
+ .col-sm-6= f.email_field :email, label: false, required: cpd_audit_level_question.required?
@@ -0,0 +1 @@
1
+ = f.text_area :long_answer, label: false, required: cpd_audit_level_question.required?
@@ -0,0 +1,2 @@
1
+ .row
2
+ .col-sm-6= f.number_field :number, label: false, required: cpd_audit_level_question.required?
@@ -0,0 +1 @@
1
+ = f.checks :cpd_audit_level_question_option_ids, cpd_audit_level_question.cpd_audit_level_question_options, label: false, required: cpd_audit_level_question.required?
@@ -0,0 +1 @@
1
+ = f.checks :cpd_audit_level_question_option_ids, cpd_audit_level_question.cpd_audit_level_question_options, label: false, actions: false, required: cpd_audit_level_question.required?
@@ -0,0 +1 @@
1
+ = f.checks :cpd_audit_level_question_option_ids, cpd_audit_level_question.cpd_audit_level_question_options, label: false, actions: false, required: cpd_audit_level_question.required?
@@ -0,0 +1 @@
1
+ = f.checks :cpd_audit_level_question_option_ids, cpd_audit_level_question.cpd_audit_level_question_options, label: false, actions: false, required: cpd_audit_level_question.required?
@@ -0,0 +1 @@
1
+ = f.checks :cpd_audit_level_question_option_ids, cpd_audit_level_question.cpd_audit_level_question_options, label: false, actions: false, required: cpd_audit_level_question.required?
@@ -0,0 +1 @@
1
+ = f.checks :cpd_audit_level_question_option_ids, cpd_audit_level_question.cpd_audit_level_question_options, label: false, actions: false, required: cpd_audit_level_question.required?
@@ -0,0 +1 @@
1
+ = f.text_field :short_answer, label: false, required: cpd_audit_level_question.required?
@@ -0,0 +1 @@
1
+ = f.file_field :upload_file, label: false, required: cpd_audit_level_question.required?
@@ -0,0 +1 @@
1
+ = cpd_audit_response.response.presence || '-'
@@ -0,0 +1 @@
1
+ = cpd_audit_response.response&.strftime('%F') || '-'
@@ -0,0 +1 @@
1
+ = cpd_audit_response.response.present? ? mail_to(cpd_audit_response.response) : '-'
@@ -0,0 +1 @@
1
+ = cpd_audit_response.response.presence || '-'
@@ -0,0 +1 @@
1
+ = cpd_audit_response.response.presence || '-'
@@ -0,0 +1,5 @@
1
+ - cpd_audit_response.response.each do |cpd_audit_level_question_option|
2
+ %div= cpd_audit_level_question_option.title
3
+
4
+ - if cpd_audit_response.response.blank?
5
+ = '-'
@@ -0,0 +1 @@
1
+ = cpd_audit_response.response&.title || '-'
@@ -0,0 +1,5 @@
1
+ - cpd_audit_response.response.each do |cpd_audit_level_question_option|
2
+ %div= cpd_audit_level_question_option.title
3
+
4
+ - if cpd_audit_response.response.blank?
5
+ = '-'
@@ -0,0 +1,5 @@
1
+ - cpd_audit_response.response.each do |cpd_audit_level_question_option|
2
+ %div= cpd_audit_level_question_option.title
3
+
4
+ - if cpd_audit_response.response.blank?
5
+ = '-'
@@ -0,0 +1,5 @@
1
+ - cpd_audit_response.response.each do |cpd_audit_level_question_option|
2
+ %div= cpd_audit_level_question_option.title
3
+
4
+ - if cpd_audit_response.response.blank?
5
+ = '-'
@@ -0,0 +1,5 @@
1
+ - cpd_audit_response.response.each do |cpd_audit_level_question_option|
2
+ %div= cpd_audit_level_question_option.title
3
+
4
+ - if cpd_audit_response.response.blank?
5
+ = '-'
@@ -0,0 +1 @@
1
+ = cpd_audit_response.response.presence || '-'
@@ -0,0 +1,4 @@
1
+ - if cpd_audit_response.response&.attached?
2
+ = link_to(cpd_audit_response.response.filename, url_for(cpd_audit_response.response), target: '_blank')
3
+ - else
4
+ = '-'
@@ -0,0 +1,6 @@
1
+ .cpd-audit-review-item
2
+ %p
3
+ %span.badge.badge-secondary= cpd_audit_review_item.recommendation
4
+
5
+ - if cpd_audit_review_item.comments.present?
6
+ %p= cpd_audit_review_item.comments
@@ -0,0 +1,11 @@
1
+ = f.hidden_field :item_id
2
+ = f.hidden_field :item_type
3
+
4
+ - recommendations = cpd_audit_review.cpd_audit_level.recommendations
5
+
6
+ - if recommendations.length > 3
7
+ = f.select :recommendation, recommendations
8
+ - else
9
+ = f.radios :recommendation, recommendations, inline: true
10
+
11
+ = f.text_area :comments
@@ -0,0 +1,15 @@
1
+ = card(cpd_audit_review.wizard_step_title(step)) do
2
+ %table.table
3
+ %tbody
4
+ %tr
5
+ %th Conflict of Interest
6
+ %td
7
+ - if cpd_audit_review.conflict_of_interest?
8
+ Yes, there is a conflict of interest
9
+ - else
10
+ No conflict of interest
11
+
12
+ - if cpd_audit_review.conflict_of_interest?
13
+ %tr
14
+ %th Reason
15
+ %td= cpd_audit_review.conflict_of_interest_reason
@@ -0,0 +1,23 @@
1
+ = card(cpd_audit_review.wizard_step_title(step)) do
2
+ %table.table.table-hover
3
+ %thead
4
+ %th Question and #{cpd_audit_review.cpd_audit.user}'s Response
5
+ %th #{cpd_audit_review.user}'s Review
6
+ %tbody
7
+ - cpd_audit_level_section.cpd_audit_level_questions.each_with_index do |cpd_audit_level_question, index|
8
+ - cpd_audit_response = cpd_audit_review.cpd_audit.cpd_audit_response(cpd_audit_level_question)
9
+ - next if cpd_audit_response.new_record?
10
+
11
+ - cpd_audit_review_item = cpd_audit_review.cpd_audit_review_item(cpd_audit_response)
12
+
13
+ %tr
14
+ %td
15
+ .mb-3= render('effective/cpd_audit_level_questions/cpd_audit_level_question', cpd_audit_level_question: cpd_audit_level_question)
16
+
17
+ %p
18
+ %strong Auditee Response:
19
+
20
+ .mb-3= render('effective/cpd_audit_responses/cpd_audit_response', cpd_audit_response: cpd_audit_response)
21
+
22
+ %td
23
+ = render('effective/cpd_audit_review_items/cpd_audit_review_item', cpd_audit_review_item: cpd_audit_review_item)
@@ -0,0 +1,17 @@
1
+ .effective-cpd-audit-review
2
+ = render('effective/cpd_audit_reviews/summary', cpd_audit_review: cpd_audit_review)
3
+
4
+ - steps = cpd_audit_review.required_steps.select { |step| cpd_audit_review.has_completed_step?(step) }
5
+ - blacklist = [:start, :information, :instructions, :waiting, :statements, :questionnaire, :submit, :complete]
6
+
7
+ - (steps - blacklist).each do |step|
8
+ - if cpd_audit_review.dynamic_wizard_questionnaire_steps.keys.include?(step)
9
+ - cpd_audit_level_section = cpd_audit_review.cpd_audit_level_section(step) || raise("no cpd audit section for #{step}")
10
+ = render("effective/cpd_audit_reviews/cpd_audit_level_section", cpd_audit_review: cpd_audit_review, step: step, cpd_audit_level_section: cpd_audit_level_section)
11
+
12
+ - elsif cpd_audit_review.dynamic_wizard_statement_steps.keys.include?(step)
13
+ - cpd_statement = cpd_audit_review.cpd_statement(step) || raise("no cpd statement for #{step}")
14
+ = render("effective/cpd_audit_reviews/cpd_statement", cpd_audit_review: cpd_audit_review, step: step, cpd_statement: cpd_statement)
15
+
16
+ - else
17
+ = render("effective/cpd_audit_reviews/#{step}", cpd_audit_review: cpd_audit_review, step: step)
@@ -0,0 +1,15 @@
1
+ = card(cpd_audit_review.wizard_step_title(step)) do
2
+ %table.table.table-hover
3
+ %thead
4
+ %th #{cpd_audit_review.cpd_audit.user}'s #{cpd_statement}
5
+ %th #{cpd_audit_review.user}'s Review
6
+
7
+ %tbody
8
+ - cpd_statement.cpd_statement_activities.each do |cpd_statement_activity|
9
+ - cpd_audit_review_item = cpd_audit_review.cpd_audit_review_item(cpd_statement_activity)
10
+
11
+ %tr
12
+ %td
13
+ = render('effective/cpd_statement_activities/cpd_statement_activity', cpd_statement_activity: cpd_statement_activity)
14
+ %td
15
+ = render('effective/cpd_audit_review_items/cpd_audit_review_item', cpd_audit_review_item: cpd_audit_review_item)
@@ -0,0 +1,24 @@
1
+ .row
2
+ .col-3
3
+ = render_wizard_sidebar(resource)
4
+
5
+ %table.table.mt-4
6
+ %tbody
7
+ - if resource.due_date.present? && !resource.completed?
8
+ %tr{title: "#{resource} is due on #{resource.due_date.strftime('%F')}"}
9
+ %td
10
+ %h4= (resource.due_date - Time.zone.now.to_date).to_i.abs
11
+
12
+ %td
13
+ = (Time.zone.now > resource.due_date) ? 'days overdue' : 'days left to review'
14
+
15
+ .col-9
16
+ %h1= @page_title
17
+
18
+ - if resource.cpd_audit_level.rich_text_all_steps_audit_review_content.present?
19
+ .mb-2= resource.cpd_audit_level.rich_text_all_steps_audit_review_content
20
+
21
+ - if resource.cpd_audit_level.send("rich_text_#{step}_audit_review_content").present?
22
+ .mb-2= resource.cpd_audit_level.send("rich_text_#{step}_audit_review_content")
23
+
24
+ = yield
@@ -0,0 +1,9 @@
1
+ = card(cpd_audit_review.wizard_step_title(step)) do
2
+ %table.table
3
+ %tbody
4
+ %tr
5
+ %th Recommendation
6
+ %td= cpd_audit_review.recommendation
7
+
8
+ %tr
9
+ %td{colspan: 2}= cpd_audit_review.comments.presence || 'No comments'
@@ -0,0 +1,47 @@
1
+ = card(cpd_audit_review) do
2
+ %table.table
3
+ %tbody
4
+ %tr
5
+ %th Audit Reviewer
6
+ %td
7
+ = cpd_audit_review.user
8
+ %br
9
+ %small= mail_to cpd_audit_review.user.email
10
+
11
+ - if request.path.start_with?('/admin') && respond_to?(:edit_admin_user_path)
12
+ %tr
13
+ %th User
14
+ %td= link_to(cpd_audit_review.user, edit_admin_user_path(cpd_audit_review.user))
15
+
16
+ %tr
17
+ %th Auditee
18
+ %td
19
+ = cpd_audit_review.cpd_audit.user
20
+ %br
21
+ %small= mail_to cpd_audit_review.cpd_audit.user.email
22
+
23
+ %tr
24
+ %th Date of notification
25
+ %td= cpd_audit_review.cpd_audit.notification_date.strftime('%F')
26
+
27
+ %tr
28
+ %th Due date
29
+ %td= cpd_audit_review.due_date.strftime('%F')
30
+
31
+ - if cpd_audit_review.completed?
32
+ %tr
33
+ %th Submitted on
34
+ %td= cpd_audit_review.submitted_at.strftime('%F')
35
+
36
+ %tr
37
+ %th Status
38
+ %td
39
+ %span.badge.badge-secondary submitted
40
+
41
+ %tr
42
+ %th Recommendation
43
+ %td= cpd_audit_review.recommendation.presence || '-'
44
+
45
+ %tr
46
+ %th Summary
47
+ %td= cpd_audit_summary_text(cpd_audit_review.cpd_audit)