rails_attend 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (214) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +20 -0
  3. data/README.md +22 -0
  4. data/Rakefile +32 -0
  5. data/app/controllers/attend/admin/absence_stats_controller.rb +60 -0
  6. data/app/controllers/attend/admin/absences_controller.rb +77 -0
  7. data/app/controllers/attend/admin/attendance_logs_controller.rb +103 -0
  8. data/app/controllers/attend/admin/attendance_settings_controller.rb +86 -0
  9. data/app/controllers/attend/admin/attendance_stats_controller.rb +58 -0
  10. data/app/controllers/attend/admin/attendances_controller.rb +57 -0
  11. data/app/controllers/attend/admin/base_controller.rb +4 -0
  12. data/app/controllers/attend/admin/extra_days_controller.rb +63 -0
  13. data/app/controllers/attend/admin/financial_months_controller.rb +69 -0
  14. data/app/controllers/attend/admin/overtimes_controller.rb +59 -0
  15. data/app/controllers/attend/me/absences_controller.rb +71 -0
  16. data/app/controllers/attend/me/attendance_logs_controller.rb +74 -0
  17. data/app/controllers/attend/me/attendance_settings_controller.rb +52 -0
  18. data/app/controllers/attend/me/attendance_stats_controller.rb +27 -0
  19. data/app/controllers/attend/me/attendances_controller.rb +43 -0
  20. data/app/controllers/attend/me/base_controller.rb +4 -0
  21. data/app/controllers/attend/me/calendars_controller.rb +33 -0
  22. data/app/controllers/attend/me/overtimes_controller.rb +65 -0
  23. data/app/javascript/packs/controllers/attend/admin/attendance_logs/index.js +1 -0
  24. data/app/javascript/packs/controllers/attend/admin/attendance_logs/my.js +14 -0
  25. data/app/javascript/packs/controllers/attend/admin/attendance_settings/create.js +1 -0
  26. data/app/javascript/packs/controllers/attend/admin/attendance_settings/index.js +1 -0
  27. data/app/javascript/packs/controllers/attend/admin/attendance_settings/my.js +13 -0
  28. data/app/javascript/packs/controllers/attend/admin/attendance_settings/new.js +11 -0
  29. data/app/javascript/packs/controllers/attend/me/absences/new.js +16 -0
  30. data/app/javascript/packs/controllers/attend/me/absences/update.js +3 -0
  31. data/app/javascript/packs/controllers/attend/me/attendance_settings/create.js +1 -0
  32. data/app/javascript/packs/controllers/attend/me/attendance_settings/edit.js +1 -0
  33. data/app/javascript/packs/controllers/attend/me/attendance_settings/new.js +2 -0
  34. data/app/javascript/packs/controllers/attend/me/calendars/show.js +48 -0
  35. data/app/jobs/attendance_job.rb +14 -0
  36. data/app/models/absence/attend/annual_leave.rb +5 -0
  37. data/app/models/absence/attend/bereavement_leave.rb +5 -0
  38. data/app/models/absence/attend/business_trip.rb +5 -0
  39. data/app/models/absence/attend/children_day_leave.rb +5 -0
  40. data/app/models/absence/attend/compensatory_leave.rb +5 -0
  41. data/app/models/absence/attend/marriage_leave.rb +4 -0
  42. data/app/models/absence/attend/maternity_leave.rb +5 -0
  43. data/app/models/absence/attend/parental_leave.rb +5 -0
  44. data/app/models/absence/attend/personal_leave.rb +5 -0
  45. data/app/models/absence/attend/prenatal_leave.rb +4 -0
  46. data/app/models/absence/attend/sick_leave.rb +5 -0
  47. data/app/models/absence/attend/vacation_leave.rb +5 -0
  48. data/app/models/absence/attend/welfare_leave.rb +5 -0
  49. data/app/models/attend/absence.rb +5 -0
  50. data/app/models/attend/absence_stat.rb +5 -0
  51. data/app/models/attend/application_record.rb +5 -0
  52. data/app/models/attend/attendance.rb +5 -0
  53. data/app/models/attend/attendance_log.rb +5 -0
  54. data/app/models/attend/attendance_setting.rb +5 -0
  55. data/app/models/attend/attendance_stat.rb +5 -0
  56. data/app/models/attend/ext/member.rb +33 -0
  57. data/app/models/attend/extra_day.rb +5 -0
  58. data/app/models/attend/financial_month.rb +5 -0
  59. data/app/models/attend/model/absence/business_trip.rb +10 -0
  60. data/app/models/attend/model/absence/compensatory_leave.rb +5 -0
  61. data/app/models/attend/model/absence/personal_leave.rb +5 -0
  62. data/app/models/attend/model/absence/welfare_leave/annual_leave.rb +16 -0
  63. data/app/models/attend/model/absence/welfare_leave/vacation_leave.rb +16 -0
  64. data/app/models/attend/model/absence/welfare_leave.rb +5 -0
  65. data/app/models/attend/model/absence.rb +208 -0
  66. data/app/models/attend/model/absence_stat.rb +17 -0
  67. data/app/models/attend/model/attendance.rb +314 -0
  68. data/app/models/attend/model/attendance_log.rb +165 -0
  69. data/app/models/attend/model/attendance_setting.rb +61 -0
  70. data/app/models/attend/model/attendance_stat.rb +104 -0
  71. data/app/models/attend/model/extra_day.rb +21 -0
  72. data/app/models/attend/model/financial_month.rb +114 -0
  73. data/app/models/attend/model/overtime.rb +93 -0
  74. data/app/models/attend/overtime.rb +5 -0
  75. data/app/models/attend.rb +11 -0
  76. data/app/models/concerns/absent.rb +103 -0
  77. data/app/views/admin/_attend_nav.html.erb +15 -0
  78. data/app/views/attend/admin/absence_stats/_filter_form.html.erb +9 -0
  79. data/app/views/attend/admin/absence_stats/_form.html.erb +12 -0
  80. data/app/views/attend/admin/absence_stats/_index_tbody.html.erb +3 -0
  81. data/app/views/attend/admin/absence_stats/_index_thead.html.erb +4 -0
  82. data/app/views/attend/admin/absence_stats/index.html.erb +5 -0
  83. data/app/views/attend/admin/absences/_absence.html.erb +38 -0
  84. data/app/views/attend/admin/absences/_edit_form.html.erb +3 -0
  85. data/app/views/attend/admin/absences/_filter_form.html.erb +8 -0
  86. data/app/views/attend/admin/absences/_form.html.erb +5 -0
  87. data/app/views/attend/admin/absences/_index_tbody.html.erb +18 -0
  88. data/app/views/attend/admin/absences/_index_thead.html.erb +10 -0
  89. data/app/views/attend/admin/absences/_new_form.html.erb +3 -0
  90. data/app/views/attend/admin/absences/_show.html.erb +11 -0
  91. data/app/views/attend/admin/absences/index.html.erb +5 -0
  92. data/app/views/attend/admin/absences/my.html.erb +5 -0
  93. data/app/views/attend/admin/attendance_logs/_edit_form.html.erb +5 -0
  94. data/app/views/attend/admin/attendance_logs/_filter_form.html.erb +11 -0
  95. data/app/views/attend/admin/attendance_logs/_form.html.erb +6 -0
  96. data/app/views/attend/admin/attendance_logs/_index_thead.html.erb +19 -0
  97. data/app/views/attend/admin/attendance_logs/_list.html.erb +61 -0
  98. data/app/views/attend/admin/attendance_logs/_new_form.html.erb +3 -0
  99. data/app/views/attend/admin/attendance_logs/index.html.erb +5 -0
  100. data/app/views/attend/admin/attendance_logs/my.html.erb +5 -0
  101. data/app/views/attend/admin/attendance_settings/_button.html.erb +4 -0
  102. data/app/views/attend/admin/attendance_settings/_filter_form.html.erb +11 -0
  103. data/app/views/attend/admin/attendance_settings/_form.html.erb +7 -0
  104. data/app/views/attend/admin/attendance_settings/_index_tbody.html.erb +15 -0
  105. data/app/views/attend/admin/attendance_settings/_index_thead.html.erb +10 -0
  106. data/app/views/attend/admin/attendance_settings/_new_form.html.erb +8 -0
  107. data/app/views/attend/admin/attendance_settings/_show_table.html.erb +12 -0
  108. data/app/views/attend/admin/attendance_settings/index.html.erb +5 -0
  109. data/app/views/attend/admin/attendance_settings/my.html.erb +5 -0
  110. data/app/views/attend/admin/attendance_stats/_filter_form.html.erb +10 -0
  111. data/app/views/attend/admin/attendance_stats/_form.html.erb +6 -0
  112. data/app/views/attend/admin/attendance_stats/_index_thead.html.erb +10 -0
  113. data/app/views/attend/admin/attendance_stats/index.html.erb +44 -0
  114. data/app/views/attend/admin/attendances/_button.html.erb +2 -0
  115. data/app/views/attend/admin/attendances/_filter_form.html.erb +10 -0
  116. data/app/views/attend/admin/attendances/_form.html.erb +23 -0
  117. data/app/views/attend/admin/attendances/_index_tbody.html.erb +61 -0
  118. data/app/views/attend/admin/attendances/_index_thead.html.erb +22 -0
  119. data/app/views/attend/admin/attendances/_new_form.html.erb +4 -0
  120. data/app/views/attend/admin/attendances/index.html.erb +7 -0
  121. data/app/views/attend/admin/base/_financial_month_menu.html.erb +10 -0
  122. data/app/views/attend/admin/base/_nav.html.erb +3 -0
  123. data/app/views/attend/admin/base/_nav_attendances.html.erb +7 -0
  124. data/app/views/attend/admin/extra_days/_breadcrumb.html.erb +0 -0
  125. data/app/views/attend/admin/extra_days/_edit_form.html.erb +4 -0
  126. data/app/views/attend/admin/extra_days/_filter_form.html.erb +5 -0
  127. data/app/views/attend/admin/extra_days/_form.html.erb +4 -0
  128. data/app/views/attend/admin/extra_days/_index_tbody.html.erb +3 -0
  129. data/app/views/attend/admin/extra_days/_index_thead.html.erb +4 -0
  130. data/app/views/attend/admin/extra_days/_new_form.html.erb +4 -0
  131. data/app/views/attend/admin/extra_days/index.html.erb +7 -0
  132. data/app/views/attend/admin/financial_months/_breadcrumb.html.erb +0 -0
  133. data/app/views/attend/admin/financial_months/_edit_form.html.erb +4 -0
  134. data/app/views/attend/admin/financial_months/_filter_form.html.erb +9 -0
  135. data/app/views/attend/admin/financial_months/_form.html.erb +4 -0
  136. data/app/views/attend/admin/financial_months/_index_tbody.html.erb +9 -0
  137. data/app/views/attend/admin/financial_months/_index_thead.html.erb +6 -0
  138. data/app/views/attend/admin/financial_months/_new_form.html.erb +4 -0
  139. data/app/views/attend/admin/financial_months/events.json.jbuilder +9 -0
  140. data/app/views/attend/admin/financial_months/index.html.erb +7 -0
  141. data/app/views/attend/admin/financial_months/index.js +60 -0
  142. data/app/views/attend/admin/financial_months/show.html.erb +10 -0
  143. data/app/views/attend/admin/overtimes/_button.html.erb +0 -0
  144. data/app/views/attend/admin/overtimes/_edit_form.html.erb +4 -0
  145. data/app/views/attend/admin/overtimes/_filter_form.html.erb +8 -0
  146. data/app/views/attend/admin/overtimes/_form.html.erb +3 -0
  147. data/app/views/attend/admin/overtimes/_index_tbody.html.erb +22 -0
  148. data/app/views/attend/admin/overtimes/_index_thead.html.erb +9 -0
  149. data/app/views/attend/admin/overtimes/_new_form.html.erb +4 -0
  150. data/app/views/attend/admin/overtimes/index.html.erb +5 -0
  151. data/app/views/attend/admin/overtimes/my.html.erb +8 -0
  152. data/app/views/attend/me/absences/_absence.html.erb +34 -0
  153. data/app/views/attend/me/absences/_edit_form.html.erb +3 -0
  154. data/app/views/attend/me/absences/_filter_form.html.erb +11 -0
  155. data/app/views/attend/me/absences/_form.html.erb +33 -0
  156. data/app/views/attend/me/absences/_index_tbody.html.erb +24 -0
  157. data/app/views/attend/me/absences/_index_thead.html.erb +8 -0
  158. data/app/views/attend/me/absences/_new_form.html.erb +3 -0
  159. data/app/views/attend/me/absences/_redeeming_form.html.erb +5 -0
  160. data/app/views/attend/me/absences/_show.html.erb +11 -0
  161. data/app/views/attend/me/absences/dashboard.html.erb +44 -0
  162. data/app/views/attend/me/absences/index.html.erb +7 -0
  163. data/app/views/attend/me/absences/redeeming.js.erb +6 -0
  164. data/app/views/attend/me/absences/show.html.erb +1 -0
  165. data/app/views/attend/me/attendance_logs/_edit_form.html.erb +4 -0
  166. data/app/views/attend/me/attendance_logs/_filter_form.html.erb +11 -0
  167. data/app/views/attend/me/attendance_logs/_form.html.erb +11 -0
  168. data/app/views/attend/me/attendance_logs/_index_thead.html.erb +9 -0
  169. data/app/views/attend/me/attendance_logs/_new_form.html.erb +4 -0
  170. data/app/views/attend/me/attendance_logs/index.html.erb +42 -0
  171. data/app/views/attend/me/attendance_settings/_edit_form.html.erb +6 -0
  172. data/app/views/attend/me/attendance_settings/_index_tbody.html.erb +15 -0
  173. data/app/views/attend/me/attendance_settings/_index_thead.html.erb +12 -0
  174. data/app/views/attend/me/attendance_settings/_new_form.html.erb +8 -0
  175. data/app/views/attend/me/attendance_settings/index.html.erb +5 -0
  176. data/app/views/attend/me/attendance_stats/_form.html.erb +6 -0
  177. data/app/views/attend/me/attendance_stats/_search_form.html.erb +5 -0
  178. data/app/views/attend/me/attendance_stats/edit.html.erb +9 -0
  179. data/app/views/attend/me/attendance_stats/index.html.erb +49 -0
  180. data/app/views/attend/me/attendance_stats/new.html.erb +9 -0
  181. data/app/views/attend/me/attendance_stats/show.html.erb +28 -0
  182. data/app/views/attend/me/attendances/_button.html.erb +3 -0
  183. data/app/views/attend/me/attendances/_filter_form.html.erb +9 -0
  184. data/app/views/attend/me/attendances/_form.html.erb +22 -0
  185. data/app/views/attend/me/attendances/_index_tbody.html.erb +49 -0
  186. data/app/views/attend/me/attendances/_index_thead.html.erb +19 -0
  187. data/app/views/attend/me/attendances/index.html.erb +7 -0
  188. data/app/views/attend/me/base/_menu.html.erb +8 -0
  189. data/app/views/attend/me/base/_nav_absences.html.erb +9 -0
  190. data/app/views/attend/me/base/_nav_attendances.html.erb +10 -0
  191. data/app/views/attend/me/calendars/events.json.jbuilder +19 -0
  192. data/app/views/attend/me/calendars/show.html.erb +12 -0
  193. data/app/views/attend/me/overtimes/_edit_form.html.erb +4 -0
  194. data/app/views/attend/me/overtimes/_filter_form.html.erb +9 -0
  195. data/app/views/attend/me/overtimes/_form.html.erb +16 -0
  196. data/app/views/attend/me/overtimes/_index_tbody.html.erb +23 -0
  197. data/app/views/attend/me/overtimes/_index_thead.html.erb +6 -0
  198. data/app/views/attend/me/overtimes/_new_form.html.erb +4 -0
  199. data/app/views/attend/me/overtimes/index.html.erb +7 -0
  200. data/app/views/me/_attend_nav.html.erb +12 -0
  201. data/app/views/me/_nav_attendance_settings.html.erb +8 -0
  202. data/config/locales/en.attributes.yml +34 -0
  203. data/config/locales/en.controller.yml +18 -0
  204. data/config/locales/en.enum.yml +43 -0
  205. data/config/locales/en.notify.yml +38 -0
  206. data/config/locales/zh.attributes.yml +34 -0
  207. data/config/locales/zh.controller.yml +40 -0
  208. data/config/locales/zh.enum.yml +43 -0
  209. data/config/locales/zh.notify.yml +38 -0
  210. data/config/routes.rb +70 -0
  211. data/lib/rails_attend/config.rb +11 -0
  212. data/lib/rails_attend/engine.rb +25 -0
  213. data/lib/rails_attend.rb +2 -0
  214. metadata +269 -0
@@ -0,0 +1,12 @@
1
+ <%= search_form_with model: Member.new do |f| %>
2
+ <div class="inline fields">
3
+ <%= render partial: 'nodes/outer_search', locals: { f: f, node: @department } %>
4
+ </div>
5
+ <div class="fields">
6
+ <%= f.submit class: 'ui green small button' %>
7
+ </div>
8
+ <% end %>
9
+
10
+ <div class="ui segment">
11
+ <div id='calendar' data-department-id="<%= @department.id %>"></div>
12
+ </div>
@@ -0,0 +1,4 @@
1
+ <%= form_with model: @overtime, scope: :overtime, url: { action: 'update' } do |f| %>
2
+ <%= render partial: 'form', locals: {f: f} %>
3
+ <%= f.submit %>
4
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <%= form_with theme: 'search', model: Attend::Overtime.new do |f| %>
2
+ <div class="field-body">
3
+ <%= f.date_field 'start_at-gte' %>
4
+ <%= f.date_field 'finish_at-lte' %>
5
+ <div class="field is-narrow">
6
+ <%= f.submit %>
7
+ </div>
8
+ </div>
9
+ <% end %>
@@ -0,0 +1,16 @@
1
+ <%= render 'error_messages', target: @overtime %>
2
+ <div class="field is-horizontal">
3
+ <%= f.label :start_at %>
4
+ <div class="field-body control">
5
+ <%= f.date_field 'start_at(date)', wrap: { input: false, all: false }, label: false, required: true %>
6
+ <%= f.time_select :start_at, start_hour: 8, end_hour: 18, minute_step: 30, default: { hour: 8, min: 30 }, label: nil, wrap: { select: 'select' } %>
7
+ </div>
8
+ </div>
9
+ <div class="field is-horizontal">
10
+ <%= f.label :finish_at %>
11
+ <div class="field-body control">
12
+ <%= f.date_field 'finish_at(date)', wrap: { input: false, all: false }, label: false, required: true %>
13
+ <%= f.time_select :finish_at, start_hour: 8, end_hour: 18, minute_step: 30, default: { hour: 17, min: 30 }, label: nil, wrap: { select: 'select' } %>
14
+ </div>
15
+ </div>
16
+ <%= f.text_area :note %>
@@ -0,0 +1,23 @@
1
+ <td>
2
+ <time data-controller="time" data-format="YYYY-MM-DD HH:mm"><%= overtime.start_at.to_s(:rfc822) %></time>
3
+ </td>
4
+ <td>
5
+ <time data-controller="time" data-format="YYYY-MM-DD HH:mm"><%= overtime.finish_at.to_s(:rfc822) %></time>
6
+ </td>
7
+ <td><%= simple_format overtime.note %></td>
8
+ <td><%= overtime.hours %></td>
9
+ <td>
10
+ <% if overtime.init? %>
11
+ <span class="ui label"><%= overtime.state_i18n %></span>
12
+ <% elsif overtime.approved? %>
13
+ <span class="ui green label"><%= overtime.state_i18n %></span>
14
+ <% elsif overtime.denied? %>
15
+ <span class="ui red label"><%= overtime.state_i18n %></span>
16
+ <% end %>
17
+ </td>
18
+ <td class="ui labels">
19
+ <% unless overtime.approved? %>
20
+ <%= link_to t('.edit'), edit_me_overtime_path(overtime), class: 'ui pink label' %>
21
+ <%= link_to t('.destroy'), me_overtime_path(overtime), method: :delete, data: { confirm: t('.confirm') }, class: 'ui red label' %>
22
+ <% end %>
23
+ </td>
@@ -0,0 +1,6 @@
1
+ <th><%= Attend::Overtime.human_attribute_name(:start_at) %></th>
2
+ <th><%= Attend::Overtime.human_attribute_name(:finish_at) %></th>
3
+ <th><%= Attend::Overtime.human_attribute_name(:note) %></th>
4
+ <th><%= Attend::Overtime.human_attribute_name(:hours) %></th>
5
+ <th><%= Attend::Overtime.human_attribute_name(:state) %></th>
6
+ <th></th>
@@ -0,0 +1,4 @@
1
+ <%= form_with model: @overtime, url: { action: 'create' } do |f| %>
2
+ <%= render partial: 'form', locals: { f: f } %>
3
+ <%= f.submit %>
4
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%= render 'menu' %>
2
+
3
+ <%= render layout: 'index_table', locals: { cache_key: Attend::Overtime.column_names.hash } do %>
4
+ <%= render partial: 'index_tbody', layout: 'index_tr', collection: @overtimes, as: :model %>
5
+ <% end %>
6
+
7
+ <%= paginate @overtimes %>
@@ -0,0 +1,12 @@
1
+ <div class="menu-label">
2
+ <span><%= t('attend.me.title') %></span>
3
+ <%= link_to({ controller: 'attend/admin/financial_months' }, aria: { label: '管理' }) do %>
4
+ <i class="fas fa-cog"></i>
5
+ <% end %>
6
+ </div>
7
+ <div class="menu-list">
8
+ <%= link_to t('attend.me.attendance_settings.index.title'), { controller: 'attend/me/attendance_settings' }, class: active_helper(controllers: 'attendance_settings', active: 'is-active') %>
9
+ <%= link_to t('attend.me.attendances.index.title'), { controller: 'attend/me/attendances' }, class: active_helper(controllers: ['attendances', 'attendance_stats', 'attendance_logs'], active: 'is-active') %>
10
+ <%= link_to t('attend.me.absences.index.title'), { controller: 'attend/me/absences' }, class: active_helper(controllers: ['absences'], active: 'is-active') %>
11
+ <%= link_to t('attend.me.overtimes.index.title'), { controller: 'attend/me/overtimes' }, class: active_helper(controllers: ['overtimes'], active: 'is-active') %>
12
+ </div>
@@ -0,0 +1,8 @@
1
+ <% content_for :breadcrumb do %>
2
+ <div class="tabs">
3
+ <ul>
4
+ <li><%= link_to t('attend.me.attendance_settings.index.title'), me_attendance_settings_path, class: active_helper(controllers: 'attend/my/attendance_settings') %></li>
5
+ <li><%# link_to 'Group Attendance Settings', me_admin_attendance_settings_path, class: active_helper('my_admin/attendance_settings': ['my']) %></li>
6
+ </ul>
7
+ </div>
8
+ <% end %>
@@ -0,0 +1,34 @@
1
+ en:
2
+ activerecord:
3
+ attributes:
4
+ absence:
5
+ hours: Hours
6
+ member: Employee
7
+ member_name: Name
8
+ state_i18n: Status
9
+ type_i18n: Type
10
+ start_at: Start At
11
+ finish_at: Finish At
12
+ note: Note
13
+ attendance:
14
+ member: Employee
15
+ start_at: Start
16
+ finish_at: Leave
17
+ interval_start_at: Interval start
18
+ interval_finish_at: Interval Finish
19
+ total_hours: Total
20
+ late_minutes: Late
21
+ leave_minutes: Leave
22
+ overtime_hours: Overtime
23
+ attendance_log:
24
+ member_name: Name
25
+ record_at: Record At
26
+ note: Note
27
+ state_i18n: Status
28
+ overtime:
29
+ member: Employee
30
+ member_name: Name
31
+ start_at: Start At
32
+ finish_at: Finish At
33
+ state_i18n: Status
34
+ hours: Hours
@@ -0,0 +1,18 @@
1
+ en:
2
+ attend:
3
+ admin:
4
+ title: Attendance Admin
5
+ extra_days:
6
+ index:
7
+ title: Workday & Holiday
8
+ me:
9
+ title: 出勤管理
10
+ attendance_settings:
11
+ index:
12
+ title: Attendance Setting
13
+ absences:
14
+ index:
15
+ title: Holiday application
16
+ overtimes:
17
+ index:
18
+ title: Work Overtime
@@ -0,0 +1,43 @@
1
+ en:
2
+ activerecord:
3
+ enum:
4
+ absence:
5
+ compensatory:
6
+ never: Never Compensatory Work
7
+ previous: Pre Compensatory Work
8
+ later: Later Compensatory Work
9
+ state:
10
+ init: Pending
11
+ approved: Approved
12
+ denied: Rejected
13
+ type:
14
+ BusinessTrip: Business Trip
15
+ PersonalLeave: Personal Leave
16
+ AnnualLeave: Annual Leave
17
+ CompensatoryLeave: Adjustment(Weekend/Holiday)
18
+ BereavementLeave: Bereavement Leave
19
+ ChildrenDayLeave: Children's Day
20
+ MarriageLeave: Marriage Leave
21
+ MaternityLeave: Maternity Leave
22
+ ParentalLeave: Parental Leave
23
+ PrenatalLeave: Prenatal Leave
24
+ SickLeave: Sick Leave
25
+ attendance:
26
+ kind:
27
+ start: Start
28
+ finish: Finish
29
+ status:
30
+ init: Pending
31
+ attendance_setting:
32
+ state:
33
+ init: Pending
34
+ approved: Approved
35
+ extra_day:
36
+ kind:
37
+ workday: Workday
38
+ holiday: Holiday
39
+ overtime:
40
+ state:
41
+ init: Pending
42
+ approved: Approved
43
+ denied: Rejected
@@ -0,0 +1,38 @@
1
+ en:
2
+ activerecord:
3
+ notify:
4
+ absence:
5
+ request:
6
+ title: '%{member_name} has requested %{type_i18n}'
7
+ body: '%{member_name} has requested %{type_i18n}'
8
+ default:
9
+ title: Your leave request has been %{state_i18n}
10
+ body: Your leave request has been %{state_i18n}
11
+ attendance_log:
12
+ request:
13
+ title: '%{member_name} has requested re-punch'
14
+ body: '%{member_name} has requested re-punch'
15
+ default:
16
+ title: Your attendance log request has been %{state_i18n}
17
+ body: Your attendance log request has been %{state_i18n}
18
+ expense:
19
+ request:
20
+ title: An expense request need your approve!
21
+ body: An expense request need your approve!
22
+ default:
23
+ title: Your expense request has been %{state_i18n}
24
+ body: Your expense request has been %{state_i18n}
25
+ expense_member:
26
+ request:
27
+ title: An expense request need your approve!
28
+ body: An expense request need your approve!
29
+ default:
30
+ title: Your expense request has been %{state_i18n}
31
+ body: Your expense request has been %{state_i18n}
32
+ overtime:
33
+ request:
34
+ title: '%{member_name} has requested Work overtime'
35
+ body: '%{member_name} has requested Work overtime'
36
+ default:
37
+ title: Your work overtime request has been %{state_i18n}
38
+ body: Your work overtime request has been %{state_i18n}
@@ -0,0 +1,34 @@
1
+ zh:
2
+ activerecord:
3
+ attributes:
4
+ attend/absence:
5
+ hours: 时长(小时)
6
+ member: 职员
7
+ member_name: 姓名
8
+ type_i18n: 类别
9
+ state_i18n: 状态
10
+ start_at: 开始时间
11
+ finish_at: 结束时间
12
+ note: 说明
13
+ attend/attendance:
14
+ member: 职员
15
+ start_at: Start
16
+ finish_at: Leave
17
+ interval_start_at: Interval Leave start
18
+ interval_finish_at: Finish
19
+ total_hours: Total
20
+ late_minutes: Late
21
+ leave_minutes: Leave
22
+ overtime_hours: Overtime
23
+ attend/attendance_log:
24
+ member_name: 姓名
25
+ record_at: 时间
26
+ note: 说明
27
+ state_i18n: 状态
28
+ attend/overtime:
29
+ member: 职员
30
+ member_name: 姓名
31
+ start_at: 开始时间
32
+ finish_at: 结束时间
33
+ state_i18n: 状态
34
+ hours: 时长(小时)
@@ -0,0 +1,40 @@
1
+ zh:
2
+ attend:
3
+ title: 出勤
4
+ admin:
5
+ title: 出勤
6
+ financial_months:
7
+ index:
8
+ title: 月度设置
9
+ attendances:
10
+ index:
11
+ title: 出勤
12
+ attendance_settings:
13
+ index:
14
+ title: 打卡设置
15
+ absences:
16
+ index:
17
+ title: 缺席/请假
18
+ absence_stats:
19
+ index:
20
+ title: 缺席统计
21
+ extra_days:
22
+ index:
23
+ title: 工作日设置
24
+ overtimes:
25
+ index:
26
+ title: 加班统计
27
+ me:
28
+ title: 出勤管理
29
+ attendance_settings:
30
+ index:
31
+ title: 出勤设置
32
+ attendances:
33
+ index:
34
+ title: 出勤统计
35
+ absences:
36
+ index:
37
+ title: 请假/外出
38
+ overtimes:
39
+ index:
40
+ title: 加班
@@ -0,0 +1,43 @@
1
+ zh:
2
+ activerecord:
3
+ enum:
4
+ attend/absence:
5
+ compensatory:
6
+ never: 不补班
7
+ previous: 提前补班
8
+ later: 补班
9
+ type:
10
+ Attend::BusinessTrip: 出差
11
+ Attend::PersonalLeave: 事假
12
+ Attend::AnnualLeave: 年假
13
+ Attend::CompensatoryLeave: 调休
14
+ Attend::BereavementLeave: 丧假
15
+ Attend::ChildrenDayLeave: 儿童日
16
+ Attend::MarriageLeave: 婚假
17
+ Attend::MaternityLeave: 产假
18
+ Attend::ParentalLeave: 陪产假
19
+ Attend::PrenatalLeave: 产前假
20
+ Attend::SickLeave: 病假
21
+ state:
22
+ init: 申请
23
+ approved: 批准
24
+ denied: 拒绝
25
+ attend/attendance:
26
+ kind:
27
+ start: Start
28
+ finish: Finish
29
+ status:
30
+ init: Pending
31
+ attend/attendance_setting:
32
+ state:
33
+ init: Pending
34
+ approved: Approved
35
+ attend/extra_day:
36
+ kind:
37
+ workday: 工作日
38
+ holiday: 假日
39
+ attend/overtime:
40
+ state:
41
+ init: 申请
42
+ approved: 批准
43
+ denied: 拒绝
@@ -0,0 +1,38 @@
1
+ zh:
2
+ activerecord:
3
+ notify:
4
+ absence:
5
+ request:
6
+ title: '%{member_name}申请%{type_i18n}'
7
+ body: '%{member_name}申请%{type_i18n}'
8
+ default:
9
+ title: 你的请假申请已被%{state_i18n}
10
+ body: 你的请假申请已被%{state_i18n}
11
+ attendance_log:
12
+ request:
13
+ title: '%{member_name} has requested re-punch'
14
+ body: '%{member_name} has requested re-punch'
15
+ default:
16
+ title: Your Attendance log request has been %{state_i18n}
17
+ body: Your Attendance log request has been %{state_i18n}
18
+ expense:
19
+ request:
20
+ title: A Expense request need your approve!
21
+ body: A Expense request need your approve!
22
+ default:
23
+ title: Your Expense request has been %{state_i18n}
24
+ body: Your Expense request has been %{state_i18n}
25
+ expense_member:
26
+ request:
27
+ title: A Expense request need your approve!
28
+ body: A Expense request need your approve!
29
+ default:
30
+ title: Your Expense request has been %{state_i18n}
31
+ body: Your Expense request has been %{state_i18n}
32
+ overtime:
33
+ request:
34
+ title: '%{member_name}申请了加班'
35
+ body: '%{member_name}申请了加班'
36
+ default:
37
+ title: 你的加班申请已被%{state_i18n}
38
+ body: 你的加班申请已被%{state_i18n}
data/config/routes.rb ADDED
@@ -0,0 +1,70 @@
1
+ Rails.application.routes.draw do
2
+
3
+ namespace :attend, defaults: { business: 'attend' } do
4
+ namespace :admin, defaults: { namespace: 'admin' } do
5
+ resources :financial_months do
6
+ member do
7
+ get :events
8
+ patch :attendance_setting
9
+ end
10
+ end
11
+ resources :absence_stats
12
+ resources :extra_days
13
+ resources :absences do
14
+ collection do
15
+ get :my
16
+ end
17
+ member do
18
+ patch :trigger
19
+ end
20
+ end
21
+ resources :overtimes, except: [:new, :create] do
22
+ collection do
23
+ get :my
24
+ end
25
+ member do
26
+ patch :trigger
27
+ end
28
+ end
29
+ resources :attendances do
30
+ collection do
31
+ get :my
32
+ end
33
+ end
34
+ resources :attendance_logs do
35
+ collection do
36
+ get :my
37
+ post :check
38
+ end
39
+ member do
40
+ patch :analyze
41
+ end
42
+ end
43
+ resources :attendance_stats
44
+ resources :attendance_settings do
45
+ collection do
46
+ get :my
47
+ post :check
48
+ end
49
+ end
50
+ end
51
+
52
+ namespace :me, defaults: { namespace: 'me' } do
53
+ resource :calendar do
54
+ get :events
55
+ end
56
+ resources :attendance_stats
57
+ resources :attendance_settings
58
+ resources :attendances
59
+ resources :attendance_logs
60
+ resources :absences do
61
+ collection do
62
+ get :dashboard
63
+ get :redeeming
64
+ end
65
+ end
66
+ resources :overtimes
67
+ end
68
+ end
69
+
70
+ end