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.
- checksums.yaml +4 -4
- data/README.md +122 -10
- data/app/assets/javascripts/effective_cpd/activities.js +6 -0
- 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/admin/cpd_special_rules_controller.rb +13 -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_special_rules_datatable.rb +23 -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/helpers/effective_cpd_helper.rb +10 -0
- data/app/mailers/effective/cpd_mailer.rb +155 -3
- data/app/models/concerns/effective_cpd_user.rb +29 -0
- 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 +18 -2
- data/app/models/effective/cpd_rule.rb +23 -6
- data/app/models/effective/cpd_scorer.rb +23 -1
- data/app/models/effective/cpd_special_rule.rb +54 -0
- data/app/models/effective/cpd_special_rule_mate.rb +6 -0
- data/app/models/effective/cpd_statement.rb +25 -11
- 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 +6 -3
- data/app/views/admin/cpd_cycles/_form_content.html.haml +8 -0
- data/app/views/admin/cpd_cycles/_form_cpd_cycle.html.haml +3 -0
- data/app/views/admin/cpd_cycles/_form_cpd_rules.html.haml +12 -7
- data/app/views/admin/cpd_cycles/_form_cpd_special_rules.html.haml +4 -0
- data/app/views/admin/cpd_special_rules/_form.html.haml +18 -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 +10 -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_new.html.haml +3 -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/_layout.html.haml +3 -4
- 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 +2 -3
- data/config/effective_cpd.rb +49 -10
- data/config/routes.rb +19 -1
- data/db/migrate/01_create_effective_cpd.rb.erb +175 -1
- data/db/seeds.rb +16 -13
- data/lib/effective_cpd.rb +42 -3
- data/lib/effective_cpd/engine.rb +7 -0
- data/lib/effective_cpd/version.rb +1 -1
- data/lib/generators/effective_cpd/install_generator.rb +18 -3
- metadata +175 -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,65 @@
|
|
1
|
+
.cpd-statement-activity
|
2
|
+
- cpd_activity = cpd_statement_activity.cpd_activity
|
3
|
+
- rule = cpd_statement_activity.cpd_statement.cpd_cycle.rule_for(cpd_activity)
|
4
|
+
|
5
|
+
%p
|
6
|
+
= cpd_statement_activity
|
7
|
+
%br
|
8
|
+
%small.text-muted= rule.credit_description
|
9
|
+
|
10
|
+
- if cpd_activity.body.present?
|
11
|
+
.mb-3= cpd_activity.body
|
12
|
+
|
13
|
+
- if cpd_statement_activity.is_carry_over?
|
14
|
+
%p
|
15
|
+
%strong Carried Forward From
|
16
|
+
%br
|
17
|
+
= cpd_statement_activity.original.cpd_statement.cpd_cycle
|
18
|
+
|
19
|
+
.row.mb-3
|
20
|
+
.col-sm-8
|
21
|
+
.row
|
22
|
+
- if cpd_activity.amount_label.present?
|
23
|
+
.col
|
24
|
+
%strong #{cpd_activity.amount_label.titleize.pluralize}
|
25
|
+
%br
|
26
|
+
= cpd_statement_activity.amount
|
27
|
+
|
28
|
+
- if cpd_activity.amount2_label.present?
|
29
|
+
.col.text-center
|
30
|
+
%strong #{cpd_activity.amount2_label.to_s.titleize.pluralize} Articles written
|
31
|
+
= cpd_statement_activity.amount2
|
32
|
+
|
33
|
+
- if cpd_activity.amount_static?
|
34
|
+
.col
|
35
|
+
%strong One (1) #{cpd_activity}:
|
36
|
+
%br
|
37
|
+
1
|
38
|
+
|
39
|
+
.col-sm-4
|
40
|
+
.row
|
41
|
+
.col.text-center
|
42
|
+
%strong= cpd_credits_label.titleize
|
43
|
+
%br
|
44
|
+
- if cpd_statement_activity.reduced_messages.present?
|
45
|
+
%span{title: cpd_statement_activity.reduced_messages.values.join("\n\n")}= "#{cpd_statement_activity.score} *"
|
46
|
+
- else
|
47
|
+
= cpd_statement_activity.score.to_i
|
48
|
+
|
49
|
+
.col.text-center
|
50
|
+
%strong Carry
|
51
|
+
%br
|
52
|
+
= cpd_statement_activity.carry_forward.to_i
|
53
|
+
|
54
|
+
- if cpd_statement_activity.files.present?
|
55
|
+
%p
|
56
|
+
%strong Supporting Documents
|
57
|
+
|
58
|
+
%ul
|
59
|
+
- cpd_statement_activity.files.each do |file|
|
60
|
+
= link_to(file.filename, url_for(file), target: '_blank')
|
61
|
+
|
62
|
+
%p
|
63
|
+
%strong Description
|
64
|
+
%br
|
65
|
+
= cpd_statement_activity.description
|
@@ -1,17 +1,18 @@
|
|
1
1
|
- url = (cpd_statement_activity.persisted? ? effective_cpd.cpd_statement_cpd_statement_activity_path(cpd_statement_activity.cpd_statement, cpd_statement_activity) : effective_cpd.cpd_statement_cpd_statement_activities_path(cpd_statement_activity.cpd_statement))
|
2
|
-
-
|
2
|
+
- locked = cpd_statement_activity.locked?
|
3
3
|
|
4
|
-
= effective_form_with(model: cpd_statement_activity, url: (
|
4
|
+
= effective_form_with(model: cpd_statement_activity, url: (locked ? '#' : url), remote: true, class: 'cpd-statement-activity-form', readonly: locked, disabled: locked) do |f|
|
5
5
|
- statement = cpd_statement_activity.cpd_statement
|
6
6
|
- activity = cpd_statement_activity.cpd_activity
|
7
7
|
- rule = statement.cpd_cycle.rule_for(activity)
|
8
8
|
|
9
|
+
.float-right= link_to icon('x', class: 'small-1'), '#', 'data-cpd-collapse': true
|
9
10
|
%h3= activity
|
10
11
|
|
11
12
|
- if activity.body.present?
|
12
13
|
= activity.body
|
13
14
|
|
14
|
-
- if cpd_statement_activity.is_carry_over?
|
15
|
+
- if cpd_statement_activity.is_carry_over?
|
15
16
|
.alert.alert-warning
|
16
17
|
This activity is read-only because it was carried forward from
|
17
18
|
= cpd_statement_activity.original.cpd_statement.cpd_cycle
|
@@ -40,22 +41,21 @@
|
|
40
41
|
.row
|
41
42
|
.col
|
42
43
|
- if activity.amount_label.present?
|
43
|
-
= f.number_field :amount, label: activity.amount_label.titleize, required: true
|
44
|
+
= f.number_field :amount, label: activity.amount_label.titleize.pluralize, required: true
|
44
45
|
|
45
46
|
- if activity.amount2_label.present?
|
46
|
-
= f.number_field :amount2, label: activity.amount2_label.titleize, required: true
|
47
|
+
= f.number_field :amount2, label: activity.amount2_label.titleize.pluralize, required: true
|
47
48
|
|
48
|
-
- if activity.
|
49
|
+
- if activity.amount_static?
|
49
50
|
= f.hidden_field :amount, value: 1
|
50
51
|
%p One (1) #{activity}
|
51
52
|
|
52
|
-
|
53
|
-
= f.file_field :files, label: 'Supporting Documents', required: activity.requires_upload_file?, disabled: readonly
|
53
|
+
= f.file_field :files, label: 'Supporting Documents', required: activity.requires_upload_file?
|
54
54
|
|
55
55
|
.col
|
56
|
-
= f.text_area :description, placeholder: 'Please provide any additional information about this activity'
|
56
|
+
= f.text_area :description, placeholder: 'Please provide any additional information about this activity'
|
57
57
|
|
58
|
-
- unless
|
58
|
+
- unless locked
|
59
59
|
= f.hidden_field :cpd_category_id
|
60
60
|
= f.hidden_field :cpd_activity_id
|
61
61
|
|
@@ -1,64 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
.col-2.score
|
5
|
-
%strong= cpd_credits_label.titleize
|
6
|
-
.col-2.carry-forward
|
7
|
-
%strong Carry Forward
|
8
|
-
|
9
|
-
- effective_cpd_categories.each do |category|
|
10
|
-
- statement_activities = cpd_statement.cpd_statement_activities.select { |a| a.cpd_category_id == category.id }
|
11
|
-
- next if statement_activities.blank?
|
12
|
-
|
13
|
-
- rule = cpd_statement.cpd_cycle.rule_for(category)
|
14
|
-
|
15
|
-
.statement-activity-category
|
16
|
-
%h3
|
17
|
-
#{category}
|
18
|
-
%small
|
19
|
-
= cpd_statement.score_per_category[category.id].to_i
|
20
|
-
- if rule.max_credits_per_cycle.present?
|
21
|
-
= '/'
|
22
|
-
= rule.max_credits_per_cycle
|
23
|
-
|
24
|
-
.progress.my-2
|
25
|
-
- valuenow = cpd_statement.score_per_category[category.id]
|
26
|
-
- valuemax = (rule.max_credits_per_cycle || 1)
|
27
|
-
- width = ((valuenow * 100.0) / valuemax)
|
28
|
-
|
29
|
-
.progress-bar{role: 'progressbar', style: "width: #{width}%", 'aria-valuenow': valuenow, 'aria-valuemin': 0, 'aria-valuemax': valuemax}
|
30
|
-
|
31
|
-
- statement_activities.each do |statement_activity|
|
32
|
-
.statement-activity.mb-3
|
33
|
-
.statement-activity-content.row
|
34
|
-
.col-8
|
35
|
-
= link_to('#', 'data-cpd-edit-activity': true) do
|
36
|
-
= icon('plus-circle', class: 'small-1')
|
37
|
-
= statement_activity.cpd_activity
|
38
|
-
- if statement_activity.is_carry_over?
|
39
|
-
%br
|
40
|
-
%small carried forward from #{statement_activity.original_cycle}
|
41
|
-
|
42
|
-
.col-2.score
|
43
|
-
- if statement_activity.reduced_messages.present?
|
44
|
-
%span{title: statement_activity.reduced_messages.values.join("\n\n")}= "#{statement_activity.score} *"
|
45
|
-
- else
|
46
|
-
= statement_activity.score.to_i
|
47
|
-
|
48
|
-
.col-2.carry-forward
|
49
|
-
= statement_activity.carry_forward.to_i
|
50
|
-
|
51
|
-
.statement-activity-form.row{style: 'display: none;'}
|
52
|
-
.col
|
53
|
-
.border.px-3
|
54
|
-
= render('effective/cpd_statement_activities/form', cpd_statement_activity: statement_activity, readonly: local_assigns[:readonly])
|
55
|
-
|
56
|
-
%hr
|
57
|
-
|
58
|
-
.row
|
59
|
-
.col-8
|
60
|
-
%h4 Total #{cpd_credits_label} in statement
|
61
|
-
.col-2.score
|
62
|
-
%h4= cpd_statement.score.to_i
|
63
|
-
.col-2.carry-forward
|
64
|
-
%h4= cpd_statement.carry_forward.to_i
|
1
|
+
= card('Activities') do
|
2
|
+
= render('effective/cpd_statements/activities_table', cpd_statement: cpd_statement) do |cpd_statement_activity|
|
3
|
+
= render('effective/cpd_statement_activities/cpd_statement_activity', cpd_statement_activity: cpd_statement_activity)
|
@@ -7,6 +7,8 @@
|
|
7
7
|
- next if rule.unavailable?
|
8
8
|
|
9
9
|
= tab(category) do
|
10
|
+
.float-right= link_to icon('x', class: 'small-1'), '#', 'data-cpd-collapse': true
|
11
|
+
|
10
12
|
%h3
|
11
13
|
#{category}
|
12
14
|
%small
|
@@ -22,6 +24,7 @@
|
|
22
24
|
.mb-3
|
23
25
|
%strong #{cpd_credits_label.titleize} Calculation
|
24
26
|
%br
|
27
|
+
= rule.category_credit_description
|
25
28
|
= rule.credit_description
|
26
29
|
|
27
30
|
%div
|
@@ -0,0 +1,64 @@
|
|
1
|
+
.cpd-statement-activities
|
2
|
+
.row{style: 'margin-top: -2rem'}
|
3
|
+
.col-8
|
4
|
+
.col-2.score
|
5
|
+
%strong= cpd_credits_label.titleize
|
6
|
+
.col-2.carry-forward
|
7
|
+
%strong Carry Forward
|
8
|
+
|
9
|
+
- effective_cpd_categories.each do |category|
|
10
|
+
- statement_activities = cpd_statement.cpd_statement_activities.select { |a| a.cpd_category_id == category.id }
|
11
|
+
- next if statement_activities.blank?
|
12
|
+
|
13
|
+
- rule = cpd_statement.cpd_cycle.rule_for(category)
|
14
|
+
|
15
|
+
.statement-activity-category
|
16
|
+
%h3
|
17
|
+
#{category}
|
18
|
+
%small
|
19
|
+
= cpd_statement.score_per_category[category.id].to_i
|
20
|
+
- if rule.max_credits_per_cycle.present?
|
21
|
+
= '/'
|
22
|
+
= rule.max_credits_per_cycle
|
23
|
+
|
24
|
+
.progress.my-2
|
25
|
+
- valuenow = cpd_statement.score_per_category[category.id]
|
26
|
+
- valuemax = (rule.max_credits_per_cycle || 1)
|
27
|
+
- width = ((valuenow * 100.0) / valuemax)
|
28
|
+
|
29
|
+
.progress-bar{role: 'progressbar', style: "width: #{width}%", 'aria-valuenow': valuenow, 'aria-valuemin': 0, 'aria-valuemax': valuemax}
|
30
|
+
|
31
|
+
- statement_activities.each do |statement_activity|
|
32
|
+
.statement-activity.mb-3
|
33
|
+
.statement-activity-content.row
|
34
|
+
.col-8
|
35
|
+
= link_to('#', 'data-cpd-edit-activity': true) do
|
36
|
+
= icon('plus-circle', class: 'small-1')
|
37
|
+
= statement_activity.cpd_activity
|
38
|
+
- if statement_activity.is_carry_over?
|
39
|
+
%br
|
40
|
+
%small carried forward from #{statement_activity.original_cycle}
|
41
|
+
|
42
|
+
.col-2.score
|
43
|
+
- if statement_activity.reduced_messages.present?
|
44
|
+
%span{title: statement_activity.reduced_messages.values.join("\n\n")}= "#{statement_activity.score} *"
|
45
|
+
- else
|
46
|
+
= statement_activity.score.to_i
|
47
|
+
|
48
|
+
.col-2.carry-forward
|
49
|
+
= statement_activity.carry_forward.to_i
|
50
|
+
|
51
|
+
.statement-activity-form.row{style: 'display: none;'}
|
52
|
+
.col
|
53
|
+
.border.px-3
|
54
|
+
= yield(statement_activity)
|
55
|
+
|
56
|
+
%hr
|
57
|
+
|
58
|
+
.row
|
59
|
+
.col-8
|
60
|
+
%h4 Total #{cpd_credits_label} in statement
|
61
|
+
.col-2.score
|
62
|
+
%h4= cpd_statement.score.to_i
|
63
|
+
.col-2.carry-forward
|
64
|
+
%h4= cpd_statement.carry_forward.to_i
|
@@ -1,6 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
= card('Agreements') do
|
2
|
+
%table.table
|
3
|
+
%tbody
|
4
|
+
%tr
|
5
|
+
%th Read all contents and agreements
|
6
|
+
%td= cpd_statement.confirm_read ? 'Yes' : 'No'
|
4
7
|
|
5
|
-
%
|
6
|
-
|
8
|
+
%tr
|
9
|
+
%th Declared all information factual
|
10
|
+
%td= cpd_statement.confirm_factual ? 'Yes' : 'No'
|
11
|
+
|
12
|
+
%tr
|
13
|
+
%th Attachments
|
14
|
+
%td
|
15
|
+
- if cpd_statement.files.blank?
|
16
|
+
None
|
17
|
+
- else
|
18
|
+
%ul
|
19
|
+
- cpd_statement.files.each do |file|
|
20
|
+
= link_to(file.filename, url_for(file), target: '_blank')
|
@@ -1,5 +1,8 @@
|
|
1
|
-
|
1
|
+
.effective-cpd-statement
|
2
2
|
= render('effective/cpd_statements/summary', cpd_statement: cpd_statement)
|
3
3
|
|
4
|
-
=
|
5
|
-
=
|
4
|
+
- steps = cpd_statement.required_steps.select { |step| cpd_statement.has_completed_step?(step) }
|
5
|
+
- blacklist = [:start, :submit, :complete]
|
6
|
+
|
7
|
+
- (steps - blacklist).each do |step|
|
8
|
+
= render("effective/cpd_statements/#{step}", cpd_statement: cpd_statement, step: step)
|
@@ -22,10 +22,7 @@
|
|
22
22
|
%h4= resource.score.to_i
|
23
23
|
|
24
24
|
%td
|
25
|
-
|
26
|
-
#{cpd_credits_label} out of #{cpd_cycle.required_score} required
|
27
|
-
- else
|
28
|
-
#{cpd_credits_label} in current #{cpd_cycle_label}
|
25
|
+
#{cpd_credits_label} out of #{resource.required_score} required
|
29
26
|
|
30
27
|
%tr
|
31
28
|
%td
|
@@ -33,5 +30,7 @@
|
|
33
30
|
|
34
31
|
%td #{cpd_credits_label} in last 3 #{cpd_cycles_label} (including this #{cpd_cycle_label})
|
35
32
|
|
33
|
+
= cpd_cycle.sidebar_content
|
34
|
+
|
36
35
|
.col-9
|
37
36
|
= yield
|
@@ -1,36 +1,31 @@
|
|
1
|
-
|
2
|
-
%
|
3
|
-
%
|
4
|
-
%
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
= card(cpd_statement) do
|
2
|
+
%table.table
|
3
|
+
%tbody
|
4
|
+
%tr
|
5
|
+
%th Name
|
6
|
+
%td
|
7
|
+
= cpd_statement.user
|
8
|
+
%br
|
9
|
+
%small= mail_to cpd_statement.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_statement.user, edit_admin_user_path(cpd_statement.user))
|
9
15
|
|
10
|
-
- if
|
16
|
+
- if cpd_statement.completed?
|
11
17
|
%tr
|
12
|
-
%th
|
13
|
-
%td=
|
18
|
+
%th Completed
|
19
|
+
%td= cpd_statement.submitted_at.strftime('%F %H:%M')
|
14
20
|
|
15
|
-
- if cpd_statement.completed?
|
16
21
|
%tr
|
17
|
-
%th
|
18
|
-
%td= cpd_statement.
|
22
|
+
%th= cpd_cycle_label.titleize
|
23
|
+
%td= cpd_statement.cpd_cycle
|
19
24
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
%
|
25
|
-
|
26
|
-
|
27
|
-
%th Carry Forward
|
28
|
-
%td= cpd_statement.carry_forward
|
29
|
-
%tr
|
30
|
-
%th Attachments
|
31
|
-
%td
|
32
|
-
- if cpd_statement.files.blank?
|
33
|
-
None
|
34
|
-
- else
|
35
|
-
- cpd_statement.files.each do |file|
|
36
|
-
%div= link_to(file.filename, url_for(file), target: '_blank')
|
25
|
+
%tr
|
26
|
+
%th Total #{cpd_credits_label.titleize}
|
27
|
+
%td= cpd_statement.score
|
28
|
+
|
29
|
+
%tr
|
30
|
+
%th Carry Forward
|
31
|
+
%td= cpd_statement.carry_forward
|
@@ -13,7 +13,7 @@
|
|
13
13
|
.mb-2= resource.cpd_cycle.activities_content
|
14
14
|
|
15
15
|
- if resource.cpd_statement_activities.present?
|
16
|
-
= render('
|
16
|
+
= render('activities_edit', cpd_statement: resource)
|
17
17
|
|
18
18
|
.mt-3= link_to 'Add Activity', '#', 'data-cpd-new-activity': true, class: 'btn btn-primary'
|
19
19
|
|
@@ -8,7 +8,13 @@
|
|
8
8
|
.mb-2= resource.cpd_cycle.agreements_content
|
9
9
|
|
10
10
|
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
11
|
-
= render('agreements', f: f, form: f)
|
12
11
|
= f.hidden_field :current_step
|
13
12
|
|
13
|
+
%h2 Agreements
|
14
|
+
= f.check_box :confirm_read, label: "Yes, I have read the above content and agreements"
|
15
|
+
= f.check_box :confirm_factual, label: "Yes, I declare all provided information to be factual and complete"
|
16
|
+
|
17
|
+
%h2 Resume
|
18
|
+
= f.file_field :files, label: 'Attach resume', hint: 'Please attach your resume or other CPD related documents'
|
19
|
+
|
14
20
|
= f.submit 'Save and Continue', center: true
|
@@ -14,7 +14,6 @@
|
|
14
14
|
= effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
|
15
15
|
= f.hidden_field :current_step
|
16
16
|
|
17
|
-
= f.check_box :confirm_readonly,
|
18
|
-
label: 'Yes, I understand that I will not be able to modify this statement after submission'
|
17
|
+
= f.check_box :confirm_readonly, label: cpd_statement_submit_label(f.object)
|
19
18
|
|
20
|
-
= f.submit '
|
19
|
+
= f.submit 'Submit Statement', center: true
|
data/config/effective_cpd.rb
CHANGED
@@ -1,10 +1,26 @@
|
|
1
1
|
EffectiveCpd.setup do |config|
|
2
|
-
config.cpd_cycles_table_name = :cpd_cycles
|
3
2
|
config.cpd_categories_table_name = :cpd_categories
|
4
3
|
config.cpd_activities_table_name = :cpd_activities
|
4
|
+
|
5
|
+
config.cpd_cycles_table_name = :cpd_cycles
|
5
6
|
config.cpd_rules_table_name = :cpd_rules
|
6
|
-
config.
|
7
|
+
config.cpd_special_rules_table_name = :cpd_special_rules
|
8
|
+
config.cpd_special_rule_mates_table_name = :cpd_special_rule_mates
|
9
|
+
|
7
10
|
config.cpd_statements_table_name = :cpd_statements
|
11
|
+
config.cpd_statement_activities_table_name = :cpd_statement_activities
|
12
|
+
|
13
|
+
config.cpd_audit_levels_table_name = :cpd_audit_levels
|
14
|
+
config.cpd_audit_level_sections_table_name = :cpd_audit_level_sections
|
15
|
+
config.cpd_audit_level_questions_table_name = :cpd_audit_level_questions
|
16
|
+
config.cpd_audit_level_question_options_table_name = :cpd_audit_level_question_options
|
17
|
+
|
18
|
+
config.cpd_audits_table_name = :cpd_audits
|
19
|
+
config.cpd_audit_responses_table_name = :cpd_audit_responses
|
20
|
+
config.cpd_audit_response_options_table_name = :cpd_audit_response_options
|
21
|
+
|
22
|
+
config.cpd_audit_reviews_table_name = :cpd_audit_reviews
|
23
|
+
config.cpd_audit_review_items_table_name = :cpd_audit_review_items
|
8
24
|
|
9
25
|
# Layout Settings
|
10
26
|
# Configure the Layout per controller, or all at once
|
@@ -13,17 +29,40 @@ EffectiveCpd.setup do |config|
|
|
13
29
|
admin: 'admin'
|
14
30
|
}
|
15
31
|
|
32
|
+
# Program label settings
|
16
33
|
config.cycle_label = 'year' # 'cycle', 'season'
|
17
34
|
config.credit_label = 'credit' # 'credit', 'PDH', 'PDU', 'CCC'
|
18
35
|
|
19
|
-
#
|
36
|
+
# Auditee Scope Collection
|
20
37
|
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
38
|
+
# When creating a new audit, these are used to select the auditee
|
39
|
+
# The User model must respond to these
|
40
|
+
config.auditee_user_scope = :all
|
41
|
+
|
42
|
+
# Audit Reviewer Scope Collection
|
43
|
+
config.audit_reviewer_user_scope = :all
|
44
|
+
|
45
|
+
# Mailer Configuration
|
46
|
+
# Configure the class responsible to send e-mails.
|
47
|
+
# config.mailer = 'Effective::CpdMailer'
|
48
|
+
|
49
|
+
# Configure the parent class responsible to send e-mails.
|
50
|
+
# config.parent_mailer = 'ActionMailer::Base'
|
51
|
+
|
52
|
+
# Default deliver method
|
53
|
+
# config.deliver_method = :deliver_later
|
54
|
+
|
55
|
+
# Default layout
|
56
|
+
config.mailer_layout = 'effective_cpd_mailer_layout'
|
57
|
+
|
58
|
+
# Default From
|
59
|
+
config.mailer_sender = "no-reply@example.com"
|
60
|
+
|
61
|
+
# Send Admin correspondence To
|
62
|
+
config.mailer_admin = "admin@example.com"
|
28
63
|
|
64
|
+
# Will work with effective_email_templates gem:
|
65
|
+
# - The audit and audit review email content will be preopulated based off the template
|
66
|
+
# - Uses an EmailTemplatesMailer mailer instead of ActionMailer::Base for default parent_mailer
|
67
|
+
config.use_effective_email_templates = false
|
29
68
|
end
|