From 1bf4fc4c092591e928cc2219b5cb6c56da72de29 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Herv=C3=A9=20M=C3=A9nager?= <herve.menager@pasteur.fr>
Date: Wed, 18 Nov 2020 22:53:03 +0100
Subject: [PATCH] fix various layout problems in compound list/card

mainly borders in tables, and alignments
---
 .../ippidb/templates/compound_db_links.html   |  4 +-
 .../templates/compound_dbsearch_links.html    |  4 +-
 .../ippidb/templates/compound_l_item.html     | 12 ++---
 .../templates/compound_test_counts.html       | 48 +++++++++----------
 4 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/ippisite/ippidb/templates/compound_db_links.html b/ippisite/ippidb/templates/compound_db_links.html
index b823487e..95baa394 100644
--- a/ippisite/ippidb/templates/compound_db_links.html
+++ b/ippisite/ippidb/templates/compound_db_links.html
@@ -1,7 +1,7 @@
 {%if compound.pubchem_id or compound.chembl_id or compound.chemspider_id or compound.ligand_id %}
-<table class="table mb-0">
+<table class="table m-1 card_border">
   <tbody>
-    <tr class="row">
+    <tr class="table-row">
       <td scope="col" class="col-2 text-center">
         {% if compound.pubchem_id %}
         <a href="{{ compound.pubchem_url }}" target="_blank"><img
diff --git a/ippisite/ippidb/templates/compound_dbsearch_links.html b/ippisite/ippidb/templates/compound_dbsearch_links.html
index 9f3429c9..2ee9a084 100644
--- a/ippisite/ippidb/templates/compound_dbsearch_links.html
+++ b/ippisite/ippidb/templates/compound_dbsearch_links.html
@@ -1,6 +1,6 @@
-<table class="table mb-0">
+<table class="table m-1 card_border">
   <tbody>
-    <tr class="row">
+    <tr class="table-row">
       <td scope="col" class="col-2 text-center">
         <a href="https://www.ncbi.nlm.nih.gov/pccompound?term={{ compound.inchikey }}" target="_blank"><img src="/static/images/Other/Pubchemlogo.png" style="height: 1.5em;" title="search INCHIKEY on PubChem" /></a>
       </td>
diff --git a/ippisite/ippidb/templates/compound_l_item.html b/ippisite/ippidb/templates/compound_l_item.html
index 035c2ab7..6e2d2d91 100644
--- a/ippisite/ippidb/templates/compound_l_item.html
+++ b/ippisite/ippidb/templates/compound_l_item.html
@@ -62,16 +62,16 @@
     {% endif %}
     {% if compound.biblio_refs %}
     <h4 class="pt-2 compound_list_title">Bibliography ({{compound.biblio_refs.count}})</h4>
-    <table class="table">
+    <table class="table m-1 card_border">
       <thead>
-        <tr>
+        <tr class="table-row">
           <th scope="col">Publication</th>
           <th scope="col" title="Compound name in publication">Name</th>
         </tr>
       </thead>
       <tbody>
         {% for biblio_ref in compound.biblio_refs %}
-        <tr>
+        <tr class="table-row">
           <td scope="col">{% include "biblio_citation.html" with bibliography=biblio_ref.bibliography%}</td>
           <td scope="col">{{ biblio_ref.compound_name }}</td>
         </tr>
@@ -81,9 +81,9 @@
     <h4 class="pt-2 compound_list_title">Pharmacological data</h4>
     {% include "compound_test_counts.html" with compound=compound show_bibrefs=False %}
     <h4 class="pt-2 compound_list_title">Targets</h4>
-    <table class="table">
+    <table class="table m-1 card_border">
       <thead>
-        <tr>
+        <tr class="table-row">
           <th scope="col">PPI family</th>
           <th scope="col">Best activity</th>
           <th scope="col">Diseases</th>
@@ -92,7 +92,7 @@
       </thead>
       <tbody>
         {% for row in compound.get_target_activities_table %}
-        <tr>
+        <tr class="table-row">
           <td scope="col">{{ row.family.name }}</td>
           <td scope="col">{{ row.best_activity|floatformat:2 }}</td>
           <td scope="col">
diff --git a/ippisite/ippidb/templates/compound_test_counts.html b/ippisite/ippidb/templates/compound_test_counts.html
index 56b7ea1e..f6ab2ef4 100644
--- a/ippisite/ippidb/templates/compound_test_counts.html
+++ b/ippisite/ippidb/templates/compound_test_counts.html
@@ -1,24 +1,24 @@
-<div class="card_border row" style="text-align: center;">
-    {% if show_bibrefs %}
-    <div class="col-md-4">
-        <h6 class="card_title">Bibliographic ressources</h6>
-        <p>{{ compound.biblio_refs.count }}</p>
-    </div>
-    {% endif %}
-    <div class="col-md-{% if show_bibrefs %}2{%else%}3{%endif%}">
-        <h6 class="card_title" title="Biochemical tests">Biochemical tests</h6>
-        <p>{{ compound.bioch_tests_count }}</p>
-    </div>
-    <div class="col-md-{% if show_bibrefs %}2{%else%}3{%endif%}">
-        <h6 class="card_title" title="Cellular tests">Cellular tests</h6>
-        <p>{{ compound.cell_tests_count }}</p>
-    </div>
-    <div class="col-md-{% if show_bibrefs %}2{%else%}3{%endif%}">
-        <h6 class="card_title" title="Pharmacokinetic tests">PK tests</h6>
-        <p>{{ compound.pk_tests_count }}</p>
-    </div>
-    <div class="col-md-{% if show_bibrefs %}2{%else%}3{%endif%}">
-        <h6 class="card_title" title="Cytotoxicity tests">Cytotoxicity tests</h6>
-        <p>{{ compound.cytotoxicity_tests_count }}</p>
-    </div>
-</div>
\ No newline at end of file
+<table class="table m-1 card_border">
+    <thead>
+      <tr class="table-row">
+            {% if show_bibrefs %}
+            <th scope="col">Bibliographic ressources</th>
+            {% endif %}
+            <th scope="col" title="Biochemical tests">Biochemical tests</th>
+            <th scope="col" title="Cellular tests">Cellular tests</th>
+            <th scope="col" title="Pharmacokinetic tests">PK tests</th>
+            <th scope="col" title="Cytotoxicity tests">Cytotoxicity tests</th>
+        </tr>
+    </thead>
+    <tbody>
+        <tr class="table-row">
+            {% if show_bibrefs %}
+            <td scope="col">{{ compound.biblio_refs.count }}</td>
+            {% endif %}
+            <th scope="col" title="Biochemical tests">{{ compound.bioch_tests_count }}</th>
+            <th scope="col" title="Cellular tests">{{ compound.cell_tests_count }}</th>
+            <th scope="col" title="Pharmacokinetic tests">{{ compound.pk_tests_count }}</th>
+            <th scope="col" title="Cytotoxicity tests">{{ compound.cytotoxicity_tests_count }}</th>
+        </tr>
+    </tbody>
+</table>
\ No newline at end of file
-- 
GitLab