{% extends 'pagination/pagination_base.html' %}
{% load custom_tags_and_filters %}
{% block title %}Custom charges{% endblock %}
{% block before_pagination %}
    <div class="row">
        <div class="col-xs-7">
            <h1>Custom charges</h1>
        </div>
        <div class="col-sm-5 text-right">
            <h1>{% button type="add" url="create_custom_charge" value="New custom charge" %}</h1>
        </div>
    </div>
{% endblock %}
{% block pagination_content %}
    <table class="table table-bordered table-striped table-condensed thead-light">
        <thead>
            <tr>
                <th>{% include 'pagination/pagination_column.html' with order_by="name" name='Name' %}</th>
                <th>{% include 'pagination/pagination_column.html' with order_by="date" name='Date' %}</th>
                <th>{% include 'pagination/pagination_column.html' with order_by="project" name='Project' %}</th>
                <th>{% include 'pagination/pagination_column.html' with order_by="customer" name='Customer' %}</th>
                <th>{% include 'pagination/pagination_column.html' with order_by="amount" name='Amount' %}</th>
                <th>{% include 'pagination/pagination_column.html' with order_by="creator" name='Created By' %}</th>
                {% if core_facilities_exist %}
                    <th>{% include 'pagination/pagination_column.html' with order_by="core_facility" name='Core Facility' %}</th>
                {% endif %}
                <th>{% include 'pagination/pagination_column.html' with order_by="additional_details" name='Description' %}</th>
            </tr>
        </thead>
        <tbody>
            {% for custom_charge in page %}
                <tr>
                    <td>{{ custom_charge.name }}</td>
                    <td>{{ custom_charge.date|date:"SHORT_DATETIME_FORMAT" }}</td>
                    <td>{{ custom_charge.project }}</td>
                    <td>{{ custom_charge.customer }}</td>
                    <td>{{ custom_charge.amount }}</td>
                    <td>{{ custom_charge.creator }}</td>
                    {% if core_facilities_exist %}<td>{{ custom_charge.core_facility|default_if_none:"" }}</td>{% endif %}
                    <td>{{ custom_charge.additional_details|default_if_none:"" }}</td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
{% endblock %}
{% block table_empty_content %}No custom charges have been saved yet.{% endblock %}
