Added html links for equipment/processes/tips.
This commit is contained in:
@@ -20,19 +20,19 @@
|
||||
{% if sub['reagents'] %}
|
||||
<h3><u>Reagents:</u></h3>
|
||||
<p>{% for item in sub['reagents'] %}
|
||||
<b>{{ item['role'] }}</b>: <a class="data-link reagent" id="{{ item['lot'] }}">{{ item['lot'] }} (EXP: {{ item['expiry'] }})</a><br>
|
||||
<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'] %}
|
||||
<b>{{ item['role'] }}:</b> {{ item['name'] }} ({{ item['asset_number'] }}): {{ item['processes'][0]|replace('\n\t', '<br> ') }}<br>
|
||||
<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> ') }}</a><br>
|
||||
{% endfor %}</p>
|
||||
{% endif %}
|
||||
{% if sub['tips'] %}
|
||||
<h3><u>Tips:</u></h3>
|
||||
<p>{% for item in sub['tips'] %}
|
||||
<b>{{ item['role'] }}:</b> {{ item['name'] }} ({{ item['lot'] }})<br>
|
||||
<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'] }}");
|
||||
});
|
||||
|
||||
50
src/submissions/templates/equipment_details.html
Normal file
50
src/submissions/templates/equipment_details.html
Normal file
@@ -0,0 +1,50 @@
|
||||
{% extends "details.html" %}
|
||||
<head>
|
||||
{% block head %}
|
||||
{{ super() }}
|
||||
<title>Equipment Details for {{ equipment['name'] }}</title>
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block body %}
|
||||
<h2><u>Equipment Details for {{ equipment['name'] }}</u></h2>
|
||||
{{ super() }}
|
||||
<p>{% for key, value in equipment.items() if key not in equipment['excluded'] %}
|
||||
<!-- <b>{{ key | replace("_", " ") | title }}: </b>{% if permission and key in reagent['editable']%}<input type={% if key=='expiry' %}"date"{% else %}"text"{% endif %} id="{{ key }}" name="{{ key }}" value="{{ value }}">{% else %}{{ value }}{% endif %}<br>-->
|
||||
<b>{{ key | replace("_", " ") | title }}: </b>{{ value }}<br>
|
||||
{% endfor %}</p>
|
||||
<!-- {% if permission %}-->
|
||||
<!-- <button type="button" id="save_btn">Save</button>-->
|
||||
<!-- {% endif %}-->
|
||||
{% if equipment['submissions'] %}<h2>Submissions:</h2>
|
||||
{% for submission in equipment['submissions'] %}
|
||||
<p><b><a class="data-link" id="{{ submission['plate'] }}">{{ submission['plate'] }}:</a></b> <a class="data-link process" id="{{ submission['process'] }}">{{ submission['process'] }}</a></p>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
<script>
|
||||
{% block script %}
|
||||
{{ super() }}
|
||||
|
||||
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);
|
||||
})
|
||||
}
|
||||
|
||||
{% for submission in equipment['submissions'] %}
|
||||
document.getElementById("{{ submission }}").addEventListener("click", function(){
|
||||
backend.submission_details("{{ submission }}");
|
||||
});
|
||||
{% endfor %}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
backend.activate_export(false);
|
||||
}, false);
|
||||
{% endblock %}
|
||||
</script>
|
||||
</html>
|
||||
49
src/submissions/templates/process_details.html
Normal file
49
src/submissions/templates/process_details.html
Normal file
@@ -0,0 +1,49 @@
|
||||
{% extends "details.html" %}
|
||||
<head>
|
||||
{% block head %}
|
||||
{{ super() }}
|
||||
<title>Process Details for {{ process['name'] }}</title>
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block body %}
|
||||
<h2><u>Process Details for {{ process['name'] }}</u></h2>
|
||||
{{ super() }}
|
||||
<p>{% for key, value in process.items() if key not in process['excluded'] %}
|
||||
<!-- <b>{{ key | replace("_", " ") | title }}: </b>{% if permission and key in reagent['editable']%}<input type={% if key=='expiry' %}"date"{% else %}"text"{% endif %} id="{{ key }}" name="{{ key }}" value="{{ value }}">{% else %}{{ value }}{% endif %}<br>-->
|
||||
<b>{{ key | replace("_", " ") | title }}: </b>{{ value }}<br>
|
||||
{% endfor %}</p>
|
||||
<!-- {% if permission %}-->
|
||||
<!-- <button type="button" id="save_btn">Save</button>-->
|
||||
<!-- {% endif %}-->
|
||||
{% if process['submissions'] %}<h2>Submissions:</h2>
|
||||
{% for submission in process['submissions'] %}
|
||||
<p><b><a class="data-link" id="{{ submission['plate'] }}">{{ submission['plate'] }}:</a></b><a class="data-link equipment" id="{{ submission['equipment'] }}">{{ submission['equipment'] }}</a></p>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
<script>
|
||||
{% block script %}
|
||||
{{ super() }}
|
||||
|
||||
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);
|
||||
})
|
||||
}
|
||||
|
||||
{% for submission in process['submissions'] %}
|
||||
document.getElementById("{{ submission['plate'] }}").addEventListener("click", function(){
|
||||
backend.submission_details("{{ submission['plate'] }}");
|
||||
});
|
||||
{% endfor %}
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
backend.activate_export(false);
|
||||
}, false);
|
||||
{% endblock %}
|
||||
</script>
|
||||
</html>
|
||||
50
src/submissions/templates/tips_details.html
Normal file
50
src/submissions/templates/tips_details.html
Normal file
@@ -0,0 +1,50 @@
|
||||
{% extends "details.html" %}
|
||||
<head>
|
||||
{% block head %}
|
||||
{{ super() }}
|
||||
<title>Tips Details for {{ tips['name'] }}</title>
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block body %}
|
||||
<h2><u>Tips Details for {{ tips['name'] }}</u></h2>
|
||||
{{ super() }}
|
||||
<p>{% for key, value in tips.items() if key not in tips['excluded'] %}
|
||||
<!-- <b>{{ key | replace("_", " ") | title }}: </b>{% if permission and key in reagent['editable']%}<input type={% if key=='expiry' %}"date"{% else %}"text"{% endif %} id="{{ key }}" name="{{ key }}" value="{{ value }}">{% else %}{{ value }}{% endif %}<br>-->
|
||||
<b>{{ key | replace("_", " ") | title }}: </b>{{ value }}<br>
|
||||
{% endfor %}</p>
|
||||
<!-- {% if permission %}-->
|
||||
<!-- <button type="button" id="save_btn">Save</button>-->
|
||||
<!-- {% endif %}-->
|
||||
{% if tips['submissions'] %}<h2>Submissions:</h2>
|
||||
{% for submission in tips['submissions'] %}
|
||||
<p><b><a class="data-link" id="{{ submission['plate'] }}">{{ submission['plate'] }}:</a></b> <a class="data-link process" id="{{ submission['role'] }}">{{ submission['role'] }}</a></p>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
<script>
|
||||
{% block script %}
|
||||
{{ super() }}
|
||||
|
||||
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);
|
||||
})
|
||||
}
|
||||
|
||||
{% for submission in tips['submissions'] %}
|
||||
document.getElementById("{{ submission }}").addEventListener("click", function(){
|
||||
backend.submission_details("{{ submission }}");
|
||||
});
|
||||
{% endfor %}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
backend.activate_export(false);
|
||||
}, false);
|
||||
{% endblock %}
|
||||
</script>
|
||||
</html>
|
||||
Reference in New Issue
Block a user