Improved previous sub finding.
This commit is contained in:
54
src/submissions/templates/basicsample_details.html
Normal file
54
src/submissions/templates/basicsample_details.html
Normal file
@@ -0,0 +1,54 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
{% block head %}
|
||||
<style>
|
||||
/* Tooltip container */
|
||||
.tooltip {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
border-bottom: 1px dotted black; /* If you want dots under the hoverable text */
|
||||
}
|
||||
|
||||
/* Tooltip text */
|
||||
.tooltip .tooltiptext {
|
||||
visibility: hidden;
|
||||
width: 120px;
|
||||
background-color: black;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
padding: 5px 0;
|
||||
border-radius: 6px;
|
||||
|
||||
/* Position the tooltip text - see examples below! */
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
bottom: 100%;
|
||||
left: 50%;
|
||||
margin-left: -60px;
|
||||
}
|
||||
|
||||
/* Show the tooltip text when you mouse over the tooltip container */
|
||||
.tooltip:hover .tooltiptext {
|
||||
visibility: visible;
|
||||
font-size: large;
|
||||
}
|
||||
</style>
|
||||
<title>Sample Details for {{ sample['Submitter ID'] }}</title>
|
||||
<script src="qrc:///qtwebchannel/qwebchannel.js"></script>
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block body %}
|
||||
<h2><u>Sample Details for {{ sample['Submitter ID'] }}</u></h2>
|
||||
<p>{% for key, value in sample.items() if key not in sample['excluded'] %}
|
||||
<b>{{ key }}: </b>{{ value }}<br>
|
||||
{% endfor %}</p>
|
||||
{% if sample['submissions'] %}<h2>Submissions:</h2>
|
||||
{% for submission in sample['submissions'] %}
|
||||
<p>{{ submission['Plate Name'] }}: {{ submission['Well'] }}</p>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
@@ -35,6 +35,7 @@
|
||||
}
|
||||
</style>
|
||||
<title>Submission Details for {{ sub['Plate Number'] }}</title>
|
||||
<script src="qrc:///qtwebchannel/qwebchannel.js"></script>
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
@@ -57,7 +58,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> {% if item['Organism'] %} {{ item['Name'] }} - ({{ item['Organism']|replace('\n\t', '<br> ') }}){% else %} {{ item['Name']|replace('\n\t', '<br> ') }}{% endif %}<br>
|
||||
{% endfor %}</p>
|
||||
{% endif %}
|
||||
{% if sub['controls'] %}
|
||||
@@ -116,4 +117,15 @@
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
<script>
|
||||
var backend;
|
||||
new QWebChannel(qt.webChannelTransport, function (channel) {
|
||||
backend = channel.objects.backend;
|
||||
});
|
||||
{% for sample in sub['samples'] %}
|
||||
document.getElementById("{{sample['Submitter ID']}}").addEventListener("dblclick", function(){
|
||||
backend.sample_details("{{ sample['Submitter ID'] }}");
|
||||
});
|
||||
{% endfor %}
|
||||
</script>
|
||||
</html>
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<div class="gallery" style="display: grid;grid-template-columns: repeat({{ PLATE_COLUMNS }}, 7.5vw);grid-template-rows: repeat({{ PLATE_ROWS }}, 7.5vw);grid-gap: 2px;">
|
||||
{% for sample in samples %}
|
||||
<div class="well" style="background-color: {{sample['background_color']}};
|
||||
<div class="well" id="{{sample['Submitter ID']}}" style="background-color: {{sample['background_color']}};
|
||||
border: 1px solid #000;
|
||||
padding: 20px;
|
||||
grid-column-start: {{sample['column']}};
|
||||
grid-column-end: {{sample['column']}};
|
||||
grid-row-start: {{sample['row']}};
|
||||
grid-row-end: {{sample['row']}};
|
||||
grid-column-start: {{sample['Column']}};
|
||||
grid-column-end: {{sample['Column']}};
|
||||
grid-row-start: {{sample['Row']}};
|
||||
grid-row-end: {{sample['Row']}};
|
||||
display: flex;
|
||||
">
|
||||
<div class="tooltip" style="font-size: 0.5em; text-align: center; word-wrap: break-word;">{{ sample['name'] }}
|
||||
<div class="tooltip" style="font-size: 0.5em; text-align: center; word-wrap: break-word;">{{ sample['Name'] }}
|
||||
<span class="tooltiptext">{{ sample['tooltip'] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Sample name: {{ fields['submitter_id'] }}<br>
|
||||
{% if fields['organism'] %}Organism: {{ fields['organism'] }}<br>{% endif %}
|
||||
{% if fields['concentration'] %}Concentration: {{ fields['concentration'] }}<br>{% endif %}
|
||||
Well: {{ fields['well'] }}<!--{{ fields['column'] }}-->
|
||||
Sample name: {{ fields['Submitter ID'] }}<br>
|
||||
{% if fields['Organism'] %}Organism: {{ fields['Organism'] }}<br>{% endif %}
|
||||
{% if fields['Concentration'] %}Concentration: {{ fields['Concentration'] }}<br>{% endif %}
|
||||
Well: {{ fields['Well'] }}<!--{{ fields['column'] }}-->
|
||||
Reference in New Issue
Block a user