{% load i18n %}
{% load inventree_extras %}

{% define item.pk as pk %}

<div class="panel panel-default" id='allocation-panel-{{ pk }}'>
    <div class="panel-heading" role="tab" id="heading-{{ pk }}">
      <div class="panel-title">
          <div class='row'>
              <a class='collapsed' aria-expanded='false' role="button" data-toggle="collapse" data-parent="#build-output-accordion" href="#collapse-{{ pk }}" aria-controls="collapse-{{ pk }}">
                <div class='col-sm-4'>
                    <span class='fas fa-caret-right'></span>
                    {{ item.part.full_name }}
                </div>
                <div class='col-sm-2'>
                    {% if item.serial %}
                    # {{ item.serial }}
                    {% else %}
                    {% decimal item.quantity %}
                    {% endif %}
                </div>
            </a>
            <div class='col-sm-3'>
                <div>
                    <div id='output-progress-{{ pk }}'>
                        <span class='fas fa-spin fa-spinner'></span>
                    </div>
                </div>
            </div>
            <div class='col-sm-3'>
                <div class='btn-group float-right' id='output-actions-{{ pk }}'>
                    <span class='fas fa-spin fa-spinner'></span>
                </div>
            </div>
        </div>
    </div>
    </div>
    <div id="collapse-{{ pk }}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading-{{ pk }}">
      <div class="panel-body">
          <table class='table table-striped table-condensed' id='allocation-table-{{ pk }}'></table>
      </div>
    </div>
  </div>