compound_list.html 10.1 KB
Newer Older
Hervé  MENAGER's avatar
Hervé MENAGER committed
1
{% extends "base.html" %}
2
{% load customtags %}
Hervé  MENAGER's avatar
Hervé MENAGER committed
3
    
4
{% block title %}compounds list{% endblock %}
Hervé  MENAGER's avatar
Hervé MENAGER committed
5

6
7
8
9
10
11
{% block extra_js %}
<script src="/static/marvinjs-18/js/util.js"></script>
<script src="/static/marvinjs-18/js/marvinjslauncher.js"></script>
<script src="/static/marvinjs-18/gui/lib/promise-1.0.0.min.js"></script>
{% endblock %}

Hervé  MENAGER's avatar
Hervé MENAGER committed
12
{% block content %}
13
<div class="inner-wrap">
Rachel TORCHET's avatar
Rachel TORCHET committed
14
15
    <nav class="breadcrumb breadNav" role="navigation">
        <div class="breadNav-label">You are here</div>
16
        <div aria-labelledby="breadcrumb-label">
17
            {% block breadcrumb %} <a href="/compounds/" class="breadNav-link"> > Query compounds</a>{% endblock %} 
18
19
20
        </div>
    </nav>
</div>
Hervé  MENAGER's avatar
Hervé MENAGER committed
21
22
23

<div class="container-fluid">
<div class="row flex-xl-nowrap">
24

25
<main class="col-12" role="main">
26
27
    <form class="container-fluid">
        <div class="m-2 d-flex justify-content-between">
28
       {% include "multiselection_button.html" with label="PPI Family" param_name="family" %}
29
30
31
32
       {% include "multiselection_button.html" with label="PPI" param_name="ppi" %}
       {% include "multiselection_button.html" with label="Disease" param_name="disease" %}
       {% include "multiselection_button.html" with label="Organism" param_name="taxonomy" %}
       {% include "multiselection_button.html" with label="Bound complex" param_name="boundcomplex" %}
33
       {% include "slider_button.html" with label="Molecular weight" param_name="molecular_weight" %}
34
       {% include "slider_button.html" with label="AlogP" param_name="a_log_p" %}
35
       {% include "slider_button.html" with label="H donors" param_name="nb_donor_h" %}
36
       {% include "slider_button.html" with label="Publications" param_name="pubs" %}
37
       {% include "marvinjs_button.html" %}
38
        </div>
39
        <div class="m-2 d-flex ">
40
            <span>{{ paginator.count }} compounds</span>
41
            {% if selected_family or selected_ppi or selected_disease or selected_taxonomy or selected_boundcomplex or molecular_weight != molecular_weight_max or a_log_p != a_log_p_max or nb_donor_h != nb_donor_h_max or pubs != pubs_min or similar_to %}
42
43
            <span>
                &nbsp;-&nbsp;filters:&nbsp;
44
45
                {% if selected_family %}
                    {% for selected in selected_family %}
46
47
48
                        {% include "selected_badge.html" with param_name="family" selected=selected %}
                    {% endfor %}
                {% endif %}
49
50
                {% if selected_ppi %}
                    {% for selected in selected_ppi %}
51
                        {% include "selected_badge.html" with param_name="ppi" selected=selected %}
52
53
                    {% endfor %}
                {% endif %}
54
55
                {% if selected_disease %}
                    {% for selected in selected_disease %}
56
                        {% include "selected_badge.html" with param_name="disease" selected=selected %}
57
58
                    {% endfor %}
                {% endif %}
59
60
                {% if selected_taxonomy %}
                    {% for selected in selected_taxonomy %}
61
                        {% include "selected_badge.html" with param_name="taxonomy" selected=selected %}
62
63
                    {% endfor %}
                {% endif %}
64
65
                {% if selected_boundcomplex %}
                    {% for selected in selected_boundcomplex %}
66
                        {% include "selected_badge.html" with param_name="boundcomplex" selected=selected %}
67
68
                    {% endfor %}
                {% endif %}
69
70
71
                {% if molecular_weight != molecular_weight_max %}
                    {% include "slider_badge.html" with param_name="molecular_weight" param_value=molecular_weight param_label="MW cutoff" %}
                {% endif %}
72
73
74
                {% if a_log_p != a_log_p_max %}
                    {% include "slider_badge.html" with param_name="a_log_p" param_value=a_log_p param_label="AlogP cutoff" %}
                {% endif %}
75
76
77
                {% if nb_donor_h != nb_donor_h_max %}
                    {% include "slider_badge.html" with param_name="nb_donor_h" param_value=nb_donor_h param_label="H donors" %}
                {% endif %}
78
                {% if pubs != pubs_min %}
79
80
                    {% include "slider_badge.html" with param_name="pubs" param_value=pubs param_label="Publications" %}
                {% endif %}
81
82
83
                {% if similar_to %}
                    {% include "similarity_badge.html" with param_name="similar_to" param_value=similar_to param_label="Similar to" %}
                {% endif %}
84
            </span>
85
            {% endif %}
86
87
88
89
90
91
92
93
94
            <div class="btn-group m-1 ml-auto">
                <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>
                <div class="dropdown-menu" aria-labelledby="sortMenuButto">
                    {% for sort_by_value, sort_by_entry in sort_by_options.items %}
                            <a class="dropdown-item {% if sort_by_value == sort_by %}active{% endif %}" href="#" onclick="modifyUrl('sort_by','{{ sort_by_value }}')">{{ sort_by_entry.name }} ({{ sort_by_entry.order }})</a>
                    {% endfor %}
                </div>
95
            </div>
96
97
98
99
100
101
102
103
104
105
106
            <span class="btn-group m-1">
                <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>
                <a class="btn btn-default btn-outline-primary {% if display == 'l' %}active{% endif %}" href="#" {% if display != 'l' %}onclick="modifyUrl('display', 'l')"{% endif %}>
                    <i class="fa fa-bars" title="List"></i>
                </a>
                <a class="btn btn-default btn-outline-primary {% if display == 't' %}active{% endif %}" href="#" {% if display != 't' %}onclick="modifyUrl('display', 't')"{% endif %}>
                    <i class="fa fa-table" title="Table"></i>
                </a>
            </span>
107
108
        </div>
    </form>
109
{% if page_obj %}
110
    <div class="container-fluid">
111
    {% if display == 'v' %}
112
        <div class="d-flex flex-wrap m-2 justify-content-around">
113
        {% for compound in page_obj %}
114
115
            {% include "compound_v_item.html" with compound=compound %}
        {% endfor %}
116
        </div>
117
    {% elif display == 'l'%}
118
        {% for compound in page_obj %}
119
            {% include "compound_l_item.html" with compound=compound %}
120
121
        {% endfor %}
    {% else %}
122
        {% include "compound_t_list.html" with compounds=page_obj %}
123
    {% endif %}
124
    </div>
Hervé  MENAGER's avatar
Hervé MENAGER committed
125
{% else %}
126
    <p>Nothing found there!</p>
Hervé  MENAGER's avatar
Hervé MENAGER committed
127
128
129
130
131
{% endif %}					
                    </main>
</div>
</div>

132
133
<nav class="d-flex">
  <ul class="pagination pagination-sm ml-auto">
134
    {% if page_obj.has_previous %}
Hervé  MENAGER's avatar
Hervé MENAGER committed
135
    <li class="page-item">
136
      <a class="page-link" href="?{% url_replace request 'page' page_obj.previous_page_number  %}" aria-label="Previous">
137
138
139
        <span aria-hidden="true">&laquo;</span>
        <span class="sr-only">Previous</span>
      </a>
Hervé  MENAGER's avatar
Hervé MENAGER committed
140
141
142
143
    </li>
    {% endif %}

    <li class="page-item disabled">
144
     <span class="page-link">Page {{ page_obj.number }} of {{ paginator.num_pages }}.</span>
Hervé  MENAGER's avatar
Hervé MENAGER committed
145
146
    </li>

147
    {% if page_obj.has_next %}
Hervé  MENAGER's avatar
Hervé MENAGER committed
148
    <li class="page-item">
149
      <a class="page-link" href="?{% url_replace request 'page' page_obj.next_page_number  %}" aria-label="Next">
150
151
152
        <span aria-hidden="true">&raquo;</span>
        <span class="sr-only">Next</span>
      </a>
Hervé  MENAGER's avatar
Hervé MENAGER committed
153
154
    </li>
    {% endif %}
155
156
157

    <li class="page-item ml-3">
      <div class="input-group input-group-sm">
158
        <input id="pageNumber" type="number" min="1" max="{{ paginator.num_pages }}" step="1" placeholder="page #" style="width: 4em;" aria-label="Page number">
159
160
161
162
163
164
        <div class="input-group-append">
          <button class="btn btn-outline-primary" type="button" onclick="modifyUrl('page',$('#pageNumber').val())">Go</button>
        </div>
      </div>
    </li>

Hervé  MENAGER's avatar
Hervé MENAGER committed
165
166
  </ul>
</nav>
167

168
169
170
171
172
  {% 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 %}
  {% include "multiselection_modal.html" with label="Disease" selected_list=selected_disease unselected_list=disease param_name="disease" all_param_name="disease_all" all_param_value=disease_all %}
  {% include "multiselection_modal.html" with label="Organism" selected_list=selected_taxonomy unselected_list=taxonomy param_name="taxonomy" all_param_name="taxonomy_all" all_param_value=taxonomy_all %}
  {% include "multiselection_modal.html" with label="Bound complex" selected_list=selected_boundcomplex unselected_list=boundcomplex param_name="boundcomplex" all_param_name="boundcomplex_all" all_param_value=boundcomplex_all %}
173
174
  {% include "slider_modal.html" with label="Molecular Weight" param_name="molecular_weight" param_min=molecular_weight_min param_max=molecular_weight_max param_value=molecular_weight step='50' param_label='Select a cutoff value for the molecular weight of the compounds to be selected'%}
  {% include "slider_modal.html" with label="AlogP" param_name="a_log_p" param_min=a_log_p_min param_max=a_log_p_max param_value=a_log_p step='1' param_label='Select a cutoff value for the AlogP of the compounds to be selected'%}
175
  {% include "slider_modal.html" with label="H donors" param_name="nb_donor_h" param_min=nb_donor_h_min param_max=nb_donor_h_max param_value=nb_donor_h step='1' param_label='Select a cutoff value for the number of H donors in the compounds to be selected'%}
176
  {% include "slider_modal.html" with label="Publications" param_name="pubs" param_min=pubs_min param_max=pubs_max param_value=pubs step='1' param_label='Select a cutoff value for the number of publications mentioning the compounds to be selected'%}
177
  {% include "marvinjs_modal.html" with smiles=similar_to %}
178

Hervé  MENAGER's avatar
Hervé MENAGER committed
179
{% endblock %}