{% extends edc_lab_listboard_template %}

{% block panel_back %}
    <a title="Back to manifests" role="button" class="btn btn-default btn-sm"
        href="{% url manifest_listboard_url %}"><i class="fas fa-reply fa-fw"></i>
    </a>
{% endblock panel_back %}


{% block panel_description %}
     <span class="label label-success">Manifest</span>
     <span class="text text-identifier"><strong>{{ manifest.human_readable_identifier }}</strong></span>
     <span class="label label-success">Date</span> {{ manifest.object.manifest_datetime|date:"Y-m-d" }}
{% endblock panel_description %}

{% block results_panel_form %}

    <form action="{{ form_action_url_reversed }}" method="post" id="{{ form_action_name }}" name="{{ form_action_name }}">
    <div class="form-group form-inline">
        <div class="input-group input-group-sm">
        <input class="form-control" type="text" form="{{ form_action_name }}" id="manifest_item_identifier" name="manifest_item_identifier" placeholder="box identifier" autofocus />
        <div class="input-group-btn">
        <button type="submit" class="btn btn-default btn-sm" id="action" name="action" value="add_item" form="{{ form_action_name }}">
             <i class="fas fa-plus fa-sm"></i>
        </button>
        </div>
        </div>
        <button type="submit" class="btn btn-default btn-sm" id="action" name="action" value="remove_selected_items" form="{{ form_action_name }}">
             <span class="text text-danger"><i class="fas fa-window-close fa-sm"></i></span> &nbsp;Remove selected
        </button>
    </div>
    {% csrf_token %}
    </form>
{% endblock results_panel_form %}

{% block results_header %}
    {% include 'edc_lab_dashboard/listboard/pack/results_header.html' %}
{% endblock results_header %}

{% block results_body %}
    {% for wrapped in object_list %}
    <tr>
 	    <!--counter-->
	    <td>{{ page_obj.start_index|add:forloop.counter0 }}</td>
	    <!--buttons-->
    <!-- begin columns -->

    <td>
      <input id="selected_item_{{wrapped.object.id}}"  form="{{ form_action_name }}" name="{{ form_action_selected_items_name }}" type="checkbox" value="{{wrapped.object.id}}" />
    </td>
    <td>
      <span class="text text-identifier">
      {{ wrapped.box.human_readable_identifier }}
      </span>
    </td>
    <td>
      {{ wrapped.box.category|upper }}
    </td>
    <td>
      <span class="text text-identifier">
      {{ wrapped.box.box_datetime|date:"Y-m-d" }}
      </span>
    </td>
    <td>
      {{ wrapped.box.count }}/{{ wrapped.box.box_type.total }}&nbsp;
      ({{ wrapped.box.specimen_types }})
    </td>
    <td>
      {{ wrapped.box.get_status_display }}
    </td>
    <td>
      {{ wrapped.box.user_created }}
    </td>
    <td>
      {{ wrapped.box.hostname_created}}
    </td>

<!-- end columns -->

  </tr>

{% endfor %}


{% endblock results_body %}
