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
42 changes: 23 additions & 19 deletions src/staff/templates/staff/analysisorder_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,15 @@


{% 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">Samples to analyze</h5>
<div class="bg-white p-4">
<p>Selected {{ object.samples.count }} samples</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-analysis-list' %}"><i class="fas fa-arrow-left"></i> back</a>
<a class="btn bg-primary" href="{% url 'staff:order-analysis-samples' pk=object.id %}">Samples</a>

<a class="btn bg-primary" href="{% url 'staff:order-extraction-detail' pk=extraction_order.id %}">Go to {{ extraction_order}}</a>

<a class="btn bg-primary" href="{% url 'staff:order-add-staff' pk=object.id %}">Assign staff</a>

<div class="ml-auto"></div>
Expand All @@ -42,4 +27,23 @@ <h5 class="text-2xl my-5">Samples to analyze</h5>
{% 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">Samples to analyze</h5>
<div class="bg-white p-4">
<p>Selected {{ object.samples.count }} samples</p>
</div>

{% endblock %}
30 changes: 22 additions & 8 deletions src/staff/templates/staff/extractionorder_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,29 @@ <h3 class="text-4xl mb-5">Order {{ object }}</h3>
<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>
<div class="relative inline-block text-left">
<button type="button"
onclick="document.getElementById('dropdown-menu').classList.toggle('hidden')"
class="btn bg-primary"
>
Go to Analysis Order
<i class="fa-solid fa-chevron-down"></i>
</button>

<div id="dropdown-menu"
class="absolute z-10 mt-2 w-56 origin-top-right rounded-md bg-white shadow-lg hidden"
role="menu" aria-orientation="vertical" aria-labelledby="dropdownMenuButton">
{% for ao in analysis_orders %}
<a href="{% url 'staff:order-analysis-detail' pk=ao.id %}"
class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100"
role="menuitem">
{{ ao }}
</a>
{% endfor %}
</div>
</div>
{% 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>
<a class="btn bg-primary" 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>

Expand All @@ -38,7 +53,6 @@ <h3 class="text-4xl mb-5">Order {{ object }}</h3>
{% 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 %}
Expand Down
6 changes: 6 additions & 0 deletions src/staff/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ def get_queryset(self) -> models.QuerySet[EquipmentOrder]:
class AnalysisOrderDetailView(StaffMixin, DetailView):
model = AnalysisOrder

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


class EquipmentOrderDetailView(StaffMixin, DetailView):
model = EquipmentOrder
Expand Down