Added html links for equipment/processes/tips.

This commit is contained in:
lwark
2025-04-25 15:22:33 -05:00
parent b9ed4eef94
commit b42a7ab100
12 changed files with 378 additions and 15 deletions

View File

@@ -20,19 +20,19 @@
{% if sub['reagents'] %}
<h3><u>Reagents:</u></h3>
<p>{% for item in sub['reagents'] %}
&nbsp;&nbsp;&nbsp;&nbsp;<b>{{ item['role'] }}</b>: <a class="data-link reagent" id="{{ item['lot'] }}">{{ item['lot'] }} (EXP: {{ item['expiry'] }})</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;<b>{{ item['role'] }}:</b> <a class="data-link reagent" id="{{ item['lot'] }}">{{ item['lot'] }} (EXP: {{ item['expiry'] }})</a><br>
{% endfor %}</p>
{% endif %}
{% if sub['equipment'] %}
<h3><u>Equipment:</u></h3>
<p>{% for item in sub['equipment'] %}
&nbsp;&nbsp;&nbsp;&nbsp;<b>{{ item['role'] }}:</b> {{ item['name'] }} ({{ item['asset_number'] }}): {{ item['processes'][0]|replace('\n\t', '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;') }}<br>
&nbsp;&nbsp;&nbsp;&nbsp;<b>{{ item['role'] }}:</b> <a class="data-link equipment" id="{{ item['name'] }}"> {{ item['name'] }} ({{ item['asset_number'] }})</a>: <a class="data-link process" id="{{ item['processes'][0]|replace('\n\t', '') }}">{{ item['processes'][0]|replace('\n\t', '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;') }}</a><br>
{% endfor %}</p>
{% endif %}
{% if sub['tips'] %}
<h3><u>Tips:</u></h3>
<p>{% for item in sub['tips'] %}
&nbsp;&nbsp;&nbsp;&nbsp;<b>{{ item['role'] }}:</b> {{ item['name'] }} ({{ item['lot'] }})<br>
&nbsp;&nbsp;&nbsp;&nbsp;<b>{{ item['role'] }}:</b> <a class="data-link tips" id="{{ item['lot'] }}">{{ item['name'] }} ({{ item['lot'] }})</a><br>
{% endfor %}</p>
{% endif %}
{% if sub['samples'] %}
@@ -99,6 +99,33 @@
})
}
var equipmentSelection = document.getElementsByClassName('equipment');
for(let i = 0; i < equipmentSelection.length; i++) {
equipmentSelection[i].addEventListener("click", function() {
console.log(equipmentSelection[i].id);
backend.equipment_details(equipmentSelection[i].id);
})
}
var processSelection = document.getElementsByClassName('process');
for(let i = 0; i < processSelection.length; i++) {
processSelection[i].addEventListener("click", function() {
console.log(processSelection[i].id);
backend.process_details(processSelection[i].id);
})
}
var tipsSelection = document.getElementsByClassName('tips');
for(let i = 0; i < tipsSelection.length; i++) {
tipsSelection[i].addEventListener("click", function() {
console.log(tipsSelection[i].id);
backend.tips_details(tipsSelection[i].id);
})
}
document.getElementById("sign_btn").addEventListener("click", function(){
backend.sign_off("{{ sub['plate_number'] }}");
});