Commit 0a1fce10 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

adjust display for compounds list, mainly list view

fix #94


Former-commit-id: e972274bcc9494436cb9527c8b0f40ef5f4cd735
parent ab341d56
{%if compound.pubchem_id or compound.chembl_id or compound.chemspider_id %}
<div class="row">
{% if compound.pubchem_id %}
<span class="col-sm-4"><a href="https://pubchem.ncbi.nlm.nih.gov/compound/{{ compound.pubchem_id }}" target="_blank"><img src="/static/images/Other/Pubchemlogo.png" style="height: 1.5em;" title="PubChem ID: {{ compound.pubchem_id }}" /></a></span>
{% endif %}
{% if compound.chembl_id %}
<span class="col-sm-4"><a href="https://www.ebi.ac.uk/chembldb/compound/inspect/{{ compound.chembl_id }}" target="_blank"><img src="/static/images/Other/Chembl_logo.png" style="height: 1.5em;" title="ChEMBL ID: {{ compound.pubchem_id }}" /></a></span>
{% endif %}
{% if compound.chemspider_id %}
<span class="col-sm-4"><a href="http://www.chemspider.com/Chemical-Structure.{{ compound.chemspider_id}}.html" target="_blank"><img src="/static/images/Other/ChemSpider_Logo.png" style="height: 1.5em;" title="ChemSpider ID: {{ compound.chemspider_id }}" /></a></span>
{% endif %}
</div>
{% endif %}
{%if compound.pubchem_id or compound.chembl_id or compound.chemspider_id %}
<table class="table mb-0">
<tbody>
<tr class="row">
<td scope="col" class="col-4">
{% if compound.pubchem_id %}
<a href="https://pubchem.ncbi.nlm.nih.gov/compound/{{ compound.pubchem_id }}" target="_blank"><img src="/static/images/Other/Pubchemlogo.png" style="height: 1.5em;" title="PubChem ID: {{ compound.pubchem_id }}" /></a>
{% endif %}
</td>
<td scope="col" class="col-4">
{% if compound.chembl_id %}
<a href="https://www.ebi.ac.uk/chembldb/compound/inspect/{{ compound.chembl_id }}" target="_blank"><img src="/static/images/Other/Chembl_logo.png" style="height: 1.5em;" title="ChEMBL ID: {{ compound.pubchem_id }}" /></a>
{% endif %}
</td>
<td scope="col" class="col-4">
{% if compound.chemspider_id %}
<a href="http://www.chemspider.com/Chemical-Structure.{{ compound.chemspider_id}}.html" target="_blank"><img src="/static/images/Other/ChemSpider_Logo.png" style="height: 1.5em;" title="ChemSpider ID: {{ compound.chemspider_id }}" /></a>
{% endif %}
</td>
</tr>
</tbody>
</table>
{% endif %}
......@@ -7,6 +7,7 @@
{% endif %}
</div>
<div class="col-sm-9">
<h4 class="pt-2">Identifiers</h4>
<ul class="list-group">
{% if compound.common_name %}
<li class="list-group-item">Common name: {{ compound.common_name }}</li>
......@@ -17,13 +18,36 @@
{% if compound.iupac_name %}
<li class="list-group-item">IUPAC name: {{ compound.iupac_name }}</li>
{% endif %}
{% if compound.inchi %}
<li class="list-group-item">InChi: {{ compound.inchi }}</li>
{% endif %}
{% if compound.inchikey %}
<li class="list-group-item">InChiKey: {{ compound.inchikey }}</li>
{% endif %}
</ul>
<p>External links</p>
{%if compound.pubchem_id or compound.chembl_id or compound.chemspider_id %}
<h4 class="pt-2">External links</h4>
{% include "compound_db_links.html" %}
<ul class="list-group">
{% for biblio_ref in compound.biblio_refs %}
<li class="list-group-item">Mentionned in {% include "biblio_citation.html" with bibliography=biblio_ref.bibliography%} as <i>{{ biblio_ref.compound_name }}</i></li>
{% endfor %}
{% endif %}
{% if compound.biblio_refs %}
<h4 class="pt-2">Bibliography</h4>
<table class="table">
<thead>
<tr>
<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>
<td scope="col">{% include "biblio_citation.html" with bibliography=biblio_ref.bibliography%}</td>
<td scope="col">{{ biblio_ref.compound_name }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</ul>
{% endif %}
</div>
</div>
......@@ -85,7 +85,10 @@
{% endif %}
</span>
{% endif %}
<div class="btn-group m-1 ml-auto">
<div class="m-1 ml-auto">
{% include "compound_list_pagination.html" %}
</div>
<div class="btn-group btn-group-sm ml-1">
<button class="btn btn-secondary dropdown-toggle" type="button" id="sortMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-sort-amount-down" title="sort by"></i>
</button>
......@@ -95,7 +98,7 @@
{% endfor %}
</div>
</div>
<span class="btn-group m-1">
<span class="btn-group btn-group-sm ml-1 pb-0">
<a class="btn btn-default btn-outline-primary {% if display == 'v' %}active{% endif %}" href="#" {% if display != 'v' %}onclick="modifyUrl('display', 'v')"{% endif %}>
<i class="fa fa-th" title="Thumbnails"></i>
</a>
......@@ -131,41 +134,7 @@
</div>
</div>
<nav class="d-flex">
<ul class="pagination pagination-sm ml-auto">
{% if page_obj.has_previous %}
<li class="page-item">
<a class="page-link" href="?{% url_replace request 'page' page_obj.previous_page_number %}" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
<span class="sr-only">Previous</span>
</a>
</li>
{% endif %}
<li class="page-item disabled">
<span class="page-link">Page {{ page_obj.number }} of {{ paginator.num_pages }}.</span>
</li>
{% if page_obj.has_next %}
<li class="page-item">
<a class="page-link" href="?{% url_replace request 'page' page_obj.next_page_number %}" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
<span class="sr-only">Next</span>
</a>
</li>
{% endif %}
<li class="page-item ml-3">
<div class="input-group input-group-sm">
<input id="pageNumber" type="number" min="1" max="{{ paginator.num_pages }}" step="1" placeholder="page #" style="width: 4em;" aria-label="Page number">
<div class="input-group-append">
<button class="btn btn-outline-primary" type="button" onclick="modifyUrl('page',$('#pageNumber').val())">Go</button>
</div>
</div>
</li>
</ul>
</nav>
{% include "compound_list_pagination.html" %}
{% include "multiselection_modal.html" with label="PPI Family" selected_list=selected_family unselected_list=family param_name="family" all_param_name="family_all" all_param_value=family_all %}
{% include "multiselection_modal.html" with label="PPI" selected_list=selected_ppi unselected_list=ppi param_name="ppi" all_param_name="ppi_all" all_param_value=ppi_all %}
......
{% load customtags %}
<nav class="d-flex">
<ul class="pagination pagination-sm ml-auto mb-0">
{% if page_obj.has_previous %}
<li class="page-item">
<a class="page-link" href="?{% url_replace request 'page' page_obj.previous_page_number %}" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
<span class="sr-only">Previous</span>
</a>
</li>
{% endif %}
<li class="page-item disabled">
<span class="page-link">Page {{ page_obj.number }} of {{ paginator.num_pages }}.</span>
</li>
{% if page_obj.has_next %}
<li class="page-item">
<a class="page-link" href="?{% url_replace request 'page' page_obj.next_page_number %}" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
<span class="sr-only">Next</span>
</a>
</li>
{% endif %}
<li class="page-item ml-3">
<div class="input-group input-group-sm">
<input id="pageNumber" type="number" min="1" max="{{ paginator.num_pages }}" step="1" placeholder="page #" style="width: 4em;" aria-label="Page number">
<div class="input-group-append">
<button class="btn btn-outline-primary" type="button" onclick="modifyUrl('page',$('#pageNumber').val())">Go</button>
</div>
</div>
</li>
</ul>
</nav>
\ 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