{% extends 'base_client.html' %}
{% load widget_tweaks %}

{% block title %}
    {% if event.is_rig %}N{{ event.pk|stringformat:"05d" }}{% else %}{{ event.pk }}{% endif %} | {{ event.name }}
{% endblock %}

{% block content %}
    <div class="row">
        <div class="col-sm-12">
            <h1>
                {% if event.is_rig %}N{{ event.pk|stringformat:"05d" }}{% else %}{{ event.pk }}{% endif %}
                | {{ event.name }} {% if event.dry_hire %}<span class="badge">Dry Hire</span>{% endif %}
            </h1>
        </div>
    </div>

    {% include 'RIGS/client_eventdetails.html' %}

    <div class="row">
        <div class="col-sm-12">
            {% with object=event %}
                {% include 'RIGS/item_table.html' %}
            {% endwith %}
        </div>
    </div>

    <div class="row">
        <div class="col-sm-12">
            <div class="panel panel-default">
                <div class="panel-heading">Event Authorisation</div>

                <div class="panel-body">
                    <div class="row">
                        <div class="col-sm-12 col-md-6">
                            <dl class="dl-horizontal">
                                <dt>Name</dt>
                                <dd>{{ object.name }}</dd>

                                <dt>Email</dt>
                                <dd>{{ object.email }}</dd>

                                {% if internal %}
                                    <dt>University ID</dt>
                                    <dd>{{ object.uni_id }}</dd>
                                {% endif %}
                            </dl>
                        </div>

                        <div class="col-sm-12 col-md-6">
                            <dl class="dl-horizontal">
                                <dt>Account code</dt>
                                <dd>{{ object.account_code }}</dd>

                                <dt>Authorised amount</dt>
                                <dd>£ {{ object.amount|floatformat:2 }}</dd>
                            </dl>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
