From edbee76ef040671325ce5a02c108b2674319f060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20=20MENAGER?= <herve.menager@pasteur.fr> Date: Wed, 14 Feb 2018 15:49:22 +0100 Subject: [PATCH] refactor table list for compounds - part 2, #43 WIP Former-commit-id: 9299a59e2247117c330f66353b10e14a2c65ce43 --- ippisite/ippidb/templates/compound_list.html | 20 +--------- .../ippidb/templates/compound_t_list.html | 38 ++++++++++++++----- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/ippisite/ippidb/templates/compound_list.html b/ippisite/ippidb/templates/compound_list.html index c4c831eb..8d6a65a5 100644 --- a/ippisite/ippidb/templates/compound_list.html +++ b/ippisite/ippidb/templates/compound_list.html @@ -91,25 +91,7 @@ {% include "compound_l_item.html" with compound=compound %} {% endfor %} {% else %} - <table class="table"> - <thead> - <tr> - <th scope="col">#</th> - <th scope="col">Common name</th> - <th scope="col">Molecular weight</th> - <th scope="col">AlogP</th> - <th scope="col">PDB ligand</th> - <th scope="col">MDDR phase</th> - <th scope="col">Available tests</th> - <th scope="col">Available publications</th> - </tr> - </thead> - <tbody> - {% for compound in compounds %} - {% include "compound_t_item.html" with compound=compound %} - {% endfor %} - </tbody> - </table> + {% include "compound_t_list.html" with compounds=compounds %} {% endif %} </div> {% else %} diff --git a/ippisite/ippidb/templates/compound_t_list.html b/ippisite/ippidb/templates/compound_t_list.html index 57faae85..ec6da9dc 100644 --- a/ippisite/ippidb/templates/compound_t_list.html +++ b/ippisite/ippidb/templates/compound_t_list.html @@ -1,10 +1,28 @@ -<tr> - <th scope="col"><span class="badge badge-dark"><a href="/compound/{{ compound.id }}">{{ compound.id }}</a></span></th> - <th scope="col">{{ compound.common_name|default_if_none:"-" }}</th> - <th scope="col">{{ compound.molecular_weight}} g/mol</th> - <th scope="col">{{ compound.a_log_p }}</th> - <th scope="col">{% for pdb_id in compound.compound_action_pdb_ids %}{{ pdb_id }}{% endfor %}</th> - <th scope="col"> ? </th> - <th scope="col"> ? </th> - <th scope="col">{{ compound.biblio_refs|length }}</th> -</tr> +<table class="table"> + <thead> + <tr> + <th scope="col">#</th> + <th scope="col">Common name</th> + <th scope="col">Molecular weight</th> + <th scope="col">AlogP</th> + <th scope="col">PDB ligand</th> + <th scope="col">MDDR phase</th> + <th scope="col">Available tests</th> + <th scope="col">Available publications</th> + </tr> + </thead> + <tbody> + {% for compound in compounds %} + <tr> + <th scope="col"><span class="badge badge-dark"><a href="/compound/{{ compound.id }}">{{ compound.id }}</a></span></th> + <th scope="col">{{ compound.common_name|default_if_none:"-" }}</th> + <th scope="col">{{ compound.molecular_weight}} g/mol</th> + <th scope="col">{{ compound.a_log_p }}</th> + <th scope="col">{% for pdb_id in compound.compound_action_pdb_ids %}{{ pdb_id }}{% endfor %}</th> + <th scope="col"> ? </th> + <th scope="col"> ? </th> + <th scope="col">{{ compound.biblio_refs|length }}</th> + </tr> + {% endfor %} + </tbody> +</table> -- GitLab