-
-
Save mrkurt/10486188 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h3>Hours Worked</h3> | |
<% user_signed_in? %> | |
<table> | |
<table class="table table-striped table-bordered table-condensed table-hover"> | |
<thead> | |
<thead> | |
<tr> | |
<th>Date</th> | |
<th>Hours Worked</th> | |
<th>Start</th> | |
<th>Finish</th> | |
<th>Description</th> | |
<th>User</th> | |
<th>Actions</th> | |
</tr> | |
</thead> | |
<tbody> | |
<% @hours.sort { |a,b| a.date <=> b.date }.each do |hour| %> | |
<tr> | |
<td><%= hour.date.to_s(:long)%></td> | |
<td><%= hour.elapsed_time%></td> | |
<td><%= hour.start.strftime("%I:%M %p") %></td> | |
<td><%= hour.finish.strftime("%I:%M %p") %></td> | |
<td><%= hour.description %></td> | |
<td><%= hour.user.name %></td> | |
<td><%= link_to 'Details,', hour %> | |
<%= link_to 'Edit,', edit_hour_path(hour) %> | |
<%= link_to 'Delete', hour, method: :delete, data: { confirm: 'Are you sure?' } %> | |
</td> | |
</tr> | |
<% end %> | |
</tbody> | |
<tfoot> | |
<tr> | |
<td> </td> | |
<td><%= hours.map(&:elapsed_time).reduce(&:+) %></td> | |
<td colspan=5"> </td> | |
</tr> | |
</tfoot> | |
</table> | |
<br> | |
<%= link_to 'New', new_hour_path %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment