{% load timepiece_tags %}
<table class="table table-bordered table-condensed table-striped">
    <thead>
    <tr>
        <th>Date</th>
        <th>User</th>
        <th>Time</th>
        <th>Project</th>
        <th>Activity</th>
        <th>Hours</th>
        <th>Comments</th>
    </tr>
    </thead>
    <tbody>
    {% for entry in entries %}
        {% ifchanged entry.start_time|date:"W" %}
            <tr class="ledger_header">
                <th colspan='7'>Week of {{ entry.start_time|week_start|date }} </th>
            </tr>
        {% endifchanged %}
        <tr>
            {% ifchanged entry.start_time|date %}
                <td>{{ entry.start_time|date:"m/d/Y (D)" }}</td>
            {% else %}
                <td></td>
            {% endifchanged %}
            <td>{{ entry.user.get_name_or_username }} </td>
            <td>{{ entry.start_time|time }} - {{ entry.end_time|time }} </td>
            <td>{{ entry.project.name }}</td>
            <td>{{ entry.activity.name }}</td>
            <td class="hours">{{ entry.hours }}</td>
            <td title="{{entry.comments}}">{{ entry.comments|truncatewords:12 }}</td>
        </tr>
    {% endfor %}
    </tbody>
</table>
