ruling_timer/app/views/admin/ruling_timers/_index_statistic.html.erb

46 lines
1.4 KiB
Plaintext

<div id="timer_select_block">
<form method="get">
<%= fields_for "date_pick" do |f| %>
<%= f.datetime_picker :start_year_month, {:picker_type=>"date",:format=>"yyyy/MM",:label=>t("ruling_timer.start_year_month"), :value => @start_year_month} %><%= f.datetime_picker :end_year_month, {:picker_type=>"date",:format=>"yyyy/MM",:label=>t("ruling_timer.end_year_month"), :value => @end_year_month} %>
<%= f.hidden_field_tag :type, "statistic" %>
<%= f.submit t('submit'), class: 'btn btn-primary' %>
<% end %>
</form>
</div>
<style>
.timer_table{
max-height: 13em;
overflow-y: scroll;
}
hr.new_line{
margin: 1em 0;
border: 1px solid #333;
}
</style>
<div class="statistic_data">
<% all_count = @all_year_months_data.count %>
<% @all_year_months_data.each_with_index do |(year_month,total_seconds,all_infos), i| %>
<h4><%= year_month %></h4>
<h5><%= t("ruling_timer.total") %>: <%= RulingTimerTemp.transform_second_to_time(total_seconds) %></h5>
<div class="timer_table">
<table class="table main-list">
<thead>
<th><%= t("ruling_timer.date") %></th>
<th><%= t("ruling_timer.work_time") %></th>
</thead>
<tbody>
<% all_infos.each do |info| %>
<tr>
<td><%= info[:date] %></td>
<td><%= info[:work_time_str] %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% if i < all_count - 1 %>
<hr class="new_line">
<% end %>
<% end %>
</div>