effective_cpd 0.0.1 → 0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +89 -10
- data/app/controllers/admin/cpd_audit_level_questions_controller.rb +13 -0
- data/app/controllers/admin/cpd_audit_levels_controller.rb +13 -0
- data/app/controllers/admin/cpd_audit_reviews_controller.rb +13 -0
- data/app/controllers/admin/cpd_audits_controller.rb +41 -0
- data/app/controllers/effective/cpd_audit_reviews_controller.rb +60 -0
- data/app/controllers/effective/cpd_audits_controller.rb +55 -0
- data/app/controllers/effective/cpd_cycles_controller.rb +1 -0
- data/app/controllers/effective/cpd_statements_controller.rb +1 -3
- data/app/datatables/admin/effective_cpd_audit_level_questions_datatable.rb +30 -0
- data/app/datatables/admin/effective_cpd_audit_levels_datatable.rb +34 -0
- data/app/datatables/admin/effective_cpd_audit_reviews_datatable.rb +29 -0
- data/app/datatables/admin/effective_cpd_audits_datatable.rb +67 -0
- data/app/datatables/admin/effective_cpd_statements_datatable.rb +3 -3
- data/app/datatables/effective_cpd_available_audit_reviews_datatable.rb +37 -0
- data/app/datatables/effective_cpd_available_audits_datatable.rb +30 -0
- data/app/datatables/{effective_cpd_datatable.rb → effective_cpd_available_cycles_datatable.rb} +3 -4
- data/app/datatables/effective_cpd_completed_audit_reviews_datatable.rb +32 -0
- data/app/datatables/effective_cpd_completed_audits_datatable.rb +24 -0
- data/app/datatables/effective_cpd_completed_statements_datatable.rb +28 -0
- data/app/helpers/effective_cpd_audits_helper.rb +48 -0
- data/app/mailers/effective/cpd_mailer.rb +155 -3
- data/app/models/effective/cpd_activity.rb +16 -3
- data/app/models/effective/cpd_audit.rb +380 -0
- data/app/models/effective/cpd_audit_level.rb +87 -0
- data/app/models/effective/cpd_audit_level_question.rb +91 -0
- data/app/models/effective/cpd_audit_level_question_option.rb +34 -0
- data/app/models/effective/cpd_audit_level_section.rb +50 -0
- data/app/models/effective/cpd_audit_response.rb +86 -0
- data/app/models/effective/cpd_audit_response_option.rb +6 -0
- data/app/models/effective/cpd_audit_review.rb +222 -0
- data/app/models/effective/cpd_audit_review_item.rb +34 -0
- data/app/models/effective/cpd_category.rb +12 -3
- data/app/models/effective/cpd_cycle.rb +7 -0
- data/app/models/effective/cpd_rule.rb +3 -1
- data/app/models/effective/cpd_statement.rb +15 -8
- data/app/views/admin/cpd_activities/_form.html.haml +1 -1
- data/app/views/admin/cpd_audit_level_questions/_form.html.haml +100 -0
- data/app/views/admin/cpd_audit_levels/_form.html.haml +24 -0
- data/app/views/admin/cpd_audit_levels/_form_content_audit.html.haml +15 -0
- data/app/views/admin/cpd_audit_levels/_form_content_audit_review.html.haml +15 -0
- data/app/views/admin/cpd_audit_levels/_form_cpd_audit_level.html.haml +52 -0
- data/app/views/admin/cpd_audit_levels/_form_cpd_audit_level_section.html.haml +10 -0
- data/app/views/admin/cpd_audit_reviews/_cpd_audit_review.html.haml +1 -0
- data/app/views/admin/cpd_audit_reviews/_form.html.haml +13 -0
- data/app/views/admin/cpd_audits/_audit_reviewer_fields.html.haml +2 -0
- data/app/views/admin/cpd_audits/_auditee_fields.html.haml +2 -0
- data/app/views/admin/cpd_audits/_form.html.haml +46 -0
- data/app/views/admin/cpd_audits/_form_conflict.html.haml +24 -0
- data/app/views/admin/cpd_audits/_form_determination.html.haml +10 -0
- data/app/views/admin/cpd_audits/_form_exemption.html.haml +24 -0
- data/app/views/admin/cpd_audits/_form_extension.html.haml +24 -0
- data/app/views/admin/cpd_audits/_form_new.html.haml +28 -0
- data/app/views/admin/cpd_audits/_status.html.haml +121 -0
- data/app/views/admin/cpd_categories/_form.html.haml +1 -1
- data/app/views/admin/cpd_cycles/_form.html.haml +4 -4
- data/app/views/admin/cpd_cycles/_form_cpd_cycle.html.haml +3 -0
- data/app/views/admin/cpd_statements/_cpd_statement.html.haml +7 -0
- data/app/views/effective/cpd_audit_level_questions/_cpd_audit_level_question.html.haml +5 -0
- data/app/views/effective/cpd_audit_responses/_cpd_audit_response.html.haml +4 -0
- data/app/views/effective/cpd_audit_responses/_fields.html.haml +13 -0
- data/app/views/effective/cpd_audit_responses/fields/_choose_one.html.haml +1 -0
- data/app/views/effective/cpd_audit_responses/fields/_date.html.haml +2 -0
- data/app/views/effective/cpd_audit_responses/fields/_email.html.haml +2 -0
- data/app/views/effective/cpd_audit_responses/fields/_long_answer.html.haml +1 -0
- data/app/views/effective/cpd_audit_responses/fields/_number.html.haml +2 -0
- data/app/views/effective/cpd_audit_responses/fields/_select_all_that_apply.html.haml +1 -0
- data/app/views/effective/cpd_audit_responses/fields/_select_up_to_1.html.haml +1 -0
- data/app/views/effective/cpd_audit_responses/fields/_select_up_to_2.html.haml +1 -0
- data/app/views/effective/cpd_audit_responses/fields/_select_up_to_3.html.haml +1 -0
- data/app/views/effective/cpd_audit_responses/fields/_select_up_to_4.html.haml +1 -0
- data/app/views/effective/cpd_audit_responses/fields/_select_up_to_5.html.haml +1 -0
- data/app/views/effective/cpd_audit_responses/fields/_short_answer.html.haml +1 -0
- data/app/views/effective/cpd_audit_responses/fields/_upload_file.html.haml +1 -0
- data/app/views/effective/cpd_audit_responses/responses/_choose_one.html.haml +1 -0
- data/app/views/effective/cpd_audit_responses/responses/_date.html.haml +1 -0
- data/app/views/effective/cpd_audit_responses/responses/_email.html.haml +1 -0
- data/app/views/effective/cpd_audit_responses/responses/_long_answer.html.haml +1 -0
- data/app/views/effective/cpd_audit_responses/responses/_number.html.haml +1 -0
- data/app/views/effective/cpd_audit_responses/responses/_select_all_that_apply.html.haml +5 -0
- data/app/views/effective/cpd_audit_responses/responses/_select_up_to_1.html.haml +1 -0
- data/app/views/effective/cpd_audit_responses/responses/_select_up_to_2.html.haml +5 -0
- data/app/views/effective/cpd_audit_responses/responses/_select_up_to_3.html.haml +5 -0
- data/app/views/effective/cpd_audit_responses/responses/_select_up_to_4.html.haml +5 -0
- data/app/views/effective/cpd_audit_responses/responses/_select_up_to_5.html.haml +5 -0
- data/app/views/effective/cpd_audit_responses/responses/_short_answer.html.haml +1 -0
- data/app/views/effective/cpd_audit_responses/responses/_upload_file.html.haml +4 -0
- data/app/views/effective/cpd_audit_review_items/_cpd_audit_review_item.html.haml +6 -0
- data/app/views/effective/cpd_audit_review_items/_fields.html.haml +11 -0
- data/app/views/effective/cpd_audit_reviews/_conflict.html.haml +15 -0
- data/app/views/effective/cpd_audit_reviews/_cpd_audit_level_section.html.haml +23 -0
- data/app/views/effective/cpd_audit_reviews/_cpd_audit_review.html.haml +17 -0
- data/app/views/effective/cpd_audit_reviews/_cpd_statement.html.haml +15 -0
- data/app/views/effective/cpd_audit_reviews/_layout.html.haml +24 -0
- data/app/views/effective/cpd_audit_reviews/_recommendation.html.haml +9 -0
- data/app/views/effective/cpd_audit_reviews/_summary.html.haml +47 -0
- data/app/views/effective/cpd_audit_reviews/complete.html.haml +20 -0
- data/app/views/effective/cpd_audit_reviews/conflict.html.haml +21 -0
- data/app/views/effective/cpd_audit_reviews/cpd_audit_level_section.html.haml +43 -0
- data/app/views/effective/cpd_audit_reviews/cpd_statement.html.haml +35 -0
- data/app/views/effective/cpd_audit_reviews/information.html.haml +5 -0
- data/app/views/effective/cpd_audit_reviews/instructions.html.haml +10 -0
- data/app/views/effective/cpd_audit_reviews/questionnaire.html.haml +8 -0
- data/app/views/effective/cpd_audit_reviews/recommendation.html.haml +21 -0
- data/app/views/effective/cpd_audit_reviews/start.html.haml +10 -0
- data/app/views/effective/cpd_audit_reviews/statements.html.haml +29 -0
- data/app/views/effective/cpd_audit_reviews/submit.html.haml +14 -0
- data/app/views/effective/cpd_audit_reviews/waiting.html.haml +9 -0
- data/app/views/effective/cpd_audits/_conflict.html.haml +15 -0
- data/app/views/effective/cpd_audits/_cpd_audit.html.haml +12 -0
- data/app/views/effective/cpd_audits/_cpd_audit_level_section.html.haml +14 -0
- data/app/views/effective/cpd_audits/_exemption.html.haml +26 -0
- data/app/views/effective/cpd_audits/_extension.html.haml +30 -0
- data/app/views/effective/cpd_audits/_files.html.haml +12 -0
- data/app/views/effective/cpd_audits/_layout.html.haml +33 -0
- data/app/views/effective/cpd_audits/_summary.html.haml +54 -0
- data/app/views/effective/cpd_audits/_waiting.html.haml +6 -0
- data/app/views/effective/cpd_audits/complete.html.haml +24 -0
- data/app/views/effective/cpd_audits/conflict.html.haml +22 -0
- data/app/views/effective/cpd_audits/cpd_audit_level_section.html.haml +20 -0
- data/app/views/effective/cpd_audits/exemption.html.haml +19 -0
- data/app/views/effective/cpd_audits/extension.html.haml +21 -0
- data/app/views/effective/cpd_audits/files.html.haml +7 -0
- data/app/views/effective/cpd_audits/information.html.haml +5 -0
- data/app/views/effective/cpd_audits/instructions.html.haml +5 -0
- data/app/views/effective/cpd_audits/questionnaire.html.haml +5 -0
- data/app/views/effective/cpd_audits/start.html.haml +11 -0
- data/app/views/effective/cpd_audits/submit.html.haml +15 -0
- data/app/views/effective/cpd_audits/waiting.html.haml +24 -0
- data/app/views/effective/cpd_mailer/README.md +1 -0
- data/app/views/effective/cpd_mailer/cpd_audit_closed.liquid +15 -0
- data/app/views/effective/cpd_mailer/cpd_audit_conflict_resolved.liquid +15 -0
- data/app/views/effective/cpd_mailer/cpd_audit_conflicted.liquid +13 -0
- data/app/views/effective/cpd_mailer/cpd_audit_exemption_denied.liquid +13 -0
- data/app/views/effective/cpd_mailer/cpd_audit_exemption_granted.liquid +13 -0
- data/app/views/effective/cpd_mailer/cpd_audit_exemption_request.liquid +13 -0
- data/app/views/effective/cpd_mailer/cpd_audit_extension_denied.liquid +13 -0
- data/app/views/effective/cpd_mailer/cpd_audit_extension_granted.liquid +13 -0
- data/app/views/effective/cpd_mailer/cpd_audit_extension_request.liquid +13 -0
- data/app/views/effective/cpd_mailer/cpd_audit_opened.liquid +13 -0
- data/app/views/effective/cpd_mailer/cpd_audit_review_opened.liquid +15 -0
- data/app/views/effective/cpd_mailer/cpd_audit_review_ready.liquid +13 -0
- data/app/views/effective/cpd_mailer/cpd_audit_review_submitted.liquid +11 -0
- data/app/views/effective/cpd_mailer/cpd_audit_reviewed.liquid +13 -0
- data/app/views/effective/cpd_mailer/cpd_audit_submitted.liquid +13 -0
- data/app/views/effective/cpd_statement_activities/_cpd_statement_activity.html.haml +65 -0
- data/app/views/effective/cpd_statement_activities/_form.html.haml +9 -10
- data/app/views/effective/cpd_statements/_activities.html.haml +3 -64
- data/app/views/effective/cpd_statements/_activities_edit.html.haml +2 -0
- data/app/views/effective/cpd_statements/_activities_table.html.haml +64 -0
- data/app/views/effective/cpd_statements/_agreements.html.haml +19 -5
- data/app/views/effective/cpd_statements/_cpd_statement.html.haml +6 -3
- data/app/views/effective/cpd_statements/_summary.html.haml +26 -31
- data/app/views/effective/cpd_statements/activities.html.haml +1 -1
- data/app/views/effective/cpd_statements/agreements.html.haml +7 -1
- data/app/views/effective/cpd_statements/submit.html.haml +1 -1
- data/config/effective_cpd.rb +47 -10
- data/config/routes.rb +18 -1
- data/db/migrate/01_create_effective_cpd.rb.erb +157 -1
- data/db/seeds.rb +2 -1
- data/lib/effective_cpd.rb +42 -3
- data/lib/effective_cpd/version.rb +1 -1
- data/lib/generators/effective_cpd/install_generator.rb +16 -3
- metadata +168 -9
- data/app/datatables/effective_cpd_statements_datatable.rb +0 -23
- data/app/views/admin/cpd_statements/_form.html.haml +0 -6
@@ -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,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)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
= render('layout') do
|
2
|
+
- raise('expected a completed cpd_audit_review') unless resource.completed?
|
3
|
+
|
4
|
+
.text-center
|
5
|
+
.row
|
6
|
+
.col-2
|
7
|
+
.col-8
|
8
|
+
.alert.alert-success Audit Review Submitted!
|
9
|
+
|
10
|
+
%p
|
11
|
+
The following audit review was successfully submitted at
|
12
|
+
= succeed('.') do
|
13
|
+
= resource.submitted_at.strftime('%F')
|
14
|
+
|
15
|
+
%p Thank you for your review.
|
16
|
+
|
17
|
+
.mb-4= render(resource)
|
18
|
+
|
19
|
+
%br
|
20
|
+
.text-center= link_to 'Home', root_path, class: 'btn btn-primary'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
= render('layout') do
|
2
|
+
%p You have been selected to conduct a #{resource.cpd_audit.cpd_audit_level} audit with the following auditee:
|
3
|
+
|
4
|
+
%ul
|
5
|
+
%li #{resource.cpd_audit.user} <#{mail_to(resource.cpd_audit.user.email)}>
|
6
|
+
|
7
|
+
%p The deadline to declare a conflict of interest is: #{resource.deadline_to_conflict_of_interest.strftime('%F')}.
|
8
|
+
|
9
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
10
|
+
= f.hidden_field :current_step
|
11
|
+
|
12
|
+
= f.radios :conflict_of_interest, cpd_audit_conflict_of_interest_collection,
|
13
|
+
inline: true, required: true
|
14
|
+
|
15
|
+
= f.show_if :conflict_of_interest, true do
|
16
|
+
= f.text_area :conflict_of_interest_reason, required: true
|
17
|
+
|
18
|
+
%hr
|
19
|
+
= f.text_area :comments, label: 'Reviewer comments'
|
20
|
+
|
21
|
+
= f.submit 'Save and Continue', center: true
|
@@ -0,0 +1,43 @@
|
|
1
|
+
= render('layout') do
|
2
|
+
- cpd_audit_level_section = resource.cpd_audit.cpd_audit_level_section(step)
|
3
|
+
- raise("no cpd audit section for #{step}") if cpd_audit_level_section.blank?
|
4
|
+
|
5
|
+
%h2 Review Section
|
6
|
+
%p Please review auditee responses to the #{cpd_audit_level_section} section:
|
7
|
+
|
8
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
9
|
+
= f.hidden_field :current_step
|
10
|
+
|
11
|
+
- if cpd_audit_level_section.top_content.present?
|
12
|
+
.mb-2= cpd_audit_level_section.top_content
|
13
|
+
|
14
|
+
%table.table.table-hover
|
15
|
+
%thead
|
16
|
+
%th Question and #{resource.cpd_audit.user}'s Response
|
17
|
+
%th #{resource.user}'s Review
|
18
|
+
%tbody
|
19
|
+
- cpd_audit_level_section.cpd_audit_level_questions.each_with_index do |cpd_audit_level_question, index|
|
20
|
+
- cpd_audit_response = resource.cpd_audit.cpd_audit_response(cpd_audit_level_question)
|
21
|
+
- next if cpd_audit_response.new_record?
|
22
|
+
|
23
|
+
- cpd_audit_review_item = resource.cpd_audit_review_item(cpd_audit_response)
|
24
|
+
|
25
|
+
%tr
|
26
|
+
%td
|
27
|
+
.mb-3= render(cpd_audit_level_question)
|
28
|
+
|
29
|
+
%p
|
30
|
+
%strong Auditee Response:
|
31
|
+
|
32
|
+
.mb-3= render(cpd_audit_response)
|
33
|
+
%td
|
34
|
+
= f.fields_for :cpd_audit_review_items, cpd_audit_review_item do |fi|
|
35
|
+
= render('/effective/cpd_audit_review_items/fields', f: fi, cpd_audit_review: resource)
|
36
|
+
|
37
|
+
- if cpd_audit_level_section.bottom_content.present?
|
38
|
+
.mb-2= cpd_audit_level_section.bottom_content
|
39
|
+
|
40
|
+
%hr
|
41
|
+
= f.text_area :comments, label: 'Reviewer comments'
|
42
|
+
|
43
|
+
= f.submit 'Save and Continue', center: true
|
@@ -0,0 +1,35 @@
|
|
1
|
+
= render('layout') do
|
2
|
+
- cpd_statement = resource.cpd_statement(step)
|
3
|
+
- raise("no cpd statement for #{step}") if cpd_statement.blank?
|
4
|
+
|
5
|
+
%h2 Review Statement
|
6
|
+
.mb-3
|
7
|
+
= collapse("#{cpd_statement.to_s}...", card_class: 'mb-3') do
|
8
|
+
= render('effective/cpd_statements/cpd_statement', cpd_statement: cpd_statement)
|
9
|
+
|
10
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
11
|
+
= f.hidden_field :current_step
|
12
|
+
|
13
|
+
%h2 Review Activities
|
14
|
+
%p Please review the following activities:
|
15
|
+
|
16
|
+
%table.table.table-hover
|
17
|
+
%thead
|
18
|
+
%th #{resource.cpd_audit.user}'s #{cpd_statement}
|
19
|
+
%th #{resource.user}'s Review
|
20
|
+
%tbody
|
21
|
+
- cpd_statement.cpd_statement_activities.each do |cpd_statement_activity|
|
22
|
+
- cpd_audit_review_item = resource.cpd_audit_review_item(cpd_statement_activity)
|
23
|
+
|
24
|
+
%tr
|
25
|
+
%td
|
26
|
+
.mb-3
|
27
|
+
= render('/effective/cpd_statement_activities/cpd_statement_activity', cpd_statement_activity: cpd_statement_activity)
|
28
|
+
%td
|
29
|
+
= f.fields_for :cpd_audit_review_items, cpd_audit_review_item do |fi|
|
30
|
+
= render('/effective/cpd_audit_review_items/fields', f: fi, cpd_audit_review: resource)
|
31
|
+
|
32
|
+
%hr
|
33
|
+
= f.text_area :comments, label: 'Reviewer comments'
|
34
|
+
|
35
|
+
= f.submit 'Save and Continue', center: true
|
@@ -0,0 +1,10 @@
|
|
1
|
+
= render('layout') do
|
2
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
3
|
+
= f.hidden_field :current_step
|
4
|
+
|
5
|
+
%hr
|
6
|
+
|
7
|
+
%p The following rolling comments will be displayed for your use on each step.
|
8
|
+
= f.text_area :comments, label: 'Reviewer comments'
|
9
|
+
|
10
|
+
= f.submit 'Save and Continue', center: true
|
@@ -0,0 +1,21 @@
|
|
1
|
+
= render('layout') do
|
2
|
+
.mb-3
|
3
|
+
= collapse('Show / hide audit review...', card_class: '') do
|
4
|
+
= render(resource)
|
5
|
+
|
6
|
+
%p Please provide your final recommendation on #{resource.cpd_audit.user}:
|
7
|
+
|
8
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
9
|
+
= f.hidden_field :current_step
|
10
|
+
|
11
|
+
- recommendations = resource.cpd_audit_level.recommendations
|
12
|
+
|
13
|
+
- if recommendations.length > 3
|
14
|
+
= f.select :recommendation, recommendations
|
15
|
+
- else
|
16
|
+
= f.radios :recommendation, recommendations, inline: true
|
17
|
+
|
18
|
+
%hr
|
19
|
+
= f.text_area :comments, label: 'Reviewer comments'
|
20
|
+
|
21
|
+
= f.submit 'Save and Continue', center: true
|
@@ -0,0 +1,10 @@
|
|
1
|
+
= render('layout') do
|
2
|
+
%p You have been selected to conduct a #{resource.cpd_audit.cpd_audit_level} audit with the following auditee:
|
3
|
+
|
4
|
+
%ul
|
5
|
+
%li #{resource.cpd_audit.user} <#{mail_to(resource.cpd_audit.user.email)}>
|
6
|
+
|
7
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
8
|
+
= f.hidden_field :current_step
|
9
|
+
|
10
|
+
= f.submit 'Start', center: true
|
@@ -0,0 +1,29 @@
|
|
1
|
+
= render('layout') do
|
2
|
+
- auditee = resource.cpd_audit.user
|
3
|
+
|
4
|
+
%h2 Review Statements
|
5
|
+
%p #{auditee} has submitted the following statements:
|
6
|
+
|
7
|
+
- datatable = EffectiveCpdCompletedStatementsDatatable.new(user_id: auditee.id, actions: false)
|
8
|
+
|
9
|
+
- if datatable.blank?(self)
|
10
|
+
%p
|
11
|
+
%strong There are no completed CPD statements from #{auditee}.
|
12
|
+
- else
|
13
|
+
= render_datatable(datatable, simple: true)
|
14
|
+
|
15
|
+
%h2 All Statements
|
16
|
+
%p Click to expand any statements
|
17
|
+
|
18
|
+
- datatable.collection.sorted.each do |cpd_statement|
|
19
|
+
.mb-3
|
20
|
+
= collapse("#{cpd_statement.to_s}...", card_class: 'mb-3') do
|
21
|
+
= render('effective/cpd_statements/cpd_statement', cpd_statement: cpd_statement)
|
22
|
+
|
23
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
24
|
+
= f.hidden_field :current_step
|
25
|
+
|
26
|
+
%hr
|
27
|
+
= f.text_area :comments, label: 'Reviewer comments'
|
28
|
+
|
29
|
+
= f.submit 'Save and Continue', center: true
|
@@ -0,0 +1,14 @@
|
|
1
|
+
= render('layout') do
|
2
|
+
%p Please review your recommendations before submitting.
|
3
|
+
|
4
|
+
%p
|
5
|
+
Once submitted you
|
6
|
+
%strong will not
|
7
|
+
be able to change your recommendation.
|
8
|
+
|
9
|
+
.mb-4= render(resource)
|
10
|
+
|
11
|
+
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
12
|
+
= f.hidden_field :current_step
|
13
|
+
|
14
|
+
= f.submit 'Submit Audit Review', center: true
|
@@ -0,0 +1,15 @@
|
|
1
|
+
= card(cpd_audit.wizard_step_title(step)) do
|
2
|
+
%table.table
|
3
|
+
%tbody
|
4
|
+
%tr
|
5
|
+
%th Conflict of Interest
|
6
|
+
%td
|
7
|
+
- if cpd_audit.conflict_of_interest?
|
8
|
+
Yes, there is a conflict of interest
|
9
|
+
- else
|
10
|
+
No conflict of interest
|
11
|
+
|
12
|
+
- if cpd_audit.conflict_of_interest?
|
13
|
+
%tr
|
14
|
+
%th Reason
|
15
|
+
%td= cpd_audit.conflict_of_interest_reason
|
@@ -0,0 +1,12 @@
|
|
1
|
+
.effective-cpd-audit
|
2
|
+
= render('effective/cpd_audits/summary', cpd_audit: cpd_audit)
|
3
|
+
|
4
|
+
- steps = cpd_audit.required_steps.select { |step| cpd_audit.has_completed_step?(step) }
|
5
|
+
- blacklist = [:start, :information, :instructions, :waiting, :questionnaire, :submit, :complete]
|
6
|
+
|
7
|
+
- (steps - blacklist).each do |step|
|
8
|
+
- if cpd_audit.dynamic_wizard_steps.keys.include?(step)
|
9
|
+
- cpd_audit_level_section = cpd_audit.cpd_audit_level_section(step) || raise("no cpd audit section for #{step}")
|
10
|
+
= render("effective/cpd_audits/cpd_audit_level_section", cpd_audit: cpd_audit, step: step, cpd_audit_level_section: cpd_audit_level_section)
|
11
|
+
- else
|
12
|
+
= render("effective/cpd_audits/#{step}", cpd_audit: cpd_audit, step: step)
|
@@ -0,0 +1,14 @@
|
|
1
|
+
= card(cpd_audit.wizard_step_title(step)) do
|
2
|
+
%table.table.table-hover
|
3
|
+
%thead
|
4
|
+
%tr
|
5
|
+
%th Question
|
6
|
+
%th Response
|
7
|
+
|
8
|
+
%tbody
|
9
|
+
- cpd_audit_level_section.cpd_audit_level_questions.each do |cpd_audit_level_question|
|
10
|
+
- cpd_audit_response = cpd_audit.cpd_audit_response(cpd_audit_level_question)
|
11
|
+
|
12
|
+
%tr
|
13
|
+
%td= cpd_audit_level_question
|
14
|
+
%td= render('effective/cpd_audit_responses/cpd_audit_response', cpd_audit_response: cpd_audit_response)
|