effective_work_experience 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +188 -0
  4. data/Rakefile +18 -0
  5. data/app/assets/config/effective_work_experience_manifest.js +3 -0
  6. data/app/assets/javascripts/effective_work_experience/base.js +0 -0
  7. data/app/assets/javascripts/effective_work_experience.js +1 -0
  8. data/app/assets/stylesheets/effective_work_experience/base.scss +7 -0
  9. data/app/assets/stylesheets/effective_work_experience.scss +1 -0
  10. data/app/controllers/admin/work_experience_categories_controller.rb +19 -0
  11. data/app/controllers/admin/work_experience_projects_controller.rb +19 -0
  12. data/app/controllers/admin/work_experience_records_controller.rb +19 -0
  13. data/app/controllers/admin/work_experience_reports_controller.rb +21 -0
  14. data/app/controllers/admin/work_experience_subcategories_controller.rb +19 -0
  15. data/app/controllers/admin/work_experience_summaries_controller.rb +19 -0
  16. data/app/controllers/effective/work_experience_projects_controller.rb +17 -0
  17. data/app/controllers/effective/work_experience_records_controller.rb +17 -0
  18. data/app/controllers/effective/work_experience_reports_controller.rb +19 -0
  19. data/app/controllers/effective/work_experience_summaries_controller.rb +17 -0
  20. data/app/datatables/admin/effective_work_experience_categories_datatable.rb +22 -0
  21. data/app/datatables/admin/effective_work_experience_projects_datatable.rb +24 -0
  22. data/app/datatables/admin/effective_work_experience_records_datatable.rb +37 -0
  23. data/app/datatables/admin/effective_work_experience_reports_datatable.rb +34 -0
  24. data/app/datatables/admin/effective_work_experience_subcategories_datatable.rb +24 -0
  25. data/app/datatables/admin/effective_work_experience_summaries_datatable.rb +57 -0
  26. data/app/datatables/effective_work_experience_projects_datatable.rb +38 -0
  27. data/app/datatables/effective_work_experience_records_datatable.rb +61 -0
  28. data/app/datatables/effective_work_experience_reports_review_datatable.rb +15 -0
  29. data/app/datatables/effective_work_experience_summaries_datatable.rb +49 -0
  30. data/app/datatables/effective_work_experience_summaries_review_datatable.rb +43 -0
  31. data/app/helpers/effective_work_experience_helper.rb +46 -0
  32. data/app/mailers/effective/work_experience_mailer.rb +39 -0
  33. data/app/models/concerns/effective_work_experience_summary.rb +264 -0
  34. data/app/models/concerns/effective_work_experience_user.rb +135 -0
  35. data/app/models/effective/work_experience_category.rb +29 -0
  36. data/app/models/effective/work_experience_entry.rb +43 -0
  37. data/app/models/effective/work_experience_outside_mentor.rb +35 -0
  38. data/app/models/effective/work_experience_project.rb +38 -0
  39. data/app/models/effective/work_experience_record.rb +99 -0
  40. data/app/models/effective/work_experience_report.rb +50 -0
  41. data/app/models/effective/work_experience_subcategory.rb +31 -0
  42. data/app/models/effective/work_experience_summary.rb +7 -0
  43. data/app/views/admin/work_experience/_user_fields.html.haml +17 -0
  44. data/app/views/admin/work_experience/_user_work_experience.html.haml +21 -0
  45. data/app/views/admin/work_experience_categories/_form.html.haml +7 -0
  46. data/app/views/admin/work_experience_categories/_form_work_experience_category.html.haml +5 -0
  47. data/app/views/admin/work_experience_projects/_form.html.haml +11 -0
  48. data/app/views/admin/work_experience_projects/_work_experience_project.html.haml +1 -0
  49. data/app/views/admin/work_experience_records/_form.html.haml +12 -0
  50. data/app/views/admin/work_experience_records/_work_experience_record.html.haml +1 -0
  51. data/app/views/admin/work_experience_reports/show.html.haml +2 -0
  52. data/app/views/admin/work_experience_subcategories/_form.html.haml +7 -0
  53. data/app/views/admin/work_experience_subcategories/_form_work_experience_subcategory.html.haml +10 -0
  54. data/app/views/admin/work_experience_summaries/_form.html.haml +7 -0
  55. data/app/views/admin/work_experience_summaries/_form_work_experience_summary.html.haml +32 -0
  56. data/app/views/admin/work_experience_summaries/_work_experience_summary.html.haml +1 -0
  57. data/app/views/effective/work_experience/_dashboard_intern.html.haml +73 -0
  58. data/app/views/effective/work_experience/_dashboard_mentor.html.haml +28 -0
  59. data/app/views/effective/work_experience_mailer/work_experience_summary_reviewed.liquid +13 -0
  60. data/app/views/effective/work_experience_mailer/work_experience_summary_submitted.liquid +15 -0
  61. data/app/views/effective/work_experience_outside_mentors/_fields.html.haml +5 -0
  62. data/app/views/effective/work_experience_projects/_fields.html.haml +7 -0
  63. data/app/views/effective/work_experience_projects/_form.html.haml +3 -0
  64. data/app/views/effective/work_experience_projects/_work_experience_project.html.haml +2 -0
  65. data/app/views/effective/work_experience_records/_fields.html.haml +52 -0
  66. data/app/views/effective/work_experience_records/_form.html.haml +5 -0
  67. data/app/views/effective/work_experience_records/_work_experience_record.html.haml +63 -0
  68. data/app/views/effective/work_experience_reports/_work_experience_report.html.haml +103 -0
  69. data/app/views/effective/work_experience_reports/show.html.haml +2 -0
  70. data/app/views/effective/work_experience_summaries/_content.html.haml +1 -0
  71. data/app/views/effective/work_experience_summaries/_layout.html.haml +3 -0
  72. data/app/views/effective/work_experience_summaries/_projects.html.haml +5 -0
  73. data/app/views/effective/work_experience_summaries/_projects_datatable.html.haml +2 -0
  74. data/app/views/effective/work_experience_summaries/_projects_fields.html.haml +1 -0
  75. data/app/views/effective/work_experience_summaries/_records.html.haml +65 -0
  76. data/app/views/effective/work_experience_summaries/_records_datatable.html.haml +2 -0
  77. data/app/views/effective/work_experience_summaries/_records_fields.html.haml +1 -0
  78. data/app/views/effective/work_experience_summaries/_review.html.haml +4 -0
  79. data/app/views/effective/work_experience_summaries/_review_fields.html.haml +4 -0
  80. data/app/views/effective/work_experience_summaries/_reviewed.html.haml +1 -0
  81. data/app/views/effective/work_experience_summaries/_start_fields.html.haml +1 -0
  82. data/app/views/effective/work_experience_summaries/_summary.html.haml +79 -0
  83. data/app/views/effective/work_experience_summaries/_user.html.haml +7 -0
  84. data/app/views/effective/work_experience_summaries/_work_experience_summary.html.haml +7 -0
  85. data/app/views/effective/work_experience_summaries/projects.html.haml +14 -0
  86. data/app/views/effective/work_experience_summaries/records.html.haml +14 -0
  87. data/app/views/effective/work_experience_summaries/review.html.haml +13 -0
  88. data/app/views/effective/work_experience_summaries/reviewed.html.haml +11 -0
  89. data/app/views/effective/work_experience_summaries/start.html.haml +16 -0
  90. data/app/views/effective/work_experience_summaries/submit.html.haml +10 -0
  91. data/app/views/effective/work_experience_summaries/submitted.html.haml +19 -0
  92. data/config/effective_work_experience.rb +34 -0
  93. data/config/locales/effective_work_experience.en.yml +94 -0
  94. data/config/routes.rb +28 -0
  95. data/db/migrate/101_create_effective_work_experience.rb +120 -0
  96. data/db/seeds.rb +40 -0
  97. data/lib/effective_work_experience/engine.rb +19 -0
  98. data/lib/effective_work_experience/version.rb +3 -0
  99. data/lib/effective_work_experience.rb +34 -0
  100. data/lib/generators/effective_work_experience/install_generator.rb +24 -0
  101. data/lib/generators/templates/effective_work_experience_mailer_preview.rb +4 -0
  102. data/lib/tasks/effective_work_experience_tasks.rake +8 -0
  103. metadata +325 -0
@@ -0,0 +1,52 @@
1
+ = f.hide_if(:backdated, true) do
2
+ .row
3
+ .col-lg-4
4
+ = f.date_field :month, hint: 'Please select the first day of the month'
5
+
6
+ - if local_assigns[:namespace] == :admin
7
+ = f.check_box :backdated, label: "Backdated #{et(f.object)}", hint: "Admin only. There can only be one backdated #{et(f.object)}. This allows admins to contribute hours to each category, which essentially reduces total required hours."
8
+
9
+ - user = f.object.user
10
+ - ceiling_month = Date.new(9999, 12, 31)
11
+
12
+ %table.table.table-hover.table-valign-middle
13
+ %thead
14
+ %tr
15
+ %th
16
+ %th.text-center Week 1
17
+ %th.text-center Week 2
18
+ %th.text-center Week 3
19
+ %th.text-center Week 4
20
+ %th.text-center Week 5
21
+ %th.text-right Hours to Date
22
+ %th.text-right Min Requirement
23
+
24
+ - f.object.work_experience_subcategories.group_by(&:work_experience_category).each do |work_experience_category, work_experience_subcategories|
25
+ %tbody
26
+ - category_hours = work_experience_subcategories.sum { |work_experience_subcategory| user.work_experience_total_hours_to_date(work_experience_subcategory: work_experience_subcategory, month: ceiling_month) }
27
+ %tr{style: "background: #f6f8fa"}
28
+ %th{colspan: 6}= work_experience_category
29
+ %th.text-right= (category_hours > 0.0 ? work_experience_hours_to_s(category_hours) : '-')
30
+ %th.text-right
31
+ - if work_experience_category.minimum_hours.present?
32
+ #{work_experience_category.minimum_hours} hours
33
+
34
+ - work_experience_subcategories.each do |work_experience_subcategory|
35
+ - work_experience_entry = f.object.work_experience_entry(work_experience_subcategory: work_experience_subcategory)
36
+
37
+ = f.fields_for :work_experience_entries, work_experience_entry do |ef|
38
+ %tr
39
+ %td
40
+ = ef.hidden_field :work_experience_subcategory_id
41
+ = ef.object.work_experience_subcategory
42
+ %td= ef.number_text_field :week_1, label: false
43
+ %td= ef.number_text_field :week_2, label: false
44
+ %td= ef.number_text_field :week_3, label: false
45
+ %td= ef.number_text_field :week_4, label: false
46
+ %td= ef.number_text_field :week_5, label: false
47
+ %td.text-right
48
+ - hours = user.work_experience_total_hours_to_date(work_experience_subcategory: work_experience_subcategory, month: ceiling_month)
49
+ = (hours > 0.0 ? work_experience_hours_to_s(hours) : '-')
50
+ %td.text-right
51
+ - if work_experience_subcategory.minimum_hours.present?
52
+ #{work_experience_subcategory.minimum_hours} hours
@@ -0,0 +1,5 @@
1
+ .card
2
+ .card-body
3
+ = effective_form_with(model: work_experience_record, engine: true) do |f|
4
+ = render('effective/work_experience_records/fields', f: f)
5
+ = effective_submit(f)
@@ -0,0 +1,63 @@
1
+ = card(et(work_experience_record.class)) do
2
+ = effective_table_with(work_experience_record, additionally: [:user, :month]) do |f|
3
+ = f.content_for :month, label: 'Month' do
4
+ = f.object.month&.strftime('%F') || 'Backdated'
5
+
6
+ = f.content_for :total_hours, label: 'Hours this month' do
7
+ = work_experience_hours_to_s(f.object.total_hours)
8
+
9
+ = f.content_for :total_hours_so_far, label: 'Total hours to date' do
10
+ = work_experience_hours_to_s(f.object.total_hours_to_date)
11
+
12
+ - user = work_experience_record.user
13
+ - ceiling_month = Date.new(9999, 12, 31)
14
+
15
+ %table.table.table-hover
16
+ %thead
17
+ %tr
18
+ %th
19
+ %th.text-center Week 1
20
+ %th.text-center Week 2
21
+ %th.text-center Week 3
22
+ %th.text-center Week 4
23
+ %th.text-center Week 5
24
+ %th.text-right Hours to Date
25
+ %th.text-right Min Requirement
26
+
27
+ - work_experience_record.work_experience_subcategories.group_by(&:work_experience_category).each do |work_experience_category, work_experience_subcategories|
28
+ %tbody
29
+ - category_hours = work_experience_subcategories.sum { |work_experience_subcategory| user.work_experience_total_hours_to_date(work_experience_subcategory: work_experience_subcategory, month: ceiling_month) }
30
+ %tr
31
+ %th{colspan: 6}= work_experience_category
32
+ %th.text-right= (category_hours > 0.0 ? work_experience_hours_to_s(category_hours) : '-')
33
+ %th.text-right
34
+ - if work_experience_category.minimum_hours.present?
35
+ #{work_experience_category.minimum_hours} hours
36
+
37
+ - work_experience_subcategories.each do |work_experience_subcategory|
38
+ - work_experience_entry = work_experience_record.work_experience_entry(work_experience_subcategory: work_experience_subcategory)
39
+
40
+ %tr
41
+ %td= work_experience_entry.work_experience_subcategory
42
+ %td.text-right= work_experience_hours_to_s(work_experience_entry.week_1)
43
+ %td.text-right= work_experience_hours_to_s(work_experience_entry.week_2)
44
+ %td.text-right= work_experience_hours_to_s(work_experience_entry.week_3)
45
+ %td.text-right= work_experience_hours_to_s(work_experience_entry.week_4)
46
+ %td.text-right= work_experience_hours_to_s(work_experience_entry.week_5)
47
+ %td.text-right
48
+ - hours = user.work_experience_total_hours_to_date(work_experience_subcategory: work_experience_subcategory, month: ceiling_month)
49
+ = (hours > 0.0 ? work_experience_hours_to_s(hours) : '-')
50
+ %td.text-right
51
+ - if work_experience_subcategory.minimum_hours.present?
52
+ #{work_experience_subcategory.minimum_hours} hours
53
+
54
+ %tfoot
55
+ %tr
56
+ %th
57
+ %th.text-right= work_experience_hours_to_s(work_experience_record.week_1_total)
58
+ %th.text-right= work_experience_hours_to_s(work_experience_record.week_2_total)
59
+ %th.text-right= work_experience_hours_to_s(work_experience_record.week_3_total)
60
+ %th.text-right= work_experience_hours_to_s(work_experience_record.week_4_total)
61
+ %th.text-right= work_experience_hours_to_s(work_experience_record.week_5_total)
62
+ %th.text-right= work_experience_hours_to_s(user.work_experience_total_hours_to_date(month: ceiling_month))
63
+ %th
@@ -0,0 +1,103 @@
1
+ = card(et(work_experience_report.class)) do
2
+ %p Work experience report for #{work_experience_report.user}
3
+
4
+ - user = work_experience_report.user
5
+ - years = work_experience_report.years
6
+ - backdated = work_experience_report.backdated_work_experience_record
7
+
8
+ .table-responsive
9
+ %table.table.table-hover
10
+ %thead
11
+ %tr
12
+ %th
13
+ - if backdated.present?
14
+ %th.text-right Backdated
15
+
16
+ - years.each do |year|
17
+ %th.text-right= year
18
+
19
+ %th.text-right Total
20
+ %th.text-right Target
21
+ %th.text-center % Complete
22
+
23
+ %tbody
24
+ - grouped_categories = work_experience_report.work_experience_subcategories.group_by(&:work_experience_category)
25
+ - grouped_categories.each_with_index do |(work_experience_category, work_experience_subcategories), index|
26
+ - if index > 0
27
+ %tr
28
+ %td{colspan: 3 + years.length + (backdated.present? ? 1 : 0) + 1, style: 'background-color: rgba(0, 0, 0, 0.075);'}
29
+
30
+ - category_hours = work_experience_subcategories.sum { |work_experience_subcategory| user.work_experience_total_hours_to_date(month: Time.zone.now.end_of_year, work_experience_subcategory: work_experience_subcategory) }
31
+ %tr
32
+ %th= work_experience_category
33
+ - if backdated.present?
34
+ %td.text-right
35
+ - category_backdated = work_experience_subcategories.sum { |work_experience_subcategory| backdated.work_experience_entry(work_experience_subcategory: work_experience_subcategory).hours.to_f }
36
+ = (category_backdated > 0.0 ? work_experience_hours_to_s(category_backdated) : '-')
37
+ - years.each do |year|
38
+ %td.text-right
39
+ - category_year_hours = work_experience_subcategories.sum { |work_experience_subcategory| user.work_experience_hours_by_year(year: year, work_experience_subcategory: work_experience_subcategory).to_f }
40
+ = (category_year_hours > 0.0 ? work_experience_hours_to_s(category_year_hours) : '-')
41
+ %td.text-right= (category_hours > 0.0 ? work_experience_hours_to_s(category_hours) : '-')
42
+ %th.text-right
43
+ - if work_experience_category.minimum_hours.present?
44
+ = pluralize(work_experience_category.minimum_hours, 'hour')
45
+ %th.text-center
46
+ - if work_experience_category.minimum_hours.to_i > 0
47
+ = number_to_percentage((category_hours / work_experience_category.minimum_hours.to_f * 100), precision: 0)
48
+
49
+ - work_experience_subcategories.each do |work_experience_subcategory|
50
+ - hours_to_date = user.work_experience_total_hours_to_date(month: Time.zone.now.end_of_year, work_experience_subcategory: work_experience_subcategory)
51
+
52
+ %tr
53
+ %td= work_experience_subcategory
54
+
55
+ - if backdated.present?
56
+ %td.text-right
57
+ - value = backdated.work_experience_entry(work_experience_subcategory: work_experience_subcategory).hours.to_f
58
+ = (value > 0.0 ? work_experience_hours_to_s(value) : '-')
59
+
60
+ - years.each do |year|
61
+ %td.text-right
62
+ - value = user.work_experience_hours_by_year(year: year, work_experience_subcategory: work_experience_subcategory).to_f
63
+ = (value > 0.0 ? work_experience_hours_to_s(value) : '-')
64
+
65
+ %td.text-right
66
+ - value = hours_to_date.to_f
67
+ = (value > 0.0 ? work_experience_hours_to_s(value) : '-')
68
+
69
+ %td.text-right
70
+ - if work_experience_subcategory.minimum_hours.present?
71
+ = pluralize(work_experience_subcategory.minimum_hours, 'hour')
72
+
73
+ %td.text-center
74
+ - if work_experience_subcategory.minimum_hours.to_i > 0
75
+ = number_to_percentage((hours_to_date / work_experience_subcategory.minimum_hours.to_f * 100), precision: 0)
76
+
77
+ %tfoot
78
+ %tr
79
+ %th
80
+ - if backdated.present?
81
+ %th.text-right Backdated
82
+ - years.each do |year|
83
+ %th.text-right= year
84
+ %th.text-right Total
85
+ %th.text-right Target
86
+ %th.text-center % Complete
87
+
88
+ %tr
89
+ %th
90
+
91
+ - if backdated.present?
92
+ %th.text-right= work_experience_hours_to_s(backdated.total_hours)
93
+
94
+ - years.each do |year|
95
+ %th.text-right
96
+ - value = user.work_experience_hours_by_year(year: year).to_f
97
+ = (value > 0.0 ? work_experience_hours_to_s(value) : '-')
98
+
99
+ %th.text-right
100
+ - value = user.work_experience_total_hours_to_date(month: Time.zone.now.end_of_year).to_f
101
+ = (value > 0.0 ? work_experience_hours_to_s(value) : '-')
102
+ %th
103
+ %th
@@ -0,0 +1,2 @@
1
+ %h1= @page_title
2
+ = render('effective/work_experience_reports/work_experience_report', work_experience_report: @work_experience_report)
@@ -0,0 +1 @@
1
+ -# Intentionally blank
@@ -0,0 +1,3 @@
1
+ .row
2
+ .col-lg-3.mb-3= render_wizard_sidebar(resource)
3
+ .col-lg-9= yield
@@ -0,0 +1,5 @@
1
+ = wizard_card(work_experience_summary) do
2
+ = effective_table_with(work_experience_summary) do |f|
3
+ = render("effective/work_experience_summaries/projects_fields", f: f)
4
+
5
+ = render('effective/work_experience_summaries/projects_datatable', work_experience_summary: work_experience_summary, skip_actions: true)
@@ -0,0 +1,2 @@
1
+ - datatable = EffectiveWorkExperienceProjectsDatatable.new(self, user: work_experience_summary.user, work_experience_summary: work_experience_summary, skip_actions: local_assigns[:skip_actions] || false)
2
+ = render_datatable(datatable, simple: true, inline: true)
@@ -0,0 +1,65 @@
1
+ = wizard_card(work_experience_summary) do
2
+ = effective_table_with(work_experience_summary) do |f|
3
+ = render("effective/work_experience_summaries/records_fields", f: f)
4
+
5
+ - months = work_experience_summary.months
6
+ - user = work_experience_summary.user
7
+
8
+ %table.table.table-hover
9
+ %thead
10
+ %tr
11
+ %th
12
+ - months.each do |month|
13
+ %th.text-right= month.strftime('%B %Y')
14
+
15
+ %th.text-right Hours to Date
16
+ %th.text-right Min Requirement
17
+
18
+ - grouped_categories = work_experience_summary.work_experience_subcategories.group_by(&:work_experience_category)
19
+ - grouped_categories.each_with_index do |(work_experience_category, work_experience_subcategories), index|
20
+ %tbody
21
+ - category_hours = work_experience_subcategories.sum { |work_experience_subcategory| user.work_experience_total_hours_to_date(work_experience_subcategory: work_experience_subcategory, month: work_experience_summary.end_on) }
22
+ %tr{style: "background: #f6f8fa"}
23
+ %th= work_experience_category
24
+ - months.each do |month|
25
+ %td.text-right
26
+ - category_month_hours = work_experience_subcategories.sum { |work_experience_subcategory| user.work_experience_hours(work_experience_subcategory: work_experience_subcategory, month: month) }
27
+ = (category_month_hours > 0.0 ? work_experience_hours_to_s(category_month_hours) : '-')
28
+ %td.text-right= (category_hours > 0.0 ? work_experience_hours_to_s(category_hours) : '-')
29
+ %th.text-right
30
+ - if work_experience_category.minimum_hours.present?
31
+ #{work_experience_category.minimum_hours} hours
32
+
33
+ - work_experience_subcategories.each do |work_experience_subcategory|
34
+ %tr
35
+ %td= work_experience_subcategory
36
+
37
+ - months.each do |month|
38
+ %td.text-right
39
+ - hours = user.work_experience_hours(work_experience_subcategory: work_experience_subcategory, month: month)
40
+ = (hours > 0.0 ? work_experience_hours_to_s(hours) : '-')
41
+
42
+ %td.text-right
43
+ - hours = user.work_experience_total_hours_to_date(work_experience_subcategory: work_experience_subcategory, month: work_experience_summary.end_on)
44
+ = (hours > 0.0 ? work_experience_hours_to_s(hours) : '-')
45
+
46
+ %td.text-right
47
+ - if work_experience_subcategory.minimum_hours.present?
48
+ #{work_experience_subcategory.minimum_hours} hours
49
+
50
+ %tfoot
51
+ %tr
52
+ %th
53
+ - months.each do |month|
54
+ %th.text-right
55
+ = work_experience_hours_to_s(user.work_experience_hours(month: month))
56
+ %th.text-right
57
+ = work_experience_hours_to_s(user.work_experience_total_hours_to_date(month: work_experience_summary.end_on))
58
+ %th
59
+
60
+ %tr
61
+ %th
62
+ - months.each do |month|
63
+ %th.text-right= month.strftime('%B %Y')
64
+ %th.text-right Hours to Date
65
+ %th
@@ -0,0 +1,2 @@
1
+ - datatable = EffectiveWorkExperienceRecordsDatatable.new(self, user: work_experience_summary.user, work_experience_summary: work_experience_summary, skip_actions: local_assigns[:skip_actions] || false)
2
+ = render_datatable(datatable, simple: true, inline: true)
@@ -0,0 +1 @@
1
+ -# Intentionally blank
@@ -0,0 +1,4 @@
1
+ - unless current_user == work_experience_summary.user
2
+ = wizard_card(work_experience_summary) do
3
+ = effective_table_with(work_experience_summary) do |f|
4
+ = render("effective/work_experience_summaries/review_fields", f: f)
@@ -0,0 +1,4 @@
1
+ - f.object.approve_work_experience_summary = true if f.object.recommendation == f.object.recommendations.first
2
+ = f.check_box :approve_work_experience_summary, label: "Approve #{et(f.object)}"
3
+
4
+ = f.article_editor :comments, label: 'Reviewer Comments', hint: 'These are private comments and are not displayed to the intern'
@@ -0,0 +1 @@
1
+ -# Intentionally blank
@@ -0,0 +1 @@
1
+ = f.select :start_on, work_experience_summary_start_on_collection(f.object), label: 'Summary Period'
@@ -0,0 +1,79 @@
1
+ %table.table.table-sm.table-striped.table-hover.effective-table-summary.mb-0
2
+ - user = work_experience_summary.user
3
+ - admin = request.path.start_with?('/admin')
4
+
5
+ %tbody
6
+ %tr
7
+ %th Intern
8
+ %td
9
+ = render('effective/work_experience_summaries/user', work_experience_summary: work_experience_summary, user: user)
10
+
11
+ - if admin
12
+ - url = (polymorphic_admin_path(user) rescue nil)
13
+ - if url.present?
14
+ %div= link_to(user, url)
15
+
16
+ - if admin && defined?(EffectiveMemberships) && (membership = user.try(:membership)).present?
17
+ %tr
18
+ %th Membership
19
+ %td
20
+ Joined on #{membership.joined_on.strftime('%F')}
21
+ - if membership.reregistered?
22
+ and last changed on #{membership.registration_on.strftime('%F')}
23
+
24
+ = collapse('show membership history', card_class: '', link_class: 'p-0 ml-4') do
25
+ = render_datatable(::Admin::EffectiveMembershipHistoriesDatatable.new(owner: user, actions: false), simple: true)
26
+
27
+ - if work_experience_summary.mentor.present?
28
+ %tr
29
+ %th Mentor
30
+ %td
31
+ = render('effective/work_experience_summaries/user', work_experience_summary: work_experience_summary, user: work_experience_summary.mentor)
32
+
33
+ - if admin
34
+ - url = (polymorphic_admin_path(work_experience_summary.mentor) rescue nil)
35
+ - if url.present?
36
+ %div= link_to(work_experience_summary.mentor, url)
37
+
38
+ - if work_experience_summary.supervisor.present?
39
+ %tr
40
+ %th Supervisor
41
+ %td= render('effective/work_experience_summaries/user', work_experience_summary: work_experience_summary, user: work_experience_summary.supervisor)
42
+
43
+ - if (outside_mentor = user.try(:work_experience_outside_mentor)).present?
44
+ %tr
45
+ %th Outside Mentor
46
+ %td
47
+ = outside_mentor.name
48
+ %div= outside_mentor.regulated_profession
49
+ %div
50
+ = mail_to(outside_mentor.email)
51
+ = outside_mentor.phone
52
+
53
+ %tr
54
+ %th Period
55
+ %td= work_experience_summary.period
56
+
57
+ %tr
58
+ %th Hours this period
59
+ %td= work_experience_hours_to_s(work_experience_summary.total_hours)
60
+
61
+ %tr
62
+ %th Total hours to date
63
+ %td= work_experience_hours_to_s(work_experience_summary.total_hours_to_date)
64
+
65
+ %tr
66
+ %th Status
67
+ %td
68
+ %span.badge.badge-secondary= work_experience_summary.status_label
69
+ = work_experience_summary.summary
70
+
71
+ - if work_experience_summary.was_submitted?
72
+ %tr
73
+ %th Submitted
74
+ %td= work_experience_summary.submitted_at.strftime('%F')
75
+
76
+ - if work_experience_summary.was_reviewed?
77
+ %tr
78
+ %th Reviewed
79
+ %td= work_experience_summary.reviewed_at.strftime('%F')
@@ -0,0 +1,7 @@
1
+ = user.to_s
2
+ %br
3
+ = mail_to(user&.email)
4
+
5
+ - if user.try(:membership).try(:number).present?
6
+ %br
7
+ = "##{user.membership.number}"
@@ -0,0 +1,7 @@
1
+ .work-experience-summary
2
+ = card("#{work_experience_summary.summary_months}-Month Work Experience Summary") do
3
+ = render('effective/work_experience_summaries/summary', work_experience_summary: work_experience_summary)
4
+
5
+ - work_experience_summary.render_steps.each do |partial|
6
+ - work_experience_summary.render_step = partial
7
+ = render "effective/work_experience_summaries/#{partial}", work_experience_summary: work_experience_summary
@@ -0,0 +1,14 @@
1
+ = render 'layout' do
2
+ = render 'effective/work_experience_summaries/content', resource: resource
3
+
4
+ = card do
5
+ %p Displaying all #{etsd(Effective::WorkExperienceProject)} for #{resource.period}:
6
+ %p Please confirm the following:
7
+ = render('effective/work_experience_summaries/projects_datatable', work_experience_summary: resource)
8
+
9
+ = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
10
+ = f.hidden_field :id
11
+
12
+ = render('effective/work_experience_summaries/projects_fields', f: f)
13
+
14
+ = f.submit 'Save and Continue', left: true
@@ -0,0 +1,14 @@
1
+ = render 'layout' do
2
+ = render 'effective/work_experience_summaries/content', resource: resource
3
+
4
+ = card do
5
+ %p Displaying all #{etsd(Effective::WorkExperienceRecord)} for #{resource.period}:
6
+ %p Please confirm the following:
7
+ = render('effective/work_experience_summaries/records_datatable', work_experience_summary: resource)
8
+
9
+ = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
10
+ = f.hidden_field :id
11
+
12
+ = render('effective/work_experience_summaries/records_fields', f: f)
13
+
14
+ = f.submit 'Save and Continue', left: true
@@ -0,0 +1,13 @@
1
+ = render 'layout' do
2
+ = render 'effective/work_experience_summaries/content', resource: resource
3
+
4
+ = card do
5
+ %p Please review the following #{etd(resource.class)}
6
+
7
+ = render('effective/work_experience_summaries/work_experience_summary', work_experience_summary: resource)
8
+
9
+ = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
10
+ = card('Review') do
11
+ = render('effective/work_experience_summaries/review_fields', f: f)
12
+
13
+ = f.submit 'Complete Mentor Review', left: true, class: 'btn btn-primary btn-lg btn-block'
@@ -0,0 +1,11 @@
1
+ = render 'layout' do
2
+ = render 'effective/work_experience_summaries/content', resource: resource
3
+ - raise('expected a reviewed work experience summary') unless resource.was_reviewed?
4
+
5
+ .alert.alert-success.mb-4
6
+ This #{etd(resource.class)} was reviewed on #{resource.reviewed_at.strftime('%F')}
7
+
8
+ = render('effective/work_experience_summaries/work_experience_summary', work_experience_summary: resource)
9
+
10
+ .mb-4
11
+ = link_to "Return to Dashboard", return_to_dashboard_path, class: 'btn btn-lg btn-primary btn-block'
@@ -0,0 +1,16 @@
1
+ = render 'layout' do
2
+ = render 'effective/work_experience_summaries/content', resource: resource
3
+
4
+ = card do
5
+ = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
6
+ = f.hidden_field :id
7
+
8
+ - if f.object.mentor.blank?
9
+ %p You have not yet been assigned a mentor. Please contact the office to be assigned a mentor.
10
+ - else
11
+ %p Your mentor for this #{etd(f.object.class)} is #{f.object.mentor}.
12
+ %p Please contact the office if this is incorrect.
13
+
14
+ = render('effective/work_experience_summaries/start_fields', f: f)
15
+
16
+ = f.submit 'Save and Continue', left: true
@@ -0,0 +1,10 @@
1
+ = render 'layout' do
2
+ = render 'effective/work_experience_summaries/content', resource: resource
3
+
4
+ = render('effective/work_experience_summaries/work_experience_summary', work_experience_summary: resource)
5
+
6
+ = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
7
+ = f.hidden_field :id
8
+
9
+ - label = (resource.mentor.present? ? 'Submit for Mentor Review' : 'Submit Work Experience')
10
+ = f.submit label, left: true, class: 'btn btn-primary btn-lg btn-block'
@@ -0,0 +1,19 @@
1
+ = render 'layout' do
2
+ = render 'effective/work_experience_summaries/content', resource: resource
3
+ - raise('expected a submitted work experience summary') unless resource.was_submitted?
4
+
5
+ .alert.alert-success.mb-4
6
+ This #{etd(resource.class)} was submitted on #{resource.submitted_at.strftime('%F')}
7
+
8
+ - unless resource.reviewed?
9
+ = card do
10
+ %p
11
+ Your #{etd(resource.class)} must still be reviewed.
12
+ We will send
13
+ %strong= resource.user.email
14
+ an email with any updates
15
+
16
+ = render('effective/work_experience_summaries/work_experience_summary', work_experience_summary: resource)
17
+
18
+ .mb-4
19
+ = link_to "Return to Dashboard", return_to_dashboard_path, class: 'btn btn-lg btn-primary btn-block'
@@ -0,0 +1,34 @@
1
+ EffectiveWorkExperience.setup do |config|
2
+ # Configure the class responsible for the work experience summary
3
+ # Any class you provide here should be marked with effective_work_experience_summary
4
+ # config.work_experience_summary_class_name = 'Effective::WorkExperienceSummary'
5
+
6
+ # The number of months in each work experience summary period
7
+ # Display only for now. Every period is one calendar quarter.
8
+ config.summary_months = 3
9
+
10
+ # The recommendations a mentor may make when reviewing a work experience summary
11
+ config.recommendations = ['Recommend Approve', 'Recommend Decline']
12
+
13
+ # Layout Settings
14
+ # Configure the Layout per controller, or all at once
15
+ # config.layout = { application: 'application', admin: 'admin' }
16
+
17
+ # Mailer Settings
18
+ # Please see config/initializers/effective_resources.rb for default effective_* gem mailer settings
19
+ #
20
+ # Configure the class responsible to send e-mails.
21
+ # config.mailer = 'Effective::WorkExperienceMailer'
22
+ #
23
+ # Override effective_resource mailer defaults
24
+ #
25
+ # config.parent_mailer = nil # The parent class responsible for sending emails
26
+ # config.deliver_method = nil # The deliver method, deliver_later or deliver_now
27
+ # config.mailer_layout = nil # Default mailer layout
28
+ # config.mailer_sender = nil # Default From value
29
+ # config.mailer_admin = nil # Default To value for Admin correspondence
30
+ # config.mailer_subject = nil # Proc.new method used to customize Subject
31
+
32
+ # Will work with effective_email_templates gem
33
+ config.use_effective_email_templates = true
34
+ end