Improved navigation and clarity in details view.
This commit is contained in:
@@ -1,26 +1,25 @@
|
||||
<!doctype html>
|
||||
{% extends "details.html" %}
|
||||
|
||||
<html>
|
||||
<head>
|
||||
{% block head %}
|
||||
{% if css %}
|
||||
<style>
|
||||
{{ css }}
|
||||
</style>
|
||||
{% endif %}
|
||||
<title>Submission Details for {{ sub['Plate Number'] }}</title>
|
||||
<script src="qrc:///qtwebchannel/qwebchannel.js"></script>
|
||||
{{ super() }}
|
||||
<title>Submission Details for {{ sub['plate_number'] }}</title>
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block body %}
|
||||
<h2><u>Submission Details for {{ sub['plate_number'] }}</u></h2> {% if sub['barcode'] %}<img align='right' height="30px" width="120px" src="data:image/jpeg;base64,{{ sub['barcode'] | safe }}">{% endif %}
|
||||
{{ super() }}
|
||||
<p>{% for key, value in sub.items() if key not in sub['excluded'] %}
|
||||
<b>{{ key | replace("_", " ") | title | replace("Pcr", "PCR") }}: </b>{% if key=='cost' %}{% if sub['cost'] %} {{ "${:,.2f}".format(value) }}{% endif %}{% else %}{{ value }}{% endif %}<br>
|
||||
{% endfor %}</p>
|
||||
|
||||
<h3><u>Reagents:</u></h3>
|
||||
<p>{% for item in sub['reagents'] %}
|
||||
<b>{{ item['role'] }}</b>: {{ item['lot'] }} (EXP: {{ item['expiry'] }})<br>
|
||||
<b>{{ item['role'] }}</b>: <a class="data-link" id="{{ item['lot'] }}">{{ item['lot'] }} (EXP: {{ item['expiry'] }})</a><br>
|
||||
{% endfor %}</p>
|
||||
|
||||
{% if sub['equipment'] %}
|
||||
<h3><u>Equipment:</u></h3>
|
||||
<p>{% for item in sub['equipment'] %}
|
||||
@@ -36,7 +35,7 @@
|
||||
{% if sub['samples'] %}
|
||||
<h3><u>Samples:</u></h3>
|
||||
<p>{% for item in sub['samples'] %}
|
||||
<b>{{ item['well'] }}:</b> {% if item['organism'] %} {{ item['name'] }} - ({{ item['organism']|replace('\n\t', '<br> ') }}){% else %} {{ item['name']|replace('\n\t', '<br> ') }}{% endif %}<br>
|
||||
<b>{{ item['well'] }}:</b><a class="data-link" id="{{ item['submitter_id'] }}_alpha">{% if item['organism'] %} {{ item['name'] }} - ({{ item['organism']|replace('\n\t', '<br> ') }}){% else %} {{ item['name']|replace('\n\t', '<br> ') }}{% endif %}</a><br>
|
||||
{% endfor %}</p>
|
||||
{% endif %}
|
||||
|
||||
@@ -76,17 +75,29 @@
|
||||
<br>
|
||||
</body>
|
||||
<script>
|
||||
var backend;
|
||||
new QWebChannel(qt.webChannelTransport, function (channel) {
|
||||
backend = channel.objects.backend;
|
||||
});
|
||||
{% block script %}
|
||||
{{ super() }}
|
||||
{% for sample in sub['samples'] %}
|
||||
document.getElementById("{{ sample['submitter_id'] }}").addEventListener("dblclick", function(){
|
||||
document.getElementById("{{ sample['submitter_id'] }}").addEventListener("click", function(){
|
||||
backend.sample_details("{{ sample['submitter_id'] }}");
|
||||
});
|
||||
{% endfor %}
|
||||
{% for sample in sub['samples'] %}
|
||||
document.getElementById("{{ sample['submitter_id'] }}_alpha").addEventListener("click", function(){
|
||||
backend.sample_details("{{ sample['submitter_id'] }}");
|
||||
});
|
||||
{% endfor %}
|
||||
{% for reagent in sub['reagents'] %}
|
||||
document.getElementById("{{ reagent['lot'] }}").addEventListener("click", function(){
|
||||
backend.reagent_details("{{ reagent['lot'] }}", "{{ sub['extraction_kit'] }}");
|
||||
});
|
||||
{% endfor %}
|
||||
document.getElementById("sign_btn").addEventListener("click", function(){
|
||||
backend.sign_off("{{ sub['plate_number'] }}");
|
||||
})
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
backend.activate_export(true);
|
||||
}, false);
|
||||
{% endblock %}
|
||||
</script>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user