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

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

{% block details %}
    <ul class="nav nav-tabs" role="tablist">
         <li class="nav-item" role="presentation">
            <a class="nav-link active" aria-controls="tab-library" role="tab" type="button" data-bs-toggle="tab" data-bs-target="#tab-library">
                {% translate "Library" %}
            </a>
        </li>
        {% if perms.blueprints.request_blueprints %}
             <li class="nav-item" role="presentation">
                <a class="nav-link" aria-controls="tab-user-requests" role="tab" type="button" data-bs-toggle="tab" data-bs-target="#tab-user-requests">
                    {% translate "My Requests" %}
                </a>
            </li>
        {% endif %}
        {% if perms.blueprints.manage_requests %}
             <li class="nav-item" role="presentation">
                <a class="nav-link" aria-controls="tab-open-requests" role="tab" type="button" data-bs-toggle="tab" data-bs-target="#tab-open-requests">
                    {% translate "Open Requests" %}
                    {% if request_count %}
                        <span class="badge text-bg-info badge-nav">{{ request_count }}</span>
                    {% endif %}
                </a>
            </li>
        {% endif %}
        {% if perms.blueprints.add_personal_blueprint_owner or perms.blueprints.add_corporate_blueprint_owner %}
             <li class="nav-item" role="presentation">
                <a class="nav-link" aria-controls="tab-manage-blueprints" role="tab" type="button" data-bs-toggle="tab" data-bs-target="#tab-manage-blueprints">
                    {% translate "Manage Blueprints" %}
                </a>
            </li>
        {% endif %}
    </ul>

    <div class="card card-default card-tabs tab-content border-0">
        <div class="card-body">
            <div class="tab-content">
                {% include 'blueprints/partials/tabs/libary.html' %}

                {% if perms.blueprints.request_blueprints %}
                    {% include 'blueprints/partials/tabs/user-requests.html' %}
                {% endif %}

                {% if perms.blueprints.manage_requests %}
                    {% include 'blueprints/partials/tabs/open-requests.html' %}
                {% endif %}

                {% if perms.blueprints.add_personal_blueprint_owner or perms.blueprints.add_corporate_blueprint_owner %}
                    {% include 'blueprints/partials/tabs/manage-blueprints.html' %}
                {% endif %}
            </div>
        </div>
    </div>

    {% include 'blueprints/modals/modal_dialog.html' with name="ViewBlueprint" %}
    {% include 'blueprints/modals/modal_dialog.html' with name="ViewRequest" %}
{% endblock %}

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

    {% sri_static 'blueprints/css/blueprints.css' %}
{% endblock %}

{% block extra_javascript %}
    {% include 'bundles/datatables-js-bs5.html' %}
    {% include 'bundles/datatables-css-bs5.html' %}
    <script type="application/javascript" src="{% static 'blueprints/vendor/filterdropdown/filterDropDown.min.js' %}"></script>
    {% include "blueprints/bundles/settings.html" %}
{% endblock %}

{% block extra_script %}
{% endblock %}
