{% extends 'blueprints/base.html' %}
{% load i18n %}
{% load humanize %}
{% load static %}
{% block details %}

<div class="panel panel-primary">
    <div class="panel-heading">
        <h3 class="panel-title">{% translate "Blueprints" %}</h3>
    </div>

    <div class="panel-body" style="min-height: 100px">
        <span class="pull-right">
            {% if perms.blueprints.add_blueprint_owner %}
            <a class="btn btn-success btn-tabs" href="{% url 'blueprints:add_blueprint_owner' %}">
                {% translate "Add Blueprint Owner" %}
            </a>
            {% endif %}
        </span>

        <!-- Main structure table -->
        <table id="tab_blueprints" style="width: 100%" class="table table-striped table-compact">
            <thead>
                <tr>
                    <th></th>
                    <th>{% translate "Type" %}</th>
                    <th>{% translate "Location" %}</th>
                    <th>{% translate "Owner" %}</th>
                    <th>{% translate "Material Efficiency" %}</th>
                    <th>{% translate "Time Efficiency" %}</th>
                    <th>{% translate "Original" %}</th>
                    <th>{% translate "Runs Remaining" %}</th>
                </tr>
            </thead>
        </table>
    </div>
</div>

{% endblock %}
{% block extra_javascript %}

{% include 'bundles/datatables-js.html' %}
    <script type="application/javascript" src="{% static 'js/filterDropDown/filterDropDown.min.js' %}" ></script>

    <script type="application/javascript">
        let listDataUrl = '{% url "blueprints:list_data" %}';
        {% if active_tags %}
            listDataUrl += '?tags={{ active_tags|join:"," }}'
        {% endif %}

        let blueprintsDataTableSettings = {
            listDataurl: listDataUrl,
            dataTablesPageLength: {{ data_tables_page_length }},
            dataTablesPaging: {{ data_tables_paging|yesno:"true,false" }}
        };
    </script>
    <script type="application/javascript" src="{% static 'blueprints/blueprint_list.js' %}" ></script>
{% endblock %}

{% block extra_css %}
{% endblock %}

{% block extra_script %}
{% endblock %}
