Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 29 additions & 19 deletions src/staff/templates/staff/extractionorder_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,22 @@


{% block content %}
{% fragment as table_header %}
{% #table-cell header=True %}GUID{% /table-cell %}
{% #table-cell header=True %}Type{% /table-cell %}
{% #table-cell header=True %}Species{% /table-cell %}
{% #table-cell header=True %}Markers{% /table-cell %}
{% #table-cell header=True %}Location{% /table-cell %}
{% #table-cell header=True %}Date{% /table-cell %}
{% #table-cell header=True %}Volume{% /table-cell %}
{% endfragment %}
<h3 class="text-4xl mb-5">Order {{ object }}</h3>
<div class="flex gap-5 mb-5">
</div>

{% object-detail object=object %}


<h5 class="text-2xl my-5">Delivered Samples</h5>
<div class="bg-white p-4">
<p>{{ object.samples.count }} samples were delivered</p>
</div>
<div class="flex gap-5 mb-5"></div>

<div class="flex gap-5 my-5">
<a class="btn bg-yellow-200" href="{% url 'staff:order-extraction-list' %}"><i class="fas fa-arrow-left"></i> back</a>
<a class="btn bg-primary" href="{% url 'staff:order-extraction-samples' pk=object.id %}">Samples</a>
{% if analysis_orders|length > 1 %}
<select id="analysis-select" class="btn bg-yellow-200" onchange="if(this.value) { window.location.href = this.value; }" style="width: 13rem;">
<option value="">Go to Analysis Order</option>
{% for ao in analysis_orders %}
<option value="{% url 'staff:order-analysis-detail' pk=ao.id %}">{{ ao }}</option>
{% endfor %}
</select>
{% elif analysis_orders|length == 1 %}
<a class="btn bg-yellow-200" href="{% url 'staff:order-analysis-detail' pk=analysis_orders.first.id %}">Go to {{ analysis_orders.first}}</a>
{% endif %}
<a class="btn bg-primary" href="{% url 'staff:order-add-staff' pk=object.id %}">Assign staff</a>

<div class="ml-auto"></div>
Expand All @@ -46,5 +38,23 @@ <h5 class="text-2xl my-5">Delivered Samples</h5>
{% action-button action=to_next_status_url class="bg-secondary text-white" submit_text=btn_name csrf_token=csrf_token %}
{% endwith %}
{% endif %}

</div>

{% fragment as table_header %}
{% #table-cell header=True %}GUID{% /table-cell %}
{% #table-cell header=True %}Type{% /table-cell %}
{% #table-cell header=True %}Species{% /table-cell %}
{% #table-cell header=True %}Markers{% /table-cell %}
{% #table-cell header=True %}Location{% /table-cell %}
{% #table-cell header=True %}Date{% /table-cell %}
{% #table-cell header=True %}Volume{% /table-cell %}
{% endfragment %}

{% object-detail object=object %}

<h5 class="text-2xl my-5">Delivered Samples</h5>
<div class="bg-white p-4">
<p>{{ object.samples.count }} samples were delivered</p>
</div>
{% endblock %}
6 changes: 6 additions & 0 deletions src/staff/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ class EquipmentOrderDetailView(StaffMixin, DetailView):
class ExtractionOrderDetailView(StaffMixin, DetailView):
model = ExtractionOrder

def get_context_data(self, **kwargs: Any) -> dict[str, Any]:
context = super().get_context_data(**kwargs)
extraction_order = self.object
context["analysis_orders"] = extraction_order.analysis_orders.all()
return context


class OrderExtractionSamplesListView(StaffMixin, SingleTableMixin, FilterView):
table_pagination = False
Expand Down