{% extends 'blueprints/base.html' %}

{% load i18n %}
{% load humanize %}
{% load static %}

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

        <div class="panel-body">
            <div 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 %}
            </div>

            <!-- 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><abbr title="{% translate 'Quantity' %}">{% translate "Qty" %}</abbr></th>
                        <th>{% translate "Owner" %}</th>
                        <th><abbr title="{% translate 'Material Efficiency' %}">
                            {% comment %}Translators: Abbreviation for "Material Efficiency"{% endcomment %}
                            {% translate 'ME' %}
                        </abbr></th>
                        <th><abbr title="{% translate 'Time Efficiency' %}">
                            {% comment %}Translators: Abbreviation for "Time Efficiency"{% endcomment %}
                            {% translate 'TE' %}
                        </abbr></th>
                        <th>{% translate "Original" %}</th>
                        <th>{% translate "Runs Remaining" %}</th>
                    </tr>
                </thead>
            </table>
        </div>
    </div>
{% endblock %}

{% block extra_css %}
    {% include 'bundles/datatables-css.html' %}

    <link rel="stylesheet" href="{% static 'blueprints/css/aa-bootstrap-fix.min.css' %}" type="text/css">
    <link rel="stylesheet" href="{% static 'blueprints/css/blueprints.css' %}" type="text/css">
{% 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" }},
            translation: {
                filterLocation: '{% translate "Location" %}',
                filterIsOriginal: '{% translate "Is BPO?" %}'
            }
        };
    </script>
    <script type="application/javascript" src="{% static 'blueprints/js/blueprint_list.js' %}" ></script>
{% endblock %}

{% block extra_script %}
{% endblock %}
