Permalink
Browse files

Destaca pontos com horário alterado e horário original.

  • Loading branch information...
bernardo committed Nov 29, 2011
1 parent 0a48f9f commit 7ddfbd1cfcdf360e0746573a3b8bad27441e486d
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Deleted file not rendered
View
@@ -32,5 +32,9 @@ def entrance?
def exit?
!entrance?
end
+
+ def altered?
+ (self.punched_at - self.created_at).abs > 15.minutes
+ end
end
@@ -14,6 +14,13 @@
</div>
</td>
<td class="text"><%= punch.comment %></td>
+ <td class="kind">
+ <% if not punch.altered? %>
+ <%= image_tag "icon_clock_green.png", :title => "Ponto com Horário Original" %>
+ <% else %>
+ <%= image_tag "icon_clock_red.png", :title => "Ponto com Horário Alterado" %>
+ <% end %>
+ </td>
<td class="actions">
<%= f.submit "Alterar" %>
<%= link_to 'remover', punch, :confirm => 'Tem certeza?', :method => :delete, :remote => true %>

0 comments on commit 7ddfbd1

Please sign in to comment.