Updates to details interface.

This commit is contained in:
lwark
2025-07-16 14:12:03 -05:00
parent 02c88256f2
commit 53c6668ce1
12 changed files with 276 additions and 71 deletions

View File

@@ -16,22 +16,22 @@
</p>
{% if clientsubmission['sample'] %}
<button type="button" class="collapsible"><h3><u>Client Submitted Samples:</u></h3></button>
<div class="nested">
<button type="button"><h3><u>Client Submitted Samples:</u></h3></button>
<!-- <div class="nested">-->
<p>{% for sample in clientsubmission['sample'] %}
&nbsp;&nbsp;&nbsp;&nbsp;<a class="data-link sample" id="{{ sample['sample_id'] }}">{{ sample['sample_id']}}</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="data-link sample" id="{{ sample['sample_id'] }}">{{ sample['sample_id'] }}</a><br>
{% endfor %}</p>
</div>
<!-- </div>-->
{% endif %}
{% if clientsubmission['run'] %}
<button type="button" class="collapsible"><h3><u>Runs:</u></h3></button>
<div class="nested">
<button type="button"><h3><u>Runs:</u></h3></button>
<!-- <div class="nested">-->
{% for run in clientsubmission['run'] %}
{% with run=run, child=True %}
{% include "run_details.html" %}
{% endwith %}
{% endfor %}
</div>
<!-- </div>-->
{% endif %}
{% endblock %}
</body>

View File

@@ -24,23 +24,7 @@
{% block script %}
{% if not child %}
<!--<script>-->
<!--var coll = document.getElementsByClassName("collapsible");-->
<!--var i;-->
<!--for (i = 0; i < coll.length; i++) {-->
<!-- coll[i].addEventListener("click", function() {-->
<!-- this.classList.toggle("active");-->
<!-- var content = this.nextElementSibling;-->
<!-- if (content.style.display === "block") {-->
<!-- content.style.display = "none";-->
<!-- } else {-->
<!-- content.style.display = "block";-->
<!-- }-->
<!-- });-->
<!--}-->
<!--</script>-->
<!--{% endif %}-->
{% for j in js%}
<script>
@@ -48,6 +32,7 @@
</script>
{% endfor %}
{% endif %}
{% endblock %}
{% if not child %}
</html>

View File

@@ -15,23 +15,51 @@
<p>{% for key, value in procedure.items() if key not in procedure['excluded'] %}
&nbsp;&nbsp;&nbsp;&nbsp;<b>{{ key | replace("_", " ") | title | replace("Pcr", "PCR") }}: {{ value }}</b><br>
{% endfor %}</p>
{% if procedure['reagent'] %}
<button type="button"><h3><u>Reagents:</u></h3></button>
&nbsp;&nbsp;&nbsp;&nbsp;<table style="border: 1px solid black; width: 100%; text-align: center">
<tr>
<th style="border: 1px solid black;">Reagent Role</th>
<th style="border: 1px solid black;">Reagent Name</th>
<th style="border: 1px solid black;">Lot</th>
<th style="border: 1px solid black;">Expiry</th>
</tr>
{% for reg in procedure['reagent'] %}
{% with reagent=reg, child=True %}
{% include "support/reagent_list.html" %}
{% endwith %}
{% endfor %}</p>
</table><br/>
{% endif %}
{% if procedure['equipment'] %}
<button type="button"><h3><u>Equipment:</u></h3></button>
&nbsp;&nbsp;&nbsp;&nbsp;<table style="border: 1px solid black; width: 100%; text-align: center">
<tr>
<th style="border: 1px solid black;">Equipment Role</th>
<th style="border: 1px solid black;">Equipment Name</th>
<th style="border: 1px solid black;">Process</th>
<th style="border: 1px solid black;">Tips</th>
</tr>
{% for eq in procedure['equipment'] %}
{% with equipment=eq, child=True %}
{% include "support/equipment_list.html" %}
{% endwith %}
{% endfor %}
</table><br/>
{% endif %}
{% if procedure['results'] %}
<button type="button" class="collapsible"><h3><u>Results:</u></h3></button>
<div class="nested">
<button type="button"><h3><u>Results:</u></h3></button>
{% for result in procedure['results'] %}
<p>{% for k, v in result['result'].items() %}
<b>{{ key | replace("_", " ") | title | replace("Rsl", "RSL") }}:</b> {{ value }}<br>
{% endfor %}</p>
{% endfor %}
</div>
{% endif %}
{% if procedure['sample'] %}
<button type="button" class="collapsible"><h3><u>Procedure Samples:</u></h3></button>
<div class="nested">
<button type="button"><h3><u>Procedure Samples:</u></h3></button>
<p>{% for sample in procedure['sample'] %}
&nbsp;&nbsp;&nbsp;&nbsp;<a class="{% if sample['active'] %}data-link {% else %}unused {% endif %}sample" id="{{ sample['sample_id'] }}">{{ sample['sample_id']}}</a><br>
{% endfor %}</p>
</div>
{% endif %}
{% endblock %}

View File

@@ -15,24 +15,22 @@
&nbsp;&nbsp;&nbsp;&nbsp;<b>{{ key | replace("_", " ") | title | replace("Rsl", "RSL") }}:</b> {{ value }}<br>
{% endfor %}</p>
{% if run['sample'] %}
<button type="button" class="collapsible"><h3><u>Run Samples:</u></h3></button>
<button type="button"><h3><u>Run Samples:</u></h3></button>
<p>{% for sample in run['sample'] %}
&nbsp;&nbsp;&nbsp;&nbsp;<a class="{% if sample['active'] %}data-link {% else %}unused {% endif %}sample" id="{{ sample['sample_id'] }}">{{ sample['sample_id']}}</a><br>
{% endfor %}</p>
{% endif %}
{% if run['procedure'] %}
<button type="button" class="collapsible"><h3><u>Procedures:</u></h3></button>
<div class="nested">
<button type="button"><h3><u>Procedures:</u></h3></button>
{% for procedure in run['procedure'] %}
{% with procedure=procedure, child=True %}
{% include "procedure_details.html" %}
{% endwith %}
{% endfor %}
</div>
{% endif %}
{% endblock %}
{% block signing_button %}
<button type="button" id="sign_btn" {% if run['permission'] and not run['signed_by'] %}{% else %}hidden{% endif %}>Sign Off</button>
<button type="button" id="sign_btn"{% if run['permission'] and not run['signed_by'] %}{% else %} hidden{% endif %}>Sign Off</button>
{% endblock %}
<br>
@@ -55,5 +53,3 @@
});
</script>
{% endblock %}

View File

@@ -0,0 +1,6 @@
<tr>
<td style="border: 1px solid black;">{{ reagent['reagentrole'] }}</td>
<td style="border: 1px solid black;">{{ reagent['name'] }}</td>
<td style="border: 1px solid black;">{{ reagent['lot'] }}</td>
<td style="border: 1px solid black;">{{ reagent['expiry'].strftime('%Y-%m-%d') }}</td>
</tr>