{% extends 'timepiece/time-sheet/invoice/base.html' %}
{% load timepiece_tags %}
{% load url from future %}

{% block title %}Remove Entry from Invoice{% endblock %}

{% block crumbs %}
    {{ block.super }}
    <li><span class="divider">/</span> <a href="{% url 'remove_invoice_entry' invoice.pk entry.pk %}">Remove Entry</a></li>
{% endblock crumbs %}

{% block content %}
    <div class="row">
        <div class="span12">
            <h2>Are you sure you want to remove this entry from the current invoice?</h2>
        </div>
    </div>

    <div class="row">
        <div class="span12">
            <h3>Invoice</h3>
            {% include 'timepiece/time-sheet/invoice/_invoice_detail.html' %}
        </div>
    </div>

    <div class="row">
        <div class="span12">
            <h3>Entry</h3>
            <table class="table table-bordered">
                <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>
                    <tr>
                        <td>{{ entry.start_time|date:"m/d/Y (D)" }}</td>
                        <td>{{ entry.user.get_full_name }} </td>
                        <td>{{ entry.start_time|date:"P" }} - {{ entry.end_time|date:"P" }} </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>
                </tbody>
            </table>
        </div>
    </div>

    <div class="row">
        <div class="span6">
            <form class="form-inline" method="post">
                {% csrf_token %}
                <input class="btn" type='button' value='Cancel' onclick='history.go(-1)' />
                <input class="btn" type='submit' name='submit' value='Remove Entry &rarr;' />
            </form>
        </div>
    </div>
{% endblock %}
