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 :excuse, localize: true
field :finish, :type => Boolean, :default => false field :finish, :type => Boolean, :default => false
field :checkout, :type => DateTime field :checkout, :type => DateTime
field :dayoff, :type => Boolean, :default => false
belongs_to :member_profile belongs_to :member_profile
has_many :dayoffs has_many :dayoffs

View File

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

View File

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

View File

@ -33,6 +33,10 @@
<tbody> <tbody>
<tr> <tr>
<td><%= @memberlog.member_profile.name rescue "" %></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><%= @memberlog.created_at.strftime('%Y-%m-%d %R') %></td>
<td> <td>
<% if @memberlog.finish == true %> <% if @memberlog.finish == true %>
@ -41,6 +45,7 @@
<span class="label label-warning"><%= t('memberlog.working') %></span> <span class="label label-warning"><%= t('memberlog.working') %></span>
<% end %> <% end %>
</td> </td>
<% end %>
</tr> </tr>
</tbody> </tbody>

View File

@ -37,8 +37,7 @@
<!-- <th><input type="checkbox" /></th> --> <!-- <th><input type="checkbox" /></th> -->
<!-- <% end -%> --> <!-- <% end -%> -->
<th class="span2"><%= t('memberlog.date') %></th> <th class="span2"><%= t('memberlog.date') %></th>
<th class="span1"><%= t('memberlog.checkin') %></th> <th class="span2"><%= t('memberlog.check_in_out') %></th>
<th class="span1"><%= t('memberlog.checkout') %></th>
<th class="span3"><%= t('memberlog.excuse') %></th> <th class="span3"><%= t('memberlog.excuse') %></th>
</tr> </tr>
</thead> </thead>
@ -46,7 +45,7 @@
<% @memberlogs.each do |memberlog| %> <% @memberlogs.each do |memberlog| %>
<tr id="<%= dom_id memberlog %>"> <tr id="<%= dom_id memberlog %>">
<td> <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"> <div class="quick-edit">
<ul class="nav nav-pills hide"> <ul class="nav nav-pills hide">
@ -57,18 +56,19 @@
</ul> </ul>
</div> </div>
</td> </td>
<td><%= memberlog.created_at.strftime('%R') %></td> <% if memberlog.dayoff == true %>
<td> <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 %> <% if memberlog.finish == true %>
<%= memberlog.checkout.strftime('%R') %></td> <%= memberlog.checkout.strftime('%R') %></td>
<% else %> <% else %>
<span class="label label-warning"><%= t('memberlog.working') %></span> <span class="label label-warning"><%= t('memberlog.working') %></span>
<% end %> <% end %>
</td> </td>
<td>
<% if !memberlog.excuse.nil? %>
<span class="label label-important"><%= memberlog.excuse %></span>
<% end %> <% end %>
<td>
<span class="label label-important"><%= memberlog.excuse %></span>
</td> </td>
</tr> </tr>
<% end %> <% end %>

View File

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

View File

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