Addition of procedure parser in import.
This commit is contained in:
37
src/submissions/templates/clientsubmission_details.html
Normal file
37
src/submissions/templates/clientsubmission_details.html
Normal file
@@ -0,0 +1,37 @@
|
||||
{% extends "details.html"%}
|
||||
|
||||
<head>
|
||||
{% block head %}
|
||||
{{ super() }}
|
||||
<title>ClientSubmission Details for {{ clientsubmission['name'] }}</title>
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block body %}
|
||||
<h2><u>Submission Details for {{ clientsubmission['name'] }}</u></h2>
|
||||
{{ super() }}
|
||||
<p>{% for key, value in clientsubmission.items() if key not in clientsubmission['excluded'] %}
|
||||
<b>{{ key | replace("_", " ") | title | replace("Id", "ID") }}: </b>{% if key=='cost' %}{% if clientsubmission['cost'] %} {{ "${:,.2f}".format(value) }}{% endif %}{% else %}{{ value }}{% endif %}<br>
|
||||
{% endfor %}
|
||||
</p>
|
||||
|
||||
{% if clientsubmission['sample'] %}
|
||||
<button type="button" class="collapsible"><h3><u>Client Submitted Samples:</u></h3></button>
|
||||
<div class="nested">
|
||||
<p>{% for sample in clientsubmission['sample'] %}
|
||||
<a class="data-link sample" id="{{ sample['sample_id'] }}">{{ sample['sample_id']}}</a><br>
|
||||
{% endfor %}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if clientsubmission['run'] %}
|
||||
<button type="button" class="collapsible"><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>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
@@ -146,3 +146,36 @@ ul.no-bullets {
|
||||
background-color: pink;
|
||||
}
|
||||
|
||||
/* */
|
||||
.nested {
|
||||
margin-left: 50px;
|
||||
padding: 0 18px;
|
||||
display: none;
|
||||
overflow: hidden;
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
/* Style the button that is used to open and close the collapsible content */
|
||||
.collapsible {
|
||||
background-color: #eee;
|
||||
color: #444;
|
||||
cursor: pointer;
|
||||
padding: 18px;
|
||||
width: 100%;
|
||||
border: none;
|
||||
text-align: left;
|
||||
outline: none;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
/* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */
|
||||
.active, .collapsible:hover {
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
.unused {
|
||||
color: red;
|
||||
text-decoration-line: line-through;
|
||||
text-decoration-color: red;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
{% if not child %}
|
||||
<html lang="en">
|
||||
<head>
|
||||
{% block head %}
|
||||
@@ -14,17 +14,41 @@
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% endif %}
|
||||
{% block body %}
|
||||
<!--<button type="button" id="back_btn">Back</button>-->
|
||||
{% endblock %}
|
||||
{% block signing_button %}{% endblock %}
|
||||
{% if not child %}
|
||||
</body>
|
||||
{% endif %}
|
||||
|
||||
{% 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>
|
||||
{{ j }}
|
||||
</script>
|
||||
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
</html>
|
||||
{% if not child %}
|
||||
</html>
|
||||
{% endif %}
|
||||
@@ -28,13 +28,24 @@
|
||||
<br><hr><br>
|
||||
{% for key, value in procedure['reagentrole'].items() %}
|
||||
<label for="{{ key }}">{{ key }}:</label><br>
|
||||
<select class="reagentrole dropdown" id="{{ key }}" name="{{ reagentrole }}"><br>
|
||||
<datalist class="reagentrole dropdown" id="{{ key }}" name="{{ reagentrole }}"><br>
|
||||
{% for reagent in value %}
|
||||
<option value="{{ reagent }}">{{ reagent }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</datalist>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if proceduretype['equipment'] %}
|
||||
<br><hr><br>
|
||||
{% for equipmentrole in proceduretype['equipment'] %}
|
||||
<label for="{{ equipmentrole['name'] }}">{{ equipmentrole['name'] }}:</label><br>
|
||||
<select class="equipmentrole dropdown" id="{{ equipmentrole['name'] }}" name="{{ equipmentrole['name'] }}"><br>
|
||||
{% for equipment in equipmentrole['equipment'] %}
|
||||
<option value="{{ equipment['name'] }}">{{ equipment['name'] }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{% endfor %}
|
||||
{% endif%}
|
||||
</form>
|
||||
</div>
|
||||
<div class="right">
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{% extends "details.html" %}
|
||||
{% if not child %}
|
||||
|
||||
<head>
|
||||
{% block head %}
|
||||
@@ -7,9 +8,31 @@
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% endif %}
|
||||
{% block body %}
|
||||
|
||||
|
||||
<h2><u>Procedure Details for {{ procedure['name'] }}</u></h2>
|
||||
{{ super() }}
|
||||
<p>{% for key, value in procedure.items() if key not in procedure['excluded'] %}
|
||||
<b>{{ key | replace("_", " ") | title | replace("Pcr", "PCR") }}: {{ value }}</b><br>
|
||||
{% endfor %}</p>
|
||||
{% if procedure['results'] %}
|
||||
<button type="button" class="collapsible"><h3><u>Results:</u></h3></button>
|
||||
<div class="nested">
|
||||
{% 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">
|
||||
<p>{% for sample in procedure['sample'] %}
|
||||
<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 %}
|
||||
</body>
|
||||
</body>
|
||||
|
||||
@@ -1,135 +1,59 @@
|
||||
{% extends "details.html" %}
|
||||
|
||||
<html>
|
||||
<head>
|
||||
{% block head %}
|
||||
{{ 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 %}
|
||||
{% if sub['custom'] %}{% for key, value in sub['custom'].items() %}
|
||||
<b>{{ key | replace("_", " ") | title }}: </b>{{ value }}<br>
|
||||
{% endfor %}{% endif %}</p>
|
||||
{% 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>
|
||||
{% endfor %}</p>
|
||||
{% endif %}
|
||||
{% if sub['equipment'] %}
|
||||
<h3><u>Equipment:</u></h3>
|
||||
<p>{% for item in sub['equipment'] %}
|
||||
<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> <a class="data-link tips" id="{{ item['lot'] }}">{{ item['name'] }} ({{ item['lot'] }})</a><br>
|
||||
{% endfor %}</p>
|
||||
{% endif %}
|
||||
{% if sub['samples'] %}
|
||||
<h3><u>Samples:</u></h3>
|
||||
<p>{% for item in sub['samples'] %}
|
||||
<b>{{ item['well'] }}:</b><a class="data-link sample" id="{{ item['submitter_id'] }}">{% if item['organism'] %} {{ item['name'] }} - ({{ item['organism']|replace('\n\t', '<br> ') }}){% else %} {{ item['name']|replace('\n\t', '<br> ') }}{% endif %}</a><br>
|
||||
{% endfor %}</p>
|
||||
{% endif %}
|
||||
<head>
|
||||
{% block head %}
|
||||
{{ super() }}
|
||||
<title>Run Details for {{ run['rsl_plate_number'] }}</title>
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
|
||||
{% if sub['ext_info'] %}
|
||||
{% for entry in sub['ext_info'] %}
|
||||
<h3><u>Extraction Status:</u></h3>
|
||||
<p>{% for key, value in entry.items() %}
|
||||
{% if "column" in key %}
|
||||
<b>{{ key|replace('_', ' ')|title() }}:</b> {{ value }}uL<br>
|
||||
{% else %}
|
||||
<b>{{ key|replace('_', ' ')|title() }}:</b> {{ value }}<br>
|
||||
{% endif %}
|
||||
{% endfor %}</p>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% block body %}
|
||||
<h2><u>Run Details for {{ run['rsl_plate_number'] }}</u></h2>
|
||||
{{ super() }}
|
||||
<p>{% for key, value in run.items() if key not in run['excluded'] %}
|
||||
<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>
|
||||
<p>{% for sample in run['sample'] %}
|
||||
<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">
|
||||
{% 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>
|
||||
{% endblock %}
|
||||
<br>
|
||||
|
||||
{% if sub['comment'] %}
|
||||
<h3><u>Comments:</u></h3>
|
||||
<p>{% for entry in sub['comment'] %}
|
||||
<b>{{ entry['name'] }}:</b><br> {{ entry['text'] }}<br>- {{ entry['time'] }}<br>
|
||||
{% endfor %}</p>
|
||||
{% endif %}
|
||||
{% if sub['platemap'] %}
|
||||
<h3><u>Plate map:</u></h3>
|
||||
{{ sub['platemap'] }}
|
||||
{% endif %}
|
||||
{% if sub['export_map'] %}
|
||||
<h3><u>Plate map:</u></h3>
|
||||
<img height="600px" width="1300px" src="data:image/jpeg;base64,{{ sub['export_map'] | safe }}">
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block signing_button %}
|
||||
<button type="button" id="sign_btn" {% if permission and not sub['signed_by'] %}{% else %}hidden{% endif %}>Sign Off</button>
|
||||
{% endblock %}
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
</body>
|
||||
</body>
|
||||
|
||||
{% block script %}
|
||||
{{ super() }}
|
||||
<script>
|
||||
var sampleSelection = document.getElementsByClassName('sample');
|
||||
{% block script %}
|
||||
{{ super() }}
|
||||
<script>
|
||||
var sampleSelection = document.getElementsByClassName('sample');
|
||||
|
||||
for(let i = 0; i < sampleSelection.length; i++) {
|
||||
sampleSelection[i].addEventListener("click", function() {
|
||||
console.log(sampleSelection[i].id);
|
||||
backend.sample_details(sampleSelection[i].id);
|
||||
})
|
||||
}
|
||||
for(let i = 0; i < sampleSelection.length; i++) {
|
||||
sampleSelection[i].addEventListener("click", function() {
|
||||
console.log(sampleSelection[i].id);
|
||||
backend.sample_details(sampleSelection[i].id);
|
||||
})
|
||||
}
|
||||
|
||||
var reagentSelection = document.getElementsByClassName('reagent');
|
||||
document.getElementById("sign_btn").addEventListener("click", function(){
|
||||
backend.sign_off("{{ run['rsl_plate_num'] }}");
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
for(let i = 0; i < reagentSelection.length; i++) {
|
||||
reagentSelection[i].addEventListener("click", function() {
|
||||
console.log(reagentSelection[i].id);
|
||||
backend.reagent_details(reagentSelection[i].id, "{{ sub['extraction_kit'] }}");
|
||||
})
|
||||
}
|
||||
|
||||
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'] }}");
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
</html>
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
<h2><u>Sample Checker</u></h2>
|
||||
<br>
|
||||
{% if rsl_plate_num %}
|
||||
<label for="rsl_plate_num">RSL Plate Number:</label><br>
|
||||
<input type="text" id="rsl_plate_num" name="sample_id" value="{{ rsl_plate_num }}" size="40">
|
||||
<label for="rsl_plate_number">RSL Plate Number:</label><br>
|
||||
<input type="text" id="rsl_plate_number" name="sample_id" value="{{ rsl_plate_number }}" size="40">
|
||||
|
||||
{% endif %}
|
||||
<br>
|
||||
|
||||
Reference in New Issue
Block a user