diff --git a/ippisite/ippidb/templates/compound_list.html b/ippisite/ippidb/templates/compound_list.html index 7aa032fb2de3be52ddaeb3ccaf7bf9dc2cc565e7..ae0bd196f2439540c592465abba7c6d31ea59840 100644 --- a/ippisite/ippidb/templates/compound_list.html +++ b/ippisite/ippidb/templates/compound_list.html @@ -91,9 +91,11 @@ {% if compounds %} <div class="container-fluid"> {% if display == 'v' %} + <div class="d-flex flex-wrap m-2 justify-content-around"> {% for compound in compounds %} {% include "compound_v_item.html" with compound=compound %} {% endfor %} + </div> {% elif display == 'l'%} {% for compound in compounds %} {% include "compound_l_item.html" with compound=compound %} diff --git a/ippisite/ippidb/templates/compound_v_item.html b/ippisite/ippidb/templates/compound_v_item.html index 6f22bebd84135f9374ded03f12894d4b731e3b7b..d487ba8218202a3c08d87c9ee5298ba59b673b89 100644 --- a/ippisite/ippidb/templates/compound_v_item.html +++ b/ippisite/ippidb/templates/compound_v_item.html @@ -1,4 +1,5 @@ -<div class="card m-2 border border-info" style="width: 300px"> +<div class="p-2"> +<div class="card border border-info"> <a href="/compounds/{{ compound.id }}">{% include "pubchem_img.html" %}</a> <div class="card-body" style="overflow:hidden; word-wrap:break-word;"> <span class="badge badge-dark"><a href="/compounds/{{ compound.id }}">{{ compound.id }}</a></span> @@ -6,3 +7,4 @@ <p>Molecular Weight: {{ compound.molecular_weight }} g/mol</p> </div> </div> +</div> diff --git a/ippisite/ippidb/templates/pubchem_img.html b/ippisite/ippidb/templates/pubchem_img.html index 622ee2ca56e65d11d94fc2f65bbb612930bacf86..ecb1a04de4887ab036d65237424d779380052be6 100644 --- a/ippisite/ippidb/templates/pubchem_img.html +++ b/ippisite/ippidb/templates/pubchem_img.html @@ -1 +1 @@ -<img src="https://pubchem.ncbi.nlm.nih.gov/image/imagefly.cgi?cid={{ compound.pubchem_id }}&width=300&height=300" style="width:290px;height:290px;" onerror="this.src='/static/images/cross.svg';"/> +<img src="https://pubchem.ncbi.nlm.nih.gov/image/imagefly.cgi?cid={{ compound.pubchem_id }}&width=300&height=300" onerror="this.src='/static/images/cross.svg'; this.style.width='300px';"/>