{% extends 'backOffice/baseAuthenticated.html.twig' %}
{% import 'backOffice/util/_paginationHelpers.html.twig' as paginationHelpers %}
{% import 'backOffice/assays/_helpers.html.twig' as assayHelpers %}
{% if customer is not null %}
{% set page_title %}
Assays for
<span class="text-black-50">{{ customer.firstName }} {{ customer.lastName }}</span>
{% endset %}
{% else %}
{% set page_title = "Assays" %}
{% endif %}
{% if protocol is not null %}
{% set page_title %}
{{ page_title }}<br/>
<small>
Protocol <span class="text-black-50">{{ protocol.sku }}</span>
</small>
{% endset %}
{% endif %}
{% if qrData is not null %}
{% set page_title %}
{{ page_title }}<br/>
<small>
Assays for <span class="text-black-50">{{ qrData.email }}</span>
</small>
{% endset %}
{% endif %}
{#% block actions %}
<a type="button"
class="btn btn-outline-primary"
href="#"
data-toggle="collapse"
data-target="#collapseFilters">
<span class="fa fa-filter"></span>
Filter
</a>
{% endblock %}
{% block filters %}
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="SKU">Protocol SKU</label>
<input type="text" class="form-control" id="SKU" placeholder="Search by SKU...">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="customer">Customer</label>
<input type="text" class="form-control" id="SKU" placeholder="Search by client name...">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="date">Date</label>
<input type="date" class="form-control" id="date" placeholder="DD/MM/YYYY">
</div>
</div>
<div class="col-md-1">
<div class="form-group">
<label> </label>
<button type="submit" class="btn btn-primary">
<span class="fa fa-search"></span>
</button>
</div>
</div>
</div>
{% endblock %#}
{% block actions %}
<a class="btn btn-primary"
href="{{ path('app_backoffice_assaydownload_index', {'_format': 'csv'})}}">
Download Assays
</a>
{% endblock %}
{% block body %}
{{ form_start(filterForm) }}
{{ include('backOffice/assays/_form.html.twig', {'filterForm': filterForm}) }}
<div class="row mt-3">
<div class="col-auto">
{{ form_row(filterForm.submit,{ 'label': 'Search', 'attr': {'class': 'btn btn-primary'} }) }}
</div>
<div class="col-auto">
<a class="btn btn-primary"
href="{{ path('app_backoffice_assays_index')}}">
Clear Filters
</a>
</div>
</div>
{{ form_end(filterForm) }}
{{ paginationHelpers.showing_label(assays) }}
<hr>
<div class="card card-table">
<div class="table-responsive">
<table class="table table-striped table-borderless mb-0">
<thead>
<tr>
<th>ID</th>
<th>SKU</th>
<th>Batch</th>
<th>Sample ID</th>
<th>MAC ID</th>
<th>Date</th>
<th>Status</th>
<th></th>
</tr>
</thead>
<tbody class="no-border-x">
{% for assay in assays.items %}
<tr>
<td>{{ assay.assayId }}</td>
<td>
{{ assay.protocol.sku }}
{% if protocol is not null %}
(v{{ assay.protocol.version }})
{% endif %}
</td>
<td>{{ assay.batch }}</td>
<td>{{ assay.sampleId }}</td>
<td>{{ assay.hardwareVersion }}</td>
<td>{{ assay.createdAt | date }}</td>
<td>{{ assayHelpers.assay_status_or_result(assay) }}</td>
<td class="text-right">
<a
href="{{ path('app_backoffice_assays_get', {'assayId': assay.assayId}) }}"
data-toggle="tooltip"
data-placement="left"
data-title="View">
<span class="fa fa-eye"></span>
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{{ pagination_render(assays) }}
{% endblock %}