fixed some issue

This commit is contained in:
Keith 2017-02-22 19:00:53 +08:00
parent 8d2a3225fd
commit 5aa63ea6cd
7 changed files with 46 additions and 34 deletions

View File

@ -10,6 +10,7 @@ class MemberLog
field :excuse, localize: true
field :finish, :type => Boolean, :default => false
field :checkout, :type => DateTime
field :dayoff, :type => Boolean, :default => false
belongs_to :member_profile
has_many :dayoffs

View File

@ -2,14 +2,17 @@
<tr id="<%= dom_id memberlog %>" class="with_action">
<td class="span2"><%= memberlog.member_profile.name rescue "" %></td>
<td class="span2"><%= memberlog.created_at.strftime('%Y/%m/%d (%a)') %>
<td><%= memberlog.created_at.strftime('%R') %></td>
<td>
<% if memberlog.finish == true %>
<%= memberlog.checkout.strftime('%R') %></td>
<% else %>
<span class="label label-warning"><%= t('memberlog.working') %></span>
<% end %>
</td>
<% if memberlog.dayoff == true %>
<td><span class="badge badge-important"><%= t('memberlog.dayoff') %> </span></td>
<% else %>
<td><%= memberlog.created_at.strftime('%R') %> <span class="icons-arrow-right-7"></span>
<% if memberlog.finish == true %>
<%= memberlog.checkout.strftime('%R') %></td>
<% else %>
<span class="label label-warning"><%= t('memberlog.working') %></span>
<% end %>
</td>
<% end %>
<td class="span6">
<%= link_to memberlog.todo.html_safe, admin_memberlog_path(memberlog.id), :class => "modal-opener" %>
<div class="quick-edit">
@ -33,7 +36,7 @@
<div id="<%= "#{memberlog.id.to_s}-detail" %>" class="footable-row-detail-inner" style="display: none;">
<div>
<strong><%= t(:complete) %></strong> :
<%= memberlog.complete%>
<%= memberlog.complete.html.safe %>
</div>
</div>

View File

@ -15,8 +15,7 @@
<tr>
<th class="span1"><%= t('memberlog.staff') %></th>
<th class="span3"><%= t('memberlog.date') %></th>
<th class="span2"><%= t('memberlog.checkin') %></th>
<th class="span2"><%= t('memberlog.checkout') %></th>
<th class="span2"><%= t('memberlog.check_in_out') %></th>
<th class="span2"><%= t('memberlog.todo') %></th>
<th class="span5"><%= t('memberlog.excuse') %></th>
</tr>

View File

@ -32,15 +32,20 @@
</thead>
<tbody>
<tr>
<td><%= @memberlog.member_profile.name rescue "" %></td>
<td><%= @memberlog.created_at.strftime('%Y-%m-%d %R') %></td>
<td>
<% if @memberlog.finish == true %>
<%= @memberlog.checkout.strftime('%Y-%m-%d %R') %>
<% else %>
<span class="label label-warning"><%= t('memberlog.working') %></span>
<% end %>
</td>
<td><%= @memberlog.member_profile.name rescue "" %></td>
<% if @memberlog.dayoff == true %>
<td><span class="badge badge-important"><%= t('memberlog.dayoff') %> </span></td>
<td></td>
<% else %>
<td><%= @memberlog.created_at.strftime('%Y-%m-%d %R') %></td>
<td>
<% if @memberlog.finish == true %>
<%= @memberlog.checkout.strftime('%Y-%m-%d %R') %>
<% else %>
<span class="label label-warning"><%= t('memberlog.working') %></span>
<% end %>
</td>
<% end %>
</tr>
</tbody>

View File

@ -37,8 +37,7 @@
<!-- <th><input type="checkbox" /></th> -->
<!-- <% end -%> -->
<th class="span2"><%= t('memberlog.date') %></th>
<th class="span1"><%= t('memberlog.checkin') %></th>
<th class="span1"><%= t('memberlog.checkout') %></th>
<th class="span2"><%= t('memberlog.check_in_out') %></th>
<th class="span3"><%= t('memberlog.excuse') %></th>
</tr>
</thead>
@ -46,7 +45,7 @@
<% @memberlogs.each do |memberlog| %>
<tr id="<%= dom_id memberlog %>">
<td>
<%= link_to memberlog.created_at.strftime('%Y-%m-%d (%a)'), admin_memberlog_path(memberlog.id), :data => {"target" => "#logModal", "toggle" => "modal"} %>
<%= link_to memberlog.created_at.strftime('%Y-%m-%d (%a)'), admin_memberlog_path(memberlog.id), :class => "modal-opener" %>
<div class="quick-edit">
<ul class="nav nav-pills hide">
@ -57,18 +56,19 @@
</ul>
</div>
</td>
<td><%= memberlog.created_at.strftime('%R') %></td>
<% if memberlog.dayoff == true %>
<td><span class="badge badge-important"><%= t('memberlog.dayoff') %> </span></td>
<% else %>
<td><%= memberlog.created_at.strftime('%R') %> <span class="icons-arrow-right-7"></span>
<% if memberlog.finish == true %>
<%= memberlog.checkout.strftime('%R') %></td>
<% else %>
<span class="label label-warning"><%= t('memberlog.working') %></span>
<% end %>
</td>
<% end %>
<td>
<% if memberlog.finish == true %>
<%= memberlog.checkout.strftime('%R') %></td>
<% else %>
<span class="label label-warning"><%= t('memberlog.working') %></span>
<% end %>
</td>
<td>
<% if !memberlog.excuse.nil? %>
<span class="label label-important"><%= memberlog.excuse %></span>
<% end %>
<span class="label label-important"><%= memberlog.excuse %></span>
</td>
</tr>
<% end %>

View File

@ -14,3 +14,5 @@ en:
end_dayoff: End Dayoff
status: Status
date: Date
check_in_out: Check-In~Check-Out
dayoff: Day off

View File

@ -14,3 +14,5 @@ zh_tw:
end_dayoff: 休假結束日期
status: 狀態
date: 出勤日期
check_in_out: 上班時間~下班時間
dayoff: 休假