rails_attend 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +20 -0
- data/README.md +22 -0
- data/Rakefile +32 -0
- data/app/controllers/attend/admin/absence_stats_controller.rb +60 -0
- data/app/controllers/attend/admin/absences_controller.rb +77 -0
- data/app/controllers/attend/admin/attendance_logs_controller.rb +103 -0
- data/app/controllers/attend/admin/attendance_settings_controller.rb +86 -0
- data/app/controllers/attend/admin/attendance_stats_controller.rb +58 -0
- data/app/controllers/attend/admin/attendances_controller.rb +57 -0
- data/app/controllers/attend/admin/base_controller.rb +4 -0
- data/app/controllers/attend/admin/extra_days_controller.rb +63 -0
- data/app/controllers/attend/admin/financial_months_controller.rb +69 -0
- data/app/controllers/attend/admin/overtimes_controller.rb +59 -0
- data/app/controllers/attend/me/absences_controller.rb +71 -0
- data/app/controllers/attend/me/attendance_logs_controller.rb +74 -0
- data/app/controllers/attend/me/attendance_settings_controller.rb +52 -0
- data/app/controllers/attend/me/attendance_stats_controller.rb +27 -0
- data/app/controllers/attend/me/attendances_controller.rb +43 -0
- data/app/controllers/attend/me/base_controller.rb +4 -0
- data/app/controllers/attend/me/calendars_controller.rb +33 -0
- data/app/controllers/attend/me/overtimes_controller.rb +65 -0
- data/app/javascript/packs/controllers/attend/admin/attendance_logs/index.js +1 -0
- data/app/javascript/packs/controllers/attend/admin/attendance_logs/my.js +14 -0
- data/app/javascript/packs/controllers/attend/admin/attendance_settings/create.js +1 -0
- data/app/javascript/packs/controllers/attend/admin/attendance_settings/index.js +1 -0
- data/app/javascript/packs/controllers/attend/admin/attendance_settings/my.js +13 -0
- data/app/javascript/packs/controllers/attend/admin/attendance_settings/new.js +11 -0
- data/app/javascript/packs/controllers/attend/me/absences/new.js +16 -0
- data/app/javascript/packs/controllers/attend/me/absences/update.js +3 -0
- data/app/javascript/packs/controllers/attend/me/attendance_settings/create.js +1 -0
- data/app/javascript/packs/controllers/attend/me/attendance_settings/edit.js +1 -0
- data/app/javascript/packs/controllers/attend/me/attendance_settings/new.js +2 -0
- data/app/javascript/packs/controllers/attend/me/calendars/show.js +48 -0
- data/app/jobs/attendance_job.rb +14 -0
- data/app/models/absence/attend/annual_leave.rb +5 -0
- data/app/models/absence/attend/bereavement_leave.rb +5 -0
- data/app/models/absence/attend/business_trip.rb +5 -0
- data/app/models/absence/attend/children_day_leave.rb +5 -0
- data/app/models/absence/attend/compensatory_leave.rb +5 -0
- data/app/models/absence/attend/marriage_leave.rb +4 -0
- data/app/models/absence/attend/maternity_leave.rb +5 -0
- data/app/models/absence/attend/parental_leave.rb +5 -0
- data/app/models/absence/attend/personal_leave.rb +5 -0
- data/app/models/absence/attend/prenatal_leave.rb +4 -0
- data/app/models/absence/attend/sick_leave.rb +5 -0
- data/app/models/absence/attend/vacation_leave.rb +5 -0
- data/app/models/absence/attend/welfare_leave.rb +5 -0
- data/app/models/attend/absence.rb +5 -0
- data/app/models/attend/absence_stat.rb +5 -0
- data/app/models/attend/application_record.rb +5 -0
- data/app/models/attend/attendance.rb +5 -0
- data/app/models/attend/attendance_log.rb +5 -0
- data/app/models/attend/attendance_setting.rb +5 -0
- data/app/models/attend/attendance_stat.rb +5 -0
- data/app/models/attend/ext/member.rb +33 -0
- data/app/models/attend/extra_day.rb +5 -0
- data/app/models/attend/financial_month.rb +5 -0
- data/app/models/attend/model/absence/business_trip.rb +10 -0
- data/app/models/attend/model/absence/compensatory_leave.rb +5 -0
- data/app/models/attend/model/absence/personal_leave.rb +5 -0
- data/app/models/attend/model/absence/welfare_leave/annual_leave.rb +16 -0
- data/app/models/attend/model/absence/welfare_leave/vacation_leave.rb +16 -0
- data/app/models/attend/model/absence/welfare_leave.rb +5 -0
- data/app/models/attend/model/absence.rb +208 -0
- data/app/models/attend/model/absence_stat.rb +17 -0
- data/app/models/attend/model/attendance.rb +314 -0
- data/app/models/attend/model/attendance_log.rb +165 -0
- data/app/models/attend/model/attendance_setting.rb +61 -0
- data/app/models/attend/model/attendance_stat.rb +104 -0
- data/app/models/attend/model/extra_day.rb +21 -0
- data/app/models/attend/model/financial_month.rb +114 -0
- data/app/models/attend/model/overtime.rb +93 -0
- data/app/models/attend/overtime.rb +5 -0
- data/app/models/attend.rb +11 -0
- data/app/models/concerns/absent.rb +103 -0
- data/app/views/admin/_attend_nav.html.erb +15 -0
- data/app/views/attend/admin/absence_stats/_filter_form.html.erb +9 -0
- data/app/views/attend/admin/absence_stats/_form.html.erb +12 -0
- data/app/views/attend/admin/absence_stats/_index_tbody.html.erb +3 -0
- data/app/views/attend/admin/absence_stats/_index_thead.html.erb +4 -0
- data/app/views/attend/admin/absence_stats/index.html.erb +5 -0
- data/app/views/attend/admin/absences/_absence.html.erb +38 -0
- data/app/views/attend/admin/absences/_edit_form.html.erb +3 -0
- data/app/views/attend/admin/absences/_filter_form.html.erb +8 -0
- data/app/views/attend/admin/absences/_form.html.erb +5 -0
- data/app/views/attend/admin/absences/_index_tbody.html.erb +18 -0
- data/app/views/attend/admin/absences/_index_thead.html.erb +10 -0
- data/app/views/attend/admin/absences/_new_form.html.erb +3 -0
- data/app/views/attend/admin/absences/_show.html.erb +11 -0
- data/app/views/attend/admin/absences/index.html.erb +5 -0
- data/app/views/attend/admin/absences/my.html.erb +5 -0
- data/app/views/attend/admin/attendance_logs/_edit_form.html.erb +5 -0
- data/app/views/attend/admin/attendance_logs/_filter_form.html.erb +11 -0
- data/app/views/attend/admin/attendance_logs/_form.html.erb +6 -0
- data/app/views/attend/admin/attendance_logs/_index_thead.html.erb +19 -0
- data/app/views/attend/admin/attendance_logs/_list.html.erb +61 -0
- data/app/views/attend/admin/attendance_logs/_new_form.html.erb +3 -0
- data/app/views/attend/admin/attendance_logs/index.html.erb +5 -0
- data/app/views/attend/admin/attendance_logs/my.html.erb +5 -0
- data/app/views/attend/admin/attendance_settings/_button.html.erb +4 -0
- data/app/views/attend/admin/attendance_settings/_filter_form.html.erb +11 -0
- data/app/views/attend/admin/attendance_settings/_form.html.erb +7 -0
- data/app/views/attend/admin/attendance_settings/_index_tbody.html.erb +15 -0
- data/app/views/attend/admin/attendance_settings/_index_thead.html.erb +10 -0
- data/app/views/attend/admin/attendance_settings/_new_form.html.erb +8 -0
- data/app/views/attend/admin/attendance_settings/_show_table.html.erb +12 -0
- data/app/views/attend/admin/attendance_settings/index.html.erb +5 -0
- data/app/views/attend/admin/attendance_settings/my.html.erb +5 -0
- data/app/views/attend/admin/attendance_stats/_filter_form.html.erb +10 -0
- data/app/views/attend/admin/attendance_stats/_form.html.erb +6 -0
- data/app/views/attend/admin/attendance_stats/_index_thead.html.erb +10 -0
- data/app/views/attend/admin/attendance_stats/index.html.erb +44 -0
- data/app/views/attend/admin/attendances/_button.html.erb +2 -0
- data/app/views/attend/admin/attendances/_filter_form.html.erb +10 -0
- data/app/views/attend/admin/attendances/_form.html.erb +23 -0
- data/app/views/attend/admin/attendances/_index_tbody.html.erb +61 -0
- data/app/views/attend/admin/attendances/_index_thead.html.erb +22 -0
- data/app/views/attend/admin/attendances/_new_form.html.erb +4 -0
- data/app/views/attend/admin/attendances/index.html.erb +7 -0
- data/app/views/attend/admin/base/_financial_month_menu.html.erb +10 -0
- data/app/views/attend/admin/base/_nav.html.erb +3 -0
- data/app/views/attend/admin/base/_nav_attendances.html.erb +7 -0
- data/app/views/attend/admin/extra_days/_breadcrumb.html.erb +0 -0
- data/app/views/attend/admin/extra_days/_edit_form.html.erb +4 -0
- data/app/views/attend/admin/extra_days/_filter_form.html.erb +5 -0
- data/app/views/attend/admin/extra_days/_form.html.erb +4 -0
- data/app/views/attend/admin/extra_days/_index_tbody.html.erb +3 -0
- data/app/views/attend/admin/extra_days/_index_thead.html.erb +4 -0
- data/app/views/attend/admin/extra_days/_new_form.html.erb +4 -0
- data/app/views/attend/admin/extra_days/index.html.erb +7 -0
- data/app/views/attend/admin/financial_months/_breadcrumb.html.erb +0 -0
- data/app/views/attend/admin/financial_months/_edit_form.html.erb +4 -0
- data/app/views/attend/admin/financial_months/_filter_form.html.erb +9 -0
- data/app/views/attend/admin/financial_months/_form.html.erb +4 -0
- data/app/views/attend/admin/financial_months/_index_tbody.html.erb +9 -0
- data/app/views/attend/admin/financial_months/_index_thead.html.erb +6 -0
- data/app/views/attend/admin/financial_months/_new_form.html.erb +4 -0
- data/app/views/attend/admin/financial_months/events.json.jbuilder +9 -0
- data/app/views/attend/admin/financial_months/index.html.erb +7 -0
- data/app/views/attend/admin/financial_months/index.js +60 -0
- data/app/views/attend/admin/financial_months/show.html.erb +10 -0
- data/app/views/attend/admin/overtimes/_button.html.erb +0 -0
- data/app/views/attend/admin/overtimes/_edit_form.html.erb +4 -0
- data/app/views/attend/admin/overtimes/_filter_form.html.erb +8 -0
- data/app/views/attend/admin/overtimes/_form.html.erb +3 -0
- data/app/views/attend/admin/overtimes/_index_tbody.html.erb +22 -0
- data/app/views/attend/admin/overtimes/_index_thead.html.erb +9 -0
- data/app/views/attend/admin/overtimes/_new_form.html.erb +4 -0
- data/app/views/attend/admin/overtimes/index.html.erb +5 -0
- data/app/views/attend/admin/overtimes/my.html.erb +8 -0
- data/app/views/attend/me/absences/_absence.html.erb +34 -0
- data/app/views/attend/me/absences/_edit_form.html.erb +3 -0
- data/app/views/attend/me/absences/_filter_form.html.erb +11 -0
- data/app/views/attend/me/absences/_form.html.erb +33 -0
- data/app/views/attend/me/absences/_index_tbody.html.erb +24 -0
- data/app/views/attend/me/absences/_index_thead.html.erb +8 -0
- data/app/views/attend/me/absences/_new_form.html.erb +3 -0
- data/app/views/attend/me/absences/_redeeming_form.html.erb +5 -0
- data/app/views/attend/me/absences/_show.html.erb +11 -0
- data/app/views/attend/me/absences/dashboard.html.erb +44 -0
- data/app/views/attend/me/absences/index.html.erb +7 -0
- data/app/views/attend/me/absences/redeeming.js.erb +6 -0
- data/app/views/attend/me/absences/show.html.erb +1 -0
- data/app/views/attend/me/attendance_logs/_edit_form.html.erb +4 -0
- data/app/views/attend/me/attendance_logs/_filter_form.html.erb +11 -0
- data/app/views/attend/me/attendance_logs/_form.html.erb +11 -0
- data/app/views/attend/me/attendance_logs/_index_thead.html.erb +9 -0
- data/app/views/attend/me/attendance_logs/_new_form.html.erb +4 -0
- data/app/views/attend/me/attendance_logs/index.html.erb +42 -0
- data/app/views/attend/me/attendance_settings/_edit_form.html.erb +6 -0
- data/app/views/attend/me/attendance_settings/_index_tbody.html.erb +15 -0
- data/app/views/attend/me/attendance_settings/_index_thead.html.erb +12 -0
- data/app/views/attend/me/attendance_settings/_new_form.html.erb +8 -0
- data/app/views/attend/me/attendance_settings/index.html.erb +5 -0
- data/app/views/attend/me/attendance_stats/_form.html.erb +6 -0
- data/app/views/attend/me/attendance_stats/_search_form.html.erb +5 -0
- data/app/views/attend/me/attendance_stats/edit.html.erb +9 -0
- data/app/views/attend/me/attendance_stats/index.html.erb +49 -0
- data/app/views/attend/me/attendance_stats/new.html.erb +9 -0
- data/app/views/attend/me/attendance_stats/show.html.erb +28 -0
- data/app/views/attend/me/attendances/_button.html.erb +3 -0
- data/app/views/attend/me/attendances/_filter_form.html.erb +9 -0
- data/app/views/attend/me/attendances/_form.html.erb +22 -0
- data/app/views/attend/me/attendances/_index_tbody.html.erb +49 -0
- data/app/views/attend/me/attendances/_index_thead.html.erb +19 -0
- data/app/views/attend/me/attendances/index.html.erb +7 -0
- data/app/views/attend/me/base/_menu.html.erb +8 -0
- data/app/views/attend/me/base/_nav_absences.html.erb +9 -0
- data/app/views/attend/me/base/_nav_attendances.html.erb +10 -0
- data/app/views/attend/me/calendars/events.json.jbuilder +19 -0
- data/app/views/attend/me/calendars/show.html.erb +12 -0
- data/app/views/attend/me/overtimes/_edit_form.html.erb +4 -0
- data/app/views/attend/me/overtimes/_filter_form.html.erb +9 -0
- data/app/views/attend/me/overtimes/_form.html.erb +16 -0
- data/app/views/attend/me/overtimes/_index_tbody.html.erb +23 -0
- data/app/views/attend/me/overtimes/_index_thead.html.erb +6 -0
- data/app/views/attend/me/overtimes/_new_form.html.erb +4 -0
- data/app/views/attend/me/overtimes/index.html.erb +7 -0
- data/app/views/me/_attend_nav.html.erb +12 -0
- data/app/views/me/_nav_attendance_settings.html.erb +8 -0
- data/config/locales/en.attributes.yml +34 -0
- data/config/locales/en.controller.yml +18 -0
- data/config/locales/en.enum.yml +43 -0
- data/config/locales/en.notify.yml +38 -0
- data/config/locales/zh.attributes.yml +34 -0
- data/config/locales/zh.controller.yml +40 -0
- data/config/locales/zh.enum.yml +43 -0
- data/config/locales/zh.notify.yml +38 -0
- data/config/routes.rb +70 -0
- data/lib/rails_attend/config.rb +11 -0
- data/lib/rails_attend/engine.rb +25 -0
- data/lib/rails_attend.rb +2 -0
- metadata +269 -0
@@ -0,0 +1,61 @@
|
|
1
|
+
<div class="ui attached segment">
|
2
|
+
<%= link_to 'confirm', check_admin_attendance_logs_path, id: 'checked_attendance_log', method: 'post', class: 'ui big green label' %>
|
3
|
+
</div>
|
4
|
+
|
5
|
+
<table class="table is-hoverable is-fullwidth">
|
6
|
+
<thead>
|
7
|
+
<tr>
|
8
|
+
|
9
|
+
</tr>
|
10
|
+
</thead>
|
11
|
+
|
12
|
+
<tbody>
|
13
|
+
<% @attendance_logs.each do |attendance_log| %>
|
14
|
+
<tr>
|
15
|
+
<td>
|
16
|
+
<%= attendance_log.id %>
|
17
|
+
<%= check_box_tag :attendance_log_id, attendance_log.id, false, id: nil %>
|
18
|
+
</td>
|
19
|
+
<td>
|
20
|
+
<p><%= attendance_log.member&.name || attendance_log.name %></p>
|
21
|
+
<p><%= attendance_log.number %></p>
|
22
|
+
</td>
|
23
|
+
<td>
|
24
|
+
<p>
|
25
|
+
<% if attendance_log.record_at %>
|
26
|
+
<time class="green text"><%= attendance_log.record_at.to_s(:rfc822) %></time>
|
27
|
+
<% else %>
|
28
|
+
<%= attendance_log.record_at_str %>
|
29
|
+
<% end %>
|
30
|
+
</p>
|
31
|
+
<p class="grey text"><time><%= attendance_log.created_at.to_s(:rfc822) %></time></p>
|
32
|
+
</td>
|
33
|
+
<td><%= attendance_log.kind_i18n %></td>
|
34
|
+
<td>
|
35
|
+
<% if attendance_log.processed %>
|
36
|
+
<i class="green checkmark icon"></i>
|
37
|
+
<% else %>
|
38
|
+
<i class="grey remove icon"></i>
|
39
|
+
<% end %>
|
40
|
+
<p><span class="ui label"><%= attendance_log.source %></span></p>
|
41
|
+
</td>
|
42
|
+
<td class="ui labels">
|
43
|
+
<span class="ui label"><%= attendance_log.state_i18n %></span>
|
44
|
+
<% if attendance_log.state_init? %>
|
45
|
+
<div class="ui mini buttons">
|
46
|
+
<%= link_to 'Approve', new_check_path('AttendanceLog', attendance_log.id, state: 'valid'), class: 'ui positive button' %>
|
47
|
+
<div class="or"></div>
|
48
|
+
<%= link_to 'Deny', new_check_path('AttendanceLog', attendance_log.id, state: 'invalid'), class: 'ui negative button' %>
|
49
|
+
</div>
|
50
|
+
<% end %>
|
51
|
+
</td>
|
52
|
+
<td>
|
53
|
+
<%= link_to 'analyze', analyze_admin_attendance_log_path(attendance_log), method: :patch, data: { confirm: t('.confirm') }, class: 'ui blue label' %>
|
54
|
+
<%= link_to t('.destroy'), admin_attendance_log_path(attendance_log), method: :delete, data: { confirm: t('.confirm') }, class: 'ui red label' %>
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<% end %>
|
58
|
+
</tbody>
|
59
|
+
</table>
|
60
|
+
|
61
|
+
<%= paginate @attendance_logs %>
|
@@ -0,0 +1,4 @@
|
|
1
|
+
<%= link_to({ action: 'new' }, class: 'button is-link is-small') do %>
|
2
|
+
<i class="fas fa-plus"></i><span><%= t('.new') %></span>
|
3
|
+
<% end %>
|
4
|
+
<%= link_to 'confirm', check_admin_attendance_settings_path, id: 'checked_attendance_setting', method: 'post', class: 'ui mini secondary button' %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%= form_with theme: 'search', model: Attend::AttendanceSetting.new do |f| %>
|
2
|
+
<div class="field-body">
|
3
|
+
<%= f.text_field 'member.name' %>
|
4
|
+
<%= f.text_field 'member.email' %>
|
5
|
+
<div class="field is-narrow">
|
6
|
+
<%= f.submit %>
|
7
|
+
</div>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<td>
|
2
|
+
<%= model.id %>
|
3
|
+
<%= check_box_tag :attendance_setting_id, model.id, model.approved?, id: nil %>
|
4
|
+
</td>
|
5
|
+
<td><%= model.member.name %></td>
|
6
|
+
<td>
|
7
|
+
<% if model.financial_month %>
|
8
|
+
<%= model.financial_month.month %>
|
9
|
+
<% end %>
|
10
|
+
</td>
|
11
|
+
<td><%= model.on_time %></td>
|
12
|
+
<td>
|
13
|
+
<span class="ui label"><%= model.state_i18n %></span>
|
14
|
+
</td>
|
15
|
+
<td><%= model.note %></td>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<th>
|
2
|
+
<%= Attend::AttendanceSetting.human_attribute_name(:id) %>
|
3
|
+
<%= check_box_tag :attendance_setting_all, 1, false, onclick: "toggleAll(this, 'attendance_setting_id')", id: nil %>
|
4
|
+
</th>
|
5
|
+
<th><%= Attend::AttendanceSetting.human_attribute_name(:member) %></th>
|
6
|
+
<th><%= Attend::AttendanceSetting.human_attribute_name(:financial_month) %></th>
|
7
|
+
<th><%= Attend::AttendanceSetting.human_attribute_name(:on_time) %></th>
|
8
|
+
<th><%= Attend::AttendanceSetting.human_attribute_name(:state) %></th>
|
9
|
+
<th><%= Attend::AttendanceSetting.human_attribute_name(:note) %></th>
|
10
|
+
<th></th>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<%= form_with model: @attendance_setting, url: admin_attendance_settings_path do |f| %>
|
2
|
+
<%= render 'error_messages', target: @attendance_setting %>
|
3
|
+
<%= f.select :member_id, options_for_select([[@attendance_setting.member&.name, @attendance_setting.member_id]], @attendance_setting.member_id) %>
|
4
|
+
<%= f.collection_select :financial_month_id, FinancialMonth.current_all, :id, :date_range %>
|
5
|
+
<%= f.select :on_time, options_for_select(AttendanceSetting.time_options, @attendance_setting.on_time) %>
|
6
|
+
<%= f.text_field :note %>
|
7
|
+
<%= f.submit %>
|
8
|
+
<% end %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<tr>
|
2
|
+
<td class="has-text-right"><%= Attend::AttendanceSetting.human_attribute_name(:on_time) %></td>
|
3
|
+
<td><%= @attendance_setting.on_time %></td>
|
4
|
+
</tr>
|
5
|
+
<tr>
|
6
|
+
<td class="has-text-right"><%= Attend::AttendanceSetting.human_attribute_name(:state) %></td>
|
7
|
+
<td><%= @attendance_setting.state %></td>
|
8
|
+
</tr>
|
9
|
+
<tr>
|
10
|
+
<td class="has-text-right"><%= Attend::AttendanceSetting.human_attribute_name(:note) %></td>
|
11
|
+
<td><%= @attendance_setting.note %></td>
|
12
|
+
</tr>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<%= form_with model: @attendance_stat, url: admin_attendance_stats_path do |f| %>
|
2
|
+
<%= render 'error_messages', target: @attendance_stat %>
|
3
|
+
<%= f.text_field :member_id %>
|
4
|
+
<%= f.collection_select :financial_month_id, @financial_months, :id, :end_date %>
|
5
|
+
<%= f.submit %>
|
6
|
+
<% end %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<th><%= AttendanceStat.human_attribute_name(:member) %></th>
|
2
|
+
<th><%= AttendanceStat.human_attribute_name(:financial_month) %></th>
|
3
|
+
<th><%= AttendanceStat.human_attribute_name(:allowance_days) %></th>
|
4
|
+
<th><%= AttendanceStat.human_attribute_name(:late_days) %></th>
|
5
|
+
<th><%= AttendanceStat.human_attribute_name(:costed_absence) %></th>
|
6
|
+
<th>
|
7
|
+
<p><%= AttendanceStat.human_attribute_name(:holiday_redeeming_hours) %></p>
|
8
|
+
<p><%= AttendanceStat.human_attribute_name(:absence_redeeming_hours) %></p>
|
9
|
+
</th>
|
10
|
+
<th></th>
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<%= render 'nav_attendances' %>
|
2
|
+
|
3
|
+
<%= render 'filter' %>
|
4
|
+
|
5
|
+
<table class="table is-hoverable is-fullwidth">
|
6
|
+
<thead>
|
7
|
+
<tr>
|
8
|
+
|
9
|
+
</tr>
|
10
|
+
</thead>
|
11
|
+
<tbody>
|
12
|
+
<% @attendance_stats.each do |attendance_stat| %>
|
13
|
+
<tr>
|
14
|
+
<td><%= attendance_stat.member.name %></td>
|
15
|
+
<td>
|
16
|
+
<p><%= attendance_stat.financial_month.begin_date %></p>
|
17
|
+
<p><%= attendance_stat.financial_month.end_date %></p>
|
18
|
+
</td>
|
19
|
+
<td><%= attendance_stat.allowance_days %></td>
|
20
|
+
<td><%= attendance_stat.late_days %></td>
|
21
|
+
<td>
|
22
|
+
<%= simple_format(attendance_stat.costed_absence) %>
|
23
|
+
</td>
|
24
|
+
<td>
|
25
|
+
<p><%= attendance_stat.holiday_redeeming_hours %></p>
|
26
|
+
<p><%= attendance_stat.absence_redeeming_hours %></p>
|
27
|
+
</td>
|
28
|
+
<td class="ui labels">
|
29
|
+
<%#= link_to admin_attendance_stat_path(attendance_stat), class: 'ui blue mini icon button' do %>
|
30
|
+
<!-- <i class="fas fa-info"></i>-->
|
31
|
+
<%# end %>
|
32
|
+
<%= link_to edit_admin_attendance_stat_path(attendance_stat), class: 'ui pink mini icon button' do %>
|
33
|
+
<i class="fas fa-pencil-alt"></i>
|
34
|
+
<% end %>
|
35
|
+
<%= link_to admin_attendance_stat_path(attendance_stat), method: :delete, data: { confirm: t('.confirm') }, class: 'ui red mini icon button' do %>
|
36
|
+
<i class="times icon"></i>
|
37
|
+
<% end %>
|
38
|
+
</td>
|
39
|
+
</tr>
|
40
|
+
<% end %>
|
41
|
+
</tbody>
|
42
|
+
</table>
|
43
|
+
|
44
|
+
<%= paginate @attendance_stats %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<%= render 'error_messages', target: f.object %>
|
2
|
+
<div class="field is-horizontal">
|
3
|
+
<%= f.label :start_at %>
|
4
|
+
<div class="field-body">
|
5
|
+
<div class="field is-narrow">
|
6
|
+
<%= f.date_field 'start_at(date)', wrap: { input: false, all: false }, label: nil %>
|
7
|
+
</div>
|
8
|
+
<div class="field is-narrow select">
|
9
|
+
<%= f.time_select :start_at, start_hour: 8, end_hour: 18, minute_step: 30, wrap: { all: false }, label: nil %>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
<div class="field is-horizontal">
|
14
|
+
<%= f.label :finish_at %>
|
15
|
+
<div class="field-body control">
|
16
|
+
<div class="field is-narrow">
|
17
|
+
<%= f.date_field 'finish_at(date)', wrap: { input: false, all: false }, label: nil %>
|
18
|
+
</div>
|
19
|
+
<div class="field is-narrow select">
|
20
|
+
<%= f.time_select :finish_at, start_hour: 8, end_hour: 18, minute_step: 30, wrap: { all: false }, label: nil %>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
</div>
|
@@ -0,0 +1,61 @@
|
|
1
|
+
<td><%= model.member.name %></td>
|
2
|
+
<td><%= model.attend_on %></td>
|
3
|
+
<td>
|
4
|
+
<p><time data-controller="time" data-format="HH:mm"><%= model.start_at&.to_s(:rfc822) %></time></p>
|
5
|
+
<p>
|
6
|
+
<% if model.finish_at %>
|
7
|
+
<time data-controller="time" data-format="HH:mm"><%= model.finish_at.to_s(:rfc822) %></time>
|
8
|
+
<% elsif model.finish_at.blank? && model.start_at.present? %>
|
9
|
+
<%= link_to 'Re-Punch', new_admin_attendance_log_path(attendance_id: model.id), class: 'ui teal mini button' %>
|
10
|
+
<% end %>
|
11
|
+
</p>
|
12
|
+
</td>
|
13
|
+
<td>
|
14
|
+
<p><time data-controller="time" data-format="HH:mm"><%= model.interval_start_at&.to_s(:rfc822) %></time><p>
|
15
|
+
<p>
|
16
|
+
<% if model.interval_finish_at %>
|
17
|
+
<time data-controller="time" data-format="HH:mm"><%= model.interval_finish_at.to_s(:rfc822) %></time>
|
18
|
+
<% elsif model.interval_finish_at.blank? && model.interval_start_at.present? %>
|
19
|
+
<%= link_to 'Re-Punch', new_admin_attendance_log_path(attendance_id: model.id), class: 'ui teal mini button' %>
|
20
|
+
<% end %>
|
21
|
+
</p>
|
22
|
+
</td>
|
23
|
+
<td class="tags">
|
24
|
+
<% if model.interval_absence_id %>
|
25
|
+
<p><%= link_to model.interval_hours, admin_absence_path(model.interval_absence_id), class: 'ui green label' %></p>
|
26
|
+
<% elsif model.interval_hours.to_f > 0 %>
|
27
|
+
<p><span class="tag"><%= model.interval_hours %></span></p>
|
28
|
+
<% end %>
|
29
|
+
</td>
|
30
|
+
<td class="tags">
|
31
|
+
<% if model.late_absence_id %>
|
32
|
+
<p>
|
33
|
+
<%= link_to model.late_minutes.to_i.minutes.inspect, admin_absence_path(model.late_absence_id), class: 'ui green label' %>
|
34
|
+
</p>
|
35
|
+
<% elsif model.late_minutes %>
|
36
|
+
<p><span class="tag"><%= model.late_minutes.to_i.minutes.inspect %></span></p>
|
37
|
+
<% end %>
|
38
|
+
<% if model.leave_absence_id %>
|
39
|
+
<p>
|
40
|
+
<%= link_to model.late_minutes.to_i.minutes.inspect, admin_absence_path(model.leave_absence_id), class: 'ui green label' %>
|
41
|
+
</p>
|
42
|
+
<% elsif model.leave_minutes %>
|
43
|
+
<p><span class="tag"><%= model.leave_minutes.to_i.minutes.inspect %></span></p>
|
44
|
+
<% end %>
|
45
|
+
</td>
|
46
|
+
<td>
|
47
|
+
<p><%= model.attend_hours.to_d.to_s(:human) %>h</p>
|
48
|
+
<p><%= model.overtime_hours.to_d.to_s(:human) %>h</p>
|
49
|
+
</td>
|
50
|
+
<td>
|
51
|
+
<% if model.workday %>
|
52
|
+
<i class="green check icon"></i>
|
53
|
+
<% else %>
|
54
|
+
<i class="red times icon"></i>
|
55
|
+
<% end %>
|
56
|
+
</td>
|
57
|
+
<td><%= model.kind_i18n %></td>
|
58
|
+
<td class="ui labels">
|
59
|
+
<%= link_to 'logs', admin_attendance_logs_path(attendance_id: model.id), class: 'ui blue label' %>
|
60
|
+
<%= link_to t('.edit'), edit_admin_attendance_path(model), class: 'ui pink label' %>
|
61
|
+
</td>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<th><%= Attend::Attendance.human_attribute_name(:member) %></th>
|
2
|
+
<th><%= Attend::Attendance.human_attribute_name(:attend_on) %></th>
|
3
|
+
<th>
|
4
|
+
<p><%= Attend::Attendance.human_attribute_name(:start_at) %></p>
|
5
|
+
<p><%= Attend::Attendance.human_attribute_name(:finish_at) %></p>
|
6
|
+
</th>
|
7
|
+
<th>
|
8
|
+
<p><%= Attend::Attendance.human_attribute_name(:interval_start_at) %></p>
|
9
|
+
<p><%= Attend::Attendance.human_attribute_name(:interval_finish_at) %></p>
|
10
|
+
</th>
|
11
|
+
<th><%= Attend::Attendance.human_attribute_name(:interval_hours) %></th>
|
12
|
+
<th>
|
13
|
+
<p><%= Attend::Attendance.human_attribute_name(:late_minutes) %></p>
|
14
|
+
<p><%= Attend::Attendance.human_attribute_name(:leave_minutes) %></p>
|
15
|
+
</th>
|
16
|
+
<th>
|
17
|
+
<p><%= Attend::Attendance.human_attribute_name(:attend_hours) %></p>
|
18
|
+
<p><%= Attend::Attendance.human_attribute_name(:overtime_hours) %></p>
|
19
|
+
</th>
|
20
|
+
<th><%= Attend::Attendance.human_attribute_name(:workday) %></th>
|
21
|
+
<th><%= Attend::Attendance.human_attribute_name(:kind) %></th>
|
22
|
+
<th></th>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<div class="tabs">
|
2
|
+
<ul>
|
3
|
+
<li class="<%= active_helper(controllers: 'financial_months', active: 'is-active') %>">
|
4
|
+
<%= link_to t('attend.admin.financial_months.index.title'), { controller: 'financial_months' } %>
|
5
|
+
</li>
|
6
|
+
<li class="<%= active_helper(controllers: 'extra_days', active: 'is-active') %>">
|
7
|
+
<%= link_to t('attend.admin.extra_days.index.title'), { controller: 'extra_days' } %>
|
8
|
+
</li>
|
9
|
+
</ul>
|
10
|
+
</div>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<div class="tabs">
|
2
|
+
<ul>
|
3
|
+
<li><%= link_to 'Attendances', admin_attendances_path, class: active_helper(controllers: 'attendances') %></li>
|
4
|
+
<li><%= link_to 'Attendance Stat', admin_attendance_stats_path, class: active_helper(controllers: 'attendance_stats') %></li>
|
5
|
+
<li><%= link_to 'Attendance Logs', admin_attendance_logs_path, class: active_helper(controllers: 'attendance_logs') %></li>
|
6
|
+
</ul>
|
7
|
+
</div>
|
File without changes
|