Commit 239b7f8c authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

add activity test results to contribution card

WIP on #224
parent a93534f0
Pipeline #32944 passed with stages
in 16 minutes and 10 seconds
......@@ -1278,6 +1278,10 @@ class CompoundActivityResult(models.Model):
else False
)
@property
def ref(self):
return RefCompoundBiblio.objects.get(compound=self.compound, bibliography=self.test_activity_description.biblio)
class TestCytotoxDescription(models.Model):
"""
......
......@@ -47,14 +47,14 @@
{%endif%}
<div class="contrib-card" style="overflow-x: hidden;">
<p class="contrib-card-title">Tests</p>
{%for o in testactivitydescription%}
{% include "ippidb/testactivitydescription_card.html" with object=o %}
{%for o in bibliography.testactivitydescription_set.all%}
{% include "ippidb/testactivitydescription_card.html" with object=o %}
{%endfor%}
{%for o in testcytotoxdescription%}
{% include "ippidb/testcytotoxdescription_card.html" with object=o %}
{% include "ippidb/testcytotoxdescription_card.html" with object=o %}
{%endfor%}
{%for o in testpkdescription%}
{% include "ippidb/testpkdescription_card.html" with object=o %}
{% include "ippidb/testpkdescription_card.html" with object=o %}
{%endfor%}
</div>
</div>
......
......@@ -12,10 +12,10 @@
<span style="font-family: BrandonGrotesqueBld;">{{object|verbose_name:'is_primary'}}: </span>{{object.is_primary}}
</div>
<div class="col-12">
<span style="font-family: BrandonGrotesqueBld;">{{object|verbose_name:'test_type'}}: </span>{{object.test_type}}
<span style="font-family: BrandonGrotesqueBld;">{{object|verbose_name:'test_type'}}: </span>{{object.get_test_type_display}}
</div>
<div class="col-12">
<span style="font-family: BrandonGrotesqueBld;">{{object|verbose_name:'test_modulation_type'}}: </span>{{object.test_modulation_type}}
<span style="font-family: BrandonGrotesqueBld;">{{object|verbose_name:'test_modulation_type'}}: </span>{{object.get_test_modulation_type_display}}
</div>
<div class="col-12">
<span style="font-family: BrandonGrotesqueBld;">{{object|verbose_name:'nb_active_compounds'}}: </span>{{object.nb_active_compounds}}
......@@ -24,5 +24,21 @@
<span style="font-family: BrandonGrotesqueBld;">{{object|verbose_name:'cell_line'}}: </span>{{object.cell_line}}
</div>
</div>
<table class="table">
<tr>
<th>Compound</th>
<th>Modulation type</th>
<th>Activity</th>
</tr>
{% for result in object.compoundactivityresult_set.all %}
<tr>
<td>{{result.ref.compound_name}}</td>
<td>{{result.get_modulation_type_display}}</td>
<td title="{{result.get_activity_type_display}}">{{result.activity_type}}: {{result.activity|floatformat:2}}</td>
</tr>
{% endfor %}
</table>
</div>
{%endif%}
\ No newline at end of file
{% load customtags %}
{%if object%}
<div class="card mb-2">
<h5 class="card-header">
<span style="text-transform: capitalize;"> {{object|verbose_name}}</span> - <span style="text-transform: capitalize;">{{object.compound_name}}</span>
</h5>
<div class="card-body row">
<div class="col-12">
<span style="font-family: BrandonGrotesqueBld;">{{object|verbose_name:'modulation_type'}}: </span>{{object.modulation_type}}
</div>
</div>
</div>
{%endif%}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment