{% extends 'timepiece/base.html' %}
{% load timepiece_tags %}
{% load url from future %}

{% block title %}Current Contracts{% endblock %}

{% block crumbs %}
    {{ block.super }}
    <li><span class="divider">/</span> <a href="{% url 'list_contracts' %}">Contracts</a></li>
{% endblock crumbs %}

{% block content %}
    <div class="row-fluid">
        <div class="span12">
            <h2>Current Contracts</h2>

            <table class='table table-bordered table-striped table-condensed'>
                <thead>
                    <tr>
                        <th>Project</th>
                        <th>Time Frame</th>
                        <th>Hours Worked</th>
                        <th>Contract Hours</th>
                        <th>Percent Complete</th>
                    </tr>
                </thead>
                <tbody>
                    {% for contract in contracts %}
                        <tr>
                            <td>
                                <a href="{% url 'view_contract' contract.id %}">{{ contract.project }}</a>
                            </td>
                            <td>{{ contract.start_date|date }} &mdash; {{ contract.end_date }}</td>
                            <td class="hours">
                                <a href="{% url 'project_time_sheet' contract.project.id %}">{{ contract.hours_worked }}</a>
                            </td>
                            <td class="hours">{{ contract.num_hours }}</td>
                            <td class="hours">{% widthratio contract.hours_worked contract.num_hours 100 %}%</td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
{% endblock %}
