{% extends 'timepiece/time-sheet/base.html' %}
{% load timepiece_tags %}

{% block title %}Timepiece Entries{% endblock %}

{% block content %}
<h2>Time Tracking Report</h2>

<form action="" method="get" accept-charset="utf-8">
    {% csrf_token %}
    <table>
        {{ form }}
    </table>
</form>
<div style="float:left;padding:10px;">
<h3>Hours by Project</h3>

<br />
<table>
    {% for entry in project_totals %}
    <tr>
        <td><a href='{% url view_project entry.project__id %}'>{{ entry.project__name }}</a></td>
        <td>{{ entry.total_hours|floatformat:2 }}</td>
    </tr>
    {% endfor %}
    <tr>
        <th colspan='2'>&nbsp;</th>
    </tr>
    <tr>
        <th>Total:</th>
        <td>{{ total_hours|floatformat:2 }}</td>
    </tr>
</table>
</div>
<div style="float:left;padding:10px;">
<h3>Hours by People</h3>
<br />
<table>
    {% for entry in people_totals %}
    <tr>
        <td>{{ entry.user__first_name}} {{ entry.user__last_name }}</td>
        <td>{{ entry.total_hours|floatformat:2 }}</td>
    </tr>
    {% endfor %}
    <tr>
        <th colspan='2'>&nbsp;</th>
    </tr>
</table>
</div>
{% endblock %}
