next_sgad 0.1.3

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 (212) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +34 -0
  4. data/Rakefile +37 -0
  5. data/app/assets/config/next_sgad_manifest.js +2 -0
  6. data/app/assets/javascripts/next_sgad/activities.js +2 -0
  7. data/app/assets/javascripts/next_sgad/application.js +108 -0
  8. data/app/assets/javascripts/next_sgad/assessments.js +2 -0
  9. data/app/assets/javascripts/next_sgad/attendances.js +2 -0
  10. data/app/assets/javascripts/next_sgad/configurations.js +2 -0
  11. data/app/assets/javascripts/next_sgad/departments.js +2 -0
  12. data/app/assets/javascripts/next_sgad/employee_goals.js +2 -0
  13. data/app/assets/javascripts/next_sgad/employees.js +2 -0
  14. data/app/assets/javascripts/next_sgad/functions.js +7 -0
  15. data/app/assets/javascripts/next_sgad/goals.js +2 -0
  16. data/app/assets/javascripts/next_sgad/jquery.orgchart.min.js +2 -0
  17. data/app/assets/javascripts/next_sgad/justifications.js +2 -0
  18. data/app/assets/javascripts/next_sgad/positions.js +2 -0
  19. data/app/assets/javascripts/next_sgad/results.js +2 -0
  20. data/app/assets/stylesheets/next_sgad/activities.css +4 -0
  21. data/app/assets/stylesheets/next_sgad/application.css +77 -0
  22. data/app/assets/stylesheets/next_sgad/assessments.css +4 -0
  23. data/app/assets/stylesheets/next_sgad/attendances.css +4 -0
  24. data/app/assets/stylesheets/next_sgad/configurations.css +4 -0
  25. data/app/assets/stylesheets/next_sgad/departments.css +4 -0
  26. data/app/assets/stylesheets/next_sgad/employee_goals.css +4 -0
  27. data/app/assets/stylesheets/next_sgad/employees.css +4 -0
  28. data/app/assets/stylesheets/next_sgad/functions.css +4 -0
  29. data/app/assets/stylesheets/next_sgad/goals.css +4 -0
  30. data/app/assets/stylesheets/next_sgad/jquery.orgchart.min.css +2 -0
  31. data/app/assets/stylesheets/next_sgad/justifications.css +4 -0
  32. data/app/assets/stylesheets/next_sgad/positions.css +4 -0
  33. data/app/assets/stylesheets/next_sgad/results.css +4 -0
  34. data/app/controllers/next_sgad/activities_controller.rb +63 -0
  35. data/app/controllers/next_sgad/application_controller.rb +5 -0
  36. data/app/controllers/next_sgad/assessments_controller.rb +62 -0
  37. data/app/controllers/next_sgad/attendances_controller.rb +62 -0
  38. data/app/controllers/next_sgad/configurations_controller.rb +62 -0
  39. data/app/controllers/next_sgad/departments_controller.rb +62 -0
  40. data/app/controllers/next_sgad/employee_goals_controller.rb +62 -0
  41. data/app/controllers/next_sgad/employees_controller.rb +62 -0
  42. data/app/controllers/next_sgad/functions_controller.rb +62 -0
  43. data/app/controllers/next_sgad/goals_controller.rb +62 -0
  44. data/app/controllers/next_sgad/justifications_controller.rb +62 -0
  45. data/app/controllers/next_sgad/positions_controller.rb +78 -0
  46. data/app/controllers/next_sgad/results_controller.rb +62 -0
  47. data/app/helpers/next_sgad/activities_helper.rb +4 -0
  48. data/app/helpers/next_sgad/application_helper.rb +4 -0
  49. data/app/helpers/next_sgad/assessments_helper.rb +4 -0
  50. data/app/helpers/next_sgad/attendances_helper.rb +4 -0
  51. data/app/helpers/next_sgad/configurations_helper.rb +4 -0
  52. data/app/helpers/next_sgad/departments_helper.rb +4 -0
  53. data/app/helpers/next_sgad/employee_goals_helper.rb +4 -0
  54. data/app/helpers/next_sgad/employees_helper.rb +4 -0
  55. data/app/helpers/next_sgad/functions_helper.rb +4 -0
  56. data/app/helpers/next_sgad/goals_helper.rb +4 -0
  57. data/app/helpers/next_sgad/justifications_helper.rb +4 -0
  58. data/app/helpers/next_sgad/positions_helper.rb +55 -0
  59. data/app/helpers/next_sgad/results_helper.rb +4 -0
  60. data/app/jobs/next_sgad/application_job.rb +4 -0
  61. data/app/mailers/next_sgad/application_mailer.rb +6 -0
  62. data/app/models/next_sgad/activity.rb +4 -0
  63. data/app/models/next_sgad/application_record.rb +18 -0
  64. data/app/models/next_sgad/assessment.rb +128 -0
  65. data/app/models/next_sgad/attendance.rb +70 -0
  66. data/app/models/next_sgad/configuration.rb +4 -0
  67. data/app/models/next_sgad/department.rb +20 -0
  68. data/app/models/next_sgad/employee.rb +28 -0
  69. data/app/models/next_sgad/employee_goal.rb +36 -0
  70. data/app/models/next_sgad/function.rb +8 -0
  71. data/app/models/next_sgad/goal.rb +37 -0
  72. data/app/models/next_sgad/justification.rb +47 -0
  73. data/app/models/next_sgad/position.rb +36 -0
  74. data/app/models/next_sgad/result.rb +27 -0
  75. data/app/models/next_sgad/setting.rb +13 -0
  76. data/app/views/layouts/next_sgad/application.html.erb +14 -0
  77. data/app/views/next_sgad/activities/_form.html.erb +27 -0
  78. data/app/views/next_sgad/activities/edit.html.erb +6 -0
  79. data/app/views/next_sgad/activities/index.html.erb +29 -0
  80. data/app/views/next_sgad/activities/new.html.erb +5 -0
  81. data/app/views/next_sgad/activities/show.html.erb +14 -0
  82. data/app/views/next_sgad/assessments/_form.html.erb +27 -0
  83. data/app/views/next_sgad/assessments/edit.html.erb +6 -0
  84. data/app/views/next_sgad/assessments/index.html.erb +29 -0
  85. data/app/views/next_sgad/assessments/new.html.erb +5 -0
  86. data/app/views/next_sgad/assessments/show.html.erb +14 -0
  87. data/app/views/next_sgad/attendances/_form.html.erb +37 -0
  88. data/app/views/next_sgad/attendances/edit.html.erb +6 -0
  89. data/app/views/next_sgad/attendances/index.html.erb +33 -0
  90. data/app/views/next_sgad/attendances/new.html.erb +5 -0
  91. data/app/views/next_sgad/attendances/show.html.erb +24 -0
  92. data/app/views/next_sgad/configurations/_form.html.erb +32 -0
  93. data/app/views/next_sgad/configurations/edit.html.erb +6 -0
  94. data/app/views/next_sgad/configurations/index.html.erb +31 -0
  95. data/app/views/next_sgad/configurations/new.html.erb +5 -0
  96. data/app/views/next_sgad/configurations/show.html.erb +19 -0
  97. data/app/views/next_sgad/departments/_form.html.erb +32 -0
  98. data/app/views/next_sgad/departments/edit.html.erb +6 -0
  99. data/app/views/next_sgad/departments/index.html.erb +33 -0
  100. data/app/views/next_sgad/departments/new.html.erb +5 -0
  101. data/app/views/next_sgad/departments/show.html.erb +24 -0
  102. data/app/views/next_sgad/employee_goals/_form.html.erb +42 -0
  103. data/app/views/next_sgad/employee_goals/edit.html.erb +6 -0
  104. data/app/views/next_sgad/employee_goals/index.html.erb +35 -0
  105. data/app/views/next_sgad/employee_goals/new.html.erb +5 -0
  106. data/app/views/next_sgad/employee_goals/show.html.erb +29 -0
  107. data/app/views/next_sgad/employees/_form.html.erb +27 -0
  108. data/app/views/next_sgad/employees/_organigrama.html.erb +7 -0
  109. data/app/views/next_sgad/employees/edit.html.erb +6 -0
  110. data/app/views/next_sgad/employees/index.html.erb +31 -0
  111. data/app/views/next_sgad/employees/new.html.erb +5 -0
  112. data/app/views/next_sgad/employees/show.html.erb +19 -0
  113. data/app/views/next_sgad/functions/_form.html.erb +22 -0
  114. data/app/views/next_sgad/functions/edit.html.erb +6 -0
  115. data/app/views/next_sgad/functions/index.html.erb +27 -0
  116. data/app/views/next_sgad/functions/new.html.erb +5 -0
  117. data/app/views/next_sgad/functions/show.html.erb +9 -0
  118. data/app/views/next_sgad/goals/_form.html.erb +62 -0
  119. data/app/views/next_sgad/goals/edit.html.erb +6 -0
  120. data/app/views/next_sgad/goals/index.html.erb +41 -0
  121. data/app/views/next_sgad/goals/new.html.erb +5 -0
  122. data/app/views/next_sgad/goals/show.html.erb +49 -0
  123. data/app/views/next_sgad/justifications/_form.html.erb +22 -0
  124. data/app/views/next_sgad/justifications/edit.html.erb +6 -0
  125. data/app/views/next_sgad/justifications/index.html.erb +27 -0
  126. data/app/views/next_sgad/justifications/new.html.erb +5 -0
  127. data/app/views/next_sgad/justifications/show.html.erb +9 -0
  128. data/app/views/next_sgad/positions/_form.html.erb +43 -0
  129. data/app/views/next_sgad/positions/edit.html.erb +6 -0
  130. data/app/views/next_sgad/positions/index.html.erb +94 -0
  131. data/app/views/next_sgad/positions/new.html.erb +5 -0
  132. data/app/views/next_sgad/positions/organigram.html.erb +1 -0
  133. data/app/views/next_sgad/positions/show.html.erb +34 -0
  134. data/app/views/next_sgad/results/_form.html.erb +37 -0
  135. data/app/views/next_sgad/results/edit.html.erb +6 -0
  136. data/app/views/next_sgad/results/index.html.erb +33 -0
  137. data/app/views/next_sgad/results/new.html.erb +5 -0
  138. data/app/views/next_sgad/results/show.html.erb +24 -0
  139. data/config/initializers/core_extentions.rb +1 -0
  140. data/config/initializers/initializer.rb +1 -0
  141. data/config/initializers/m.rb +1 -0
  142. data/config/initializers/semper.rb +1 -0
  143. data/config/routes.rb +16 -0
  144. data/db/migrate/20171014174705_create_next_sgad_departments.rb +11 -0
  145. data/db/migrate/20171014175212_create_next_sgad_employees.rb +11 -0
  146. data/db/migrate/20171014175507_create_next_sgad_positions.rb +13 -0
  147. data/db/migrate/20171014183337_create_next_sgad_configurations.rb +11 -0
  148. data/db/migrate/20171015073528_add_next_sgad_department_to_department.rb +6 -0
  149. data/db/migrate/20171019142918_remove_table_configurations.rb +5 -0
  150. data/db/migrate/20171019143336_create_next_sgad_settings.rb +11 -0
  151. data/db/migrate/20171022113005_add_paygrade_to_next_sgad_employee.rb +6 -0
  152. data/db/migrate/20171024154422_create_next_sgad_assessments.rb +10 -0
  153. data/db/migrate/20171024172007_create_next_sgad_goals.rb +18 -0
  154. data/db/migrate/20171024181227_create_next_sgad_employee_goals.rb +16 -0
  155. data/db/migrate/20171024192907_corrects_references.rb +8 -0
  156. data/db/migrate/20171024193750_copies_info_from_old_references.rb +8 -0
  157. data/db/migrate/20171025093224_change_column_year_from_assessments.rb +6 -0
  158. data/db/migrate/20171025134655_add_goal_type_to_employee_goals.rb +8 -0
  159. data/db/migrate/20171025135319_addname_to_next_sgad_employee_goals.rb +5 -0
  160. data/db/migrate/20171025153545_add_position_reference_to_goals.rb +4 -0
  161. data/db/migrate/20171026055530_add_position_to_next_sgad_goals.rb +5 -0
  162. data/db/migrate/20171026060110_add_position_to_next_sgad_employee.rb +5 -0
  163. data/db/migrate/20171026060351_copies_posiiton_id_to_employees.rb +9 -0
  164. data/db/migrate/20171026061315_remove_old_reference_columns.rb +8 -0
  165. data/db/migrate/20171026115447_add_description_to_next_sgad_goals.rb +6 -0
  166. data/db/migrate/20171026142240_add_position_to_next_sgad_employee_goals.rb +5 -0
  167. data/db/migrate/20171027210543_create_next_sgad_functions.rb +9 -0
  168. data/db/migrate/20171027210912_add_function_to_next_sgad_positions.rb +5 -0
  169. data/db/migrate/20171027213833_create_join_table_goal_position.rb +8 -0
  170. data/db/migrate/20171027221550_create_join_table_employee_position.rb +8 -0
  171. data/db/migrate/20171027223737_add_efective_to_next_sgad_positions.rb +5 -0
  172. data/db/migrate/20171027230032_remove_position_from_next_sgad_employee.rb +6 -0
  173. data/db/migrate/20171027230033_clear_data.rb +7 -0
  174. data/db/migrate/20171028061909_add_description_to_next_sgad_functions.rb +5 -0
  175. data/db/migrate/20171028140106_add_percentages_to_next_sagad_assessments.rb +6 -0
  176. data/db/migrate/20171029074321_rename_paygrade_and_level_from_employee.rb +7 -0
  177. data/db/migrate/20171029103212_add_email_to_next_sgad_employee.rb +5 -0
  178. data/db/migrate/20171029154047_add_coment_to_next_sgad_employee_goals.rb +6 -0
  179. data/db/migrate/20171029160044_add_amount_to_next_sgad_employee_goals.rb +5 -0
  180. data/db/migrate/20171101112232_change_self_assessment_from_next_sgad_employee_goals.rb +13 -0
  181. data/db/migrate/20171106113735_add_first_name_to_next_sgad_employees.rb +24 -0
  182. data/db/migrate/20171110103155_add_number_to_next_sgad_functions.rb +5 -0
  183. data/db/migrate/20171111081148_create_next_sgad_justifications.rb +9 -0
  184. data/db/migrate/20171111093506_create_next_sgad_attendances.rb +13 -0
  185. data/db/migrate/20171111093524_add_references_to_justifications_and_attendences.rb +10 -0
  186. data/db/migrate/20171111094154_create_join_table_attendance_justification.rb +8 -0
  187. data/db/migrate/20171111121753_create_next_sgad_results.rb +13 -0
  188. data/db/migrate/20171111121935_resolts_relationship.rb +9 -0
  189. data/db/migrate/20171112004221_add_attendance_percentage_to_next_sgad_assessment.rb +14 -0
  190. data/db/migrate/20171112121440_add_status_to_next_sgad_justifications.rb +7 -0
  191. data/db/migrate/20171112172436_add_department_to_attendances.rb +6 -0
  192. data/db/migrate/20171113125224_add_configuration_columns_to_nexts_sgad_assessment.rb +18 -0
  193. data/db/migrate/20171113143825_add_max_number_of_absences_for_five_to_next_sgad_assessments.rb +9 -0
  194. data/db/migrate/20171114135601_change_column_status_from_result.rb +6 -0
  195. data/db/migrate/20171115085324_create_next_sgad_activities.rb +10 -0
  196. data/db/migrate/20171115110522_add_column_nature_and_value_to_results.rb +7 -0
  197. data/db/migrate/20171115111821_remove_unused_columns.rb +19 -0
  198. data/db/migrate/20171115140048_corrects_status.rb +6 -0
  199. data/db/migrate/20171115160122_add_justification_status_to_next_sgad_attendances.rb +5 -0
  200. data/db/migrate/20171115161157_migrate_fill_justification_columns.rb +7 -0
  201. data/lib/concerns/models/employee.rb +25 -0
  202. data/lib/generators/initializer/USAGE +8 -0
  203. data/lib/generators/initializer/initializer_generator.rb +6 -0
  204. data/lib/generators/initializer/templates/initializer.rb +1 -0
  205. data/lib/generators/initializer_generator.rb +6 -0
  206. data/lib/generators/views/USAGE +8 -0
  207. data/lib/generators/views/views_generator.rb +3 -0
  208. data/lib/next_sgad/engine.rb +13 -0
  209. data/lib/next_sgad/version.rb +3 -0
  210. data/lib/next_sgad.rb +5 -0
  211. data/lib/tasks/next_sgad_tasks.rake +4 -0
  212. metadata +268 -0
@@ -0,0 +1,49 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Name:</strong>
5
+ <%= @goal.name %>
6
+ </p>
7
+
8
+ <p>
9
+ <strong>References:</strong>
10
+ <%= @goal.references %>
11
+ </p>
12
+
13
+ <p>
14
+ <strong>Goal type:</strong>
15
+ <%= @goal.goal_type %>
16
+ </p>
17
+
18
+ <p>
19
+ <strong>State:</strong>
20
+ <%= @goal.status %>
21
+ </p>
22
+
23
+ <p>
24
+ <strong>Nature:</strong>
25
+ <%= @goal.nature %>
26
+ </p>
27
+
28
+ <p>
29
+ <strong>Unit:</strong>
30
+ <%= @goal.unit %>
31
+ </p>
32
+
33
+ <p>
34
+ <strong>Target:</strong>
35
+ <%= @goal.target %>
36
+ </p>
37
+
38
+ <p>
39
+ <strong>Percentage on the type:</strong>
40
+ <%= @goal.percentage_on_the_type %>
41
+ </p>
42
+
43
+ <p>
44
+ <strong>Percentage:</strong>
45
+ <%= @goal.percentage %>
46
+ </p>
47
+
48
+ <%= link_to 'Edit', edit_goal_path(@goal) %> |
49
+ <%= link_to 'Back', goals_path %>
@@ -0,0 +1,22 @@
1
+ <%= form_with(model: justification, local: true) do |form| %>
2
+ <% if justification.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(justification.errors.count, "error") %> prohibited this justification from being saved:</h2>
5
+
6
+ <ul>
7
+ <% justification.errors.full_messages.each do |message| %>
8
+ <li><%= message %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= form.label :documents %>
16
+ <%= form.text_field :documents, id: :justification_documents %>
17
+ </div>
18
+
19
+ <div class="actions">
20
+ <%= form.submit %>
21
+ </div>
22
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing Justification</h1>
2
+
3
+ <%= render 'form', justification: @justification %>
4
+
5
+ <%= link_to 'Show', @justification %> |
6
+ <%= link_to 'Back', justifications_path %>
@@ -0,0 +1,27 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <h1>Justifications</h1>
4
+
5
+ <table>
6
+ <thead>
7
+ <tr>
8
+ <th>Documents</th>
9
+ <th colspan="3"></th>
10
+ </tr>
11
+ </thead>
12
+
13
+ <tbody>
14
+ <% @justifications.each do |justification| %>
15
+ <tr>
16
+ <td><%= justification.documents %></td>
17
+ <td><%= link_to 'Show', justification %></td>
18
+ <td><%= link_to 'Edit', edit_justification_path(justification) %></td>
19
+ <td><%= link_to 'Destroy', justification, method: :delete, data: { confirm: 'Are you sure?' } %></td>
20
+ </tr>
21
+ <% end %>
22
+ </tbody>
23
+ </table>
24
+
25
+ <br>
26
+
27
+ <%= link_to 'New Justification', new_justification_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New Justification</h1>
2
+
3
+ <%= render 'form', justification: @justification %>
4
+
5
+ <%= link_to 'Back', justifications_path %>
@@ -0,0 +1,9 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Documents:</strong>
5
+ <%= @justification.documents %>
6
+ </p>
7
+
8
+ <%= link_to 'Edit', edit_justification_path(@justification) %> |
9
+ <%= link_to 'Back', justifications_path %>
@@ -0,0 +1,43 @@
1
+ <%= form_with(model: position, local: true) do |form| %>
2
+ <% if position.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(position.errors.count, "error") %> prohibited this position from being saved:</h2>
5
+
6
+ <ul>
7
+ <% position.errors.full_messages.each do |message| %>
8
+ <li><%= message %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= form.label :name %>
16
+ <%= form.text_field :name, id: :position_name %>
17
+ </div>
18
+
19
+ <div class="field">
20
+ <%= form.label :description %>
21
+ <%= form.text_area :description, id: :position_description %>
22
+ </div>
23
+
24
+ <div class="field">
25
+ <%= form.label :position_id %>
26
+ <%= form.select :position_id, options_for_select(NextSgad::Position.all.map{|v| [v.name, v.id]}) %>
27
+ </div>
28
+
29
+ <div class="field">
30
+ <%= form.label :department_id %>
31
+ <%= form.select :department_id, options_for_select(NextSgad::Department.all.map{|v| [v.name, v.id]}) %>
32
+ </div>
33
+
34
+ <div class="field">
35
+ <%= form.label :employee_id %>
36
+ <%= form.select :employee_id, options_for_select(NextSgad::Employee.all.map{|v| [v.name, v.id]}) %>
37
+ </div>
38
+
39
+
40
+ <div class="actions">
41
+ <%= form.submit %>
42
+ </div>
43
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing Position</h1>
2
+
3
+ <%= render 'form', position: @position %>
4
+
5
+ <%= link_to 'Show', @position %> |
6
+ <%= link_to 'Back', positions_path %>
@@ -0,0 +1,94 @@
1
+ <!-- <div id="orgchart" data-orgchart-type="1"></div>
2
+ <div id="edit-panel" class="">
3
+ <span id="chart-state-panel" class="radio-panel">
4
+ <input type="radio" name="chart-state" id="rd-view" value="view" checked="true"><label for="rd-view">View</label>
5
+ <input type="radio" name="chart-state" id="rd-edit" value="edit"><label for="rd-edit">Edit</label>
6
+ </span>
7
+ <label class="selected-node-group">selected node:</label>
8
+ <input type="text" id="selected-node" class="selected-node-group">
9
+ <label>new node:</label>
10
+ <ul id="new-nodelist">
11
+ <li><input type="text" class="new-node"></li>
12
+ </ul>
13
+ <i class="fa fa-plus-circle btn-inputs" id="btn-add-input"></i>
14
+ <i class="fa fa-minus-circle btn-inputs" id="btn-remove-input"></i>
15
+ <span id="node-type-panel" class="radio-panel">
16
+ <input type="radio" name="node-type" id="rd-parent" value="parent"><label for="rd-parent">Parent(root)</label>
17
+ <input type="radio" name="node-type" id="rd-child" value="children"><label for="rd-child">Child</label>
18
+ <input type="radio" name="node-type" id="rd-sibling" value="siblings"><label for="rd-sibling">Sibling</label>
19
+ </span>
20
+ <button type="button" id="btn-add-nodes">Add</button>
21
+ <button type="button" id="btn-delete-nodes">Delete</button>
22
+ <button type="button" id="btn-reset">Reset</button>
23
+ </div>
24
+
25
+ <p id="notice"><%= notice %></p> -->
26
+
27
+ <h1>Positions</h1>
28
+
29
+
30
+ <table class="mdl-data-table mdl-js-data-table mdl-shadow--2dp">
31
+ <thead>
32
+ <tr>
33
+ <th class="mdl-data-table__cell--non-numeric">Posição</th>
34
+ <th class="mdl-data-table__cell--non-numeric">Empregado</th>
35
+ <th class="mdl-data-table__cell--non-numeric">Nível</th>
36
+ <th class="mdl-data-table__cell--non-numeric">Escalão</th>
37
+ </tr>
38
+ </thead>
39
+ <tbody>
40
+ <% @positions.each do |position| %>
41
+ <tr>
42
+ <td><%= position.name %></td>
43
+ <td><%= position.description %></td>
44
+ <td><%= position.next_sgad_position&.name %></td>
45
+ <td><%= position.department %></td>
46
+ <td><%= position.employee %></td>
47
+ <td><%= position.number %></td>
48
+ <td><%= link_to 'Show', position %></td>
49
+ <td><%= link_to 'Edit', edit_position_path(position) %></td>
50
+ <td><%= link_to 'Destroy', position, method: :delete, data: { confirm: 'Are you sure?' } %></td>
51
+ </tr>
52
+ <% end %>
53
+ <tr>
54
+ <td class="mdl-data-table__cell--non-numeric"></td>
55
+ <td></td>
56
+ <td></td>
57
+ </tr>
58
+
59
+ </tbody>
60
+ </table>
61
+
62
+
63
+
64
+ <table>
65
+ <thead>
66
+ <tr>
67
+ <th>Name</th>
68
+ <th>Description</th>
69
+ <th>Position</th>
70
+ <th>Department</th>
71
+ <th>Employee</th>
72
+ <th>Number</th>
73
+ <th colspan="3"></th>
74
+ </tr>
75
+ </thead>
76
+
77
+ <tbody>
78
+ <% @positions.each do |position| %>
79
+ <tr>
80
+ <td><%= position.name %></td>
81
+ <td><%= position.description %></td>
82
+ <td><%= position.next_sgad_position&.name %></td>
83
+ <td><%= position.department %></td>
84
+ <td><%= position.employee %></td>
85
+ <td><%= position.number %></td>
86
+ <td><%= link_to 'Show', position %></td>
87
+ <td><%= link_to 'Edit', edit_position_path(position) %></td>
88
+ <td><%= link_to 'Destroy', position, method: :delete, data: { confirm: 'Are you sure?' } %></td>
89
+ </tr>
90
+ <% end %>
91
+ </tbody>
92
+ </table>
93
+
94
+
@@ -0,0 +1,5 @@
1
+ <h1>New Position</h1>
2
+
3
+ <%= render 'form', position: @position %>
4
+
5
+ <%= link_to 'Back', positions_path %>
@@ -0,0 +1 @@
1
+ <div id="orgchart" data-orgchart-type="1"></div>
@@ -0,0 +1,34 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Name:</strong>
5
+ <%= @position.name %>
6
+ </p>
7
+
8
+ <p>
9
+ <strong>Description:</strong>
10
+ <%= @position.description %>
11
+ </p>
12
+
13
+ <p>
14
+ <strong>Position:</strong>
15
+ <%= @position.position_id %>
16
+ </p>
17
+
18
+ <p>
19
+ <strong>Department:</strong>
20
+ <%= @position.department %>
21
+ </p>
22
+
23
+ <p>
24
+ <strong>Employee:</strong>
25
+ <%= @position.employee %>
26
+ </p>
27
+
28
+ <p>
29
+ <strong>Number:</strong>
30
+ <%= @position.number %>
31
+ </p>
32
+
33
+ <%= link_to 'Edit', edit_position_path(@position) %> |
34
+ <%= link_to 'Back', positions_path %>
@@ -0,0 +1,37 @@
1
+ <%= form_with(model: result, local: true) do |form| %>
2
+ <% if result.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(result.errors.count, "error") %> prohibited this result from being saved:</h2>
5
+
6
+ <ul>
7
+ <% result.errors.full_messages.each do |message| %>
8
+ <li><%= message %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= form.label :note %>
16
+ <%= form.text_field :note, id: :result_note %>
17
+ </div>
18
+
19
+ <div class="field">
20
+ <%= form.label :attachment %>
21
+ <%= form.text_field :attachment, id: :result_attachment %>
22
+ </div>
23
+
24
+ <div class="field">
25
+ <%= form.label :state %>
26
+ <%= form.number_field :state, id: :result_state %>
27
+ </div>
28
+
29
+ <div class="field">
30
+ <%= form.label :result_type %>
31
+ <%= form.number_field :result_type, id: :result_result_type %>
32
+ </div>
33
+
34
+ <div class="actions">
35
+ <%= form.submit %>
36
+ </div>
37
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing Result</h1>
2
+
3
+ <%= render 'form', result: @result %>
4
+
5
+ <%= link_to 'Show', @result %> |
6
+ <%= link_to 'Back', results_path %>
@@ -0,0 +1,33 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <h1>Results</h1>
4
+
5
+ <table>
6
+ <thead>
7
+ <tr>
8
+ <th>Note</th>
9
+ <th>Attachment</th>
10
+ <th>State</th>
11
+ <th>Result type</th>
12
+ <th colspan="3"></th>
13
+ </tr>
14
+ </thead>
15
+
16
+ <tbody>
17
+ <% @results.each do |result| %>
18
+ <tr>
19
+ <td><%= result.note %></td>
20
+ <td><%= result.attachment %></td>
21
+ <td><%= result.state %></td>
22
+ <td><%= result.result_type %></td>
23
+ <td><%= link_to 'Show', result %></td>
24
+ <td><%= link_to 'Edit', edit_result_path(result) %></td>
25
+ <td><%= link_to 'Destroy', result, method: :delete, data: { confirm: 'Are you sure?' } %></td>
26
+ </tr>
27
+ <% end %>
28
+ </tbody>
29
+ </table>
30
+
31
+ <br>
32
+
33
+ <%= link_to 'New Result', new_result_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New Result</h1>
2
+
3
+ <%= render 'form', result: @result %>
4
+
5
+ <%= link_to 'Back', results_path %>
@@ -0,0 +1,24 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Note:</strong>
5
+ <%= @result.note %>
6
+ </p>
7
+
8
+ <p>
9
+ <strong>Attachment:</strong>
10
+ <%= @result.attachment %>
11
+ </p>
12
+
13
+ <p>
14
+ <strong>State:</strong>
15
+ <%= @result.state %>
16
+ </p>
17
+
18
+ <p>
19
+ <strong>Result type:</strong>
20
+ <%= @result.result_type %>
21
+ </p>
22
+
23
+ <%= link_to 'Edit', edit_result_path(@result) %> |
24
+ <%= link_to 'Back', results_path %>
@@ -0,0 +1 @@
1
+ # Add initialization content here
@@ -0,0 +1 @@
1
+ # Add initialization content here
@@ -0,0 +1 @@
1
+ # Add initialization content here
@@ -0,0 +1 @@
1
+ # Add initialization content here
data/config/routes.rb ADDED
@@ -0,0 +1,16 @@
1
+ NextSgad::Engine.routes.draw do
2
+ resources :activities
3
+ resources :results
4
+ resources :justifications
5
+ resources :attendances
6
+ resources :functions
7
+ resources :employee_goals
8
+ resources :goals
9
+ resources :assessments
10
+ resources :configurations
11
+ resources :positions
12
+ resources :employees
13
+ resources :departments
14
+
15
+ get 'positions/orgchart', 'positions#orgchart'
16
+ end
@@ -0,0 +1,11 @@
1
+ class CreateNextSgadDepartments < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :next_sgad_departments do |t|
4
+ t.string :name
5
+ t.text :description
6
+ t.string :number
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ class CreateNextSgadEmployees < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :next_sgad_employees do |t|
4
+ t.string :name
5
+ t.string :number
6
+ t.integer :level
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ class CreateNextSgadPositions < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :next_sgad_positions do |t|
4
+ t.string :name
5
+ t.text :description
6
+ t.string :number
7
+ t.references :next_sgad_department, foreign_key: true, index: true
8
+ t.references :next_sgad_employee, foreign_key: true, index: true
9
+
10
+ t.timestamps
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ class CreateNextSgadConfigurations < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :next_sgad_configurations do |t|
4
+ t.string :name
5
+ t.text :description
6
+ t.string :version
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,6 @@
1
+ class AddNextSgadDepartmentToDepartment < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_reference :next_sgad_departments, :next_sgad_department, foreign_key: true, index: true
4
+ add_reference :next_sgad_positions, :next_sgad_position, foreign_key: true, index: true
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ class RemoveTableConfigurations < ActiveRecord::Migration[5.1]
2
+ def change
3
+ drop_table :next_sgad_configurations
4
+ end
5
+ end
@@ -0,0 +1,11 @@
1
+ class CreateNextSgadSettings < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :next_sgad_settings do |t|
4
+ t.string :name
5
+ t.string :description
6
+ t.string :version
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,6 @@
1
+ class AddPaygradeToNextSgadEmployee < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :next_sgad_employees, :paygrade, :string
4
+ add_column :next_sgad_employees, :avatar, :string
5
+ end
6
+ end
@@ -0,0 +1,10 @@
1
+ class CreateNextSgadAssessments < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :next_sgad_assessments do |t|
4
+ t.string :year
5
+ t.integer :state, default: 0, null: false
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,18 @@
1
+ class CreateNextSgadGoals < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :next_sgad_goals do |t|
4
+ t.string :name
5
+ t.integer :goal_type, default: 0, null: false
6
+ t.integer :state, default: 0, null: false
7
+ t.integer :nature, default: 0, null: false
8
+ t.integer :unit, default: 0, null: false
9
+ t.float :target, default: 0, null: false
10
+ t.float :percentage_on_the_type, default: 0, null: false
11
+ t.float :percentage, default: 0, null: false
12
+
13
+ t.timestamps
14
+ end
15
+
16
+ add_reference :next_sgad_goals, :assessment, foreign_key: {to_table: :next_sgad_assessments}, index: true
17
+ end
18
+ end
@@ -0,0 +1,16 @@
1
+ class CreateNextSgadEmployeeGoals < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :next_sgad_employee_goals do |t|
4
+ t.integer :self_assessment, default: 0, null: false
5
+ t.integer :supervisor_assessment, default: 0, null: false
6
+ t.integer :final_assessment, default: 0, null: false
7
+ t.integer :state, default: 0, null: false
8
+ t.float :percentage, default: 0, null: false
9
+
10
+ t.timestamps
11
+ end
12
+ add_reference :next_sgad_employee_goals, :assessment, foreign_key: {to_table: :next_sgad_assessments}, index: true
13
+ add_reference :next_sgad_employee_goals, :goal, foreign_key: {to_table: :next_sgad_goals}, index: true
14
+ add_reference :next_sgad_employee_goals, :employee, foreign_key: {to_table: :next_sgad_employees}, index: true
15
+ end
16
+ end
@@ -0,0 +1,8 @@
1
+ class CorrectsReferences < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_reference :next_sgad_departments, :department, foreign_key: {to_table: :next_sgad_departments}, index: true
4
+ add_reference :next_sgad_positions, :position, foreign_key: {to_table: :next_sgad_positions}, index: true
5
+ add_reference :next_sgad_positions, :department, foreign_key: {to_table: :next_sgad_departments}, index: true
6
+ add_reference :next_sgad_positions, :employee, foreign_key: {to_table: :next_sgad_employees}, index: true
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ class CopiesInfoFromOldReferences < ActiveRecord::Migration[5.1]
2
+ def change
3
+ NextSgad::Department.all.each{|d| d.update_columns(department_id: d.next_sgad_department_id)}
4
+ NextSgad::Position.all.each{|d| d.update_columns(position_id: d.next_sgad_position_id)}
5
+ NextSgad::Position.all.each{|d| d.update_columns(department_id: d.next_sgad_department_id)}
6
+ NextSgad::Position.all.each{|d| d.update_columns(employee_id: d.next_sgad_employee_id)}
7
+ end
8
+ end
@@ -0,0 +1,6 @@
1
+ class ChangeColumnYearFromAssessments < ActiveRecord::Migration[5.1]
2
+ def change
3
+ remove_column :next_sgad_assessments, :year
4
+ add_column :next_sgad_assessments, :year, :integer, null: false
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ class AddGoalTypeToEmployeeGoals < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :next_sgad_employee_goals, :unit, :integer, default: 0, null: false
4
+ add_column :next_sgad_employee_goals, :goal_type, :integer, default: 0, null: false
5
+ add_column :next_sgad_employee_goals, :nature, :integer, default: 0, null: false
6
+ add_column :next_sgad_employee_goals, :target, :float, default: 0, null: false
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ class AddnameToNextSgadEmployeeGoals < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :next_sgad_employee_goals, :name, :string
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ class AddPositionReferenceToGoals < ActiveRecord::Migration[5.1]
2
+ def change
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ class AddPositionToNextSgadGoals < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_reference :next_sgad_goals, :position, foreign_key: {to_table: :next_sgad_positions}, index: true
4
+ end
5
+ end