compound_list.html 9.63 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

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

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

19
<main class="col-12" role="main">
20
21
    <form class="container-fluid">
        <div class="m-2 d-flex justify-content-between">
22
       {% include "multiselection_button.html" with label="PPI Family" param_name="family" %}
23
24
25
26
       {% 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" %}
27
       {% include "slider_button.html" with label="Molecular weight" param_name="molecular_weight" %}
28
       {% include "slider_button.html" with label="AlogP" param_name="a_log_p" %}
29
       {% include "slider_button.html" with label="H donors" param_name="nb_donor_h" %}
30
       {% include "slider_button.html" with label="Publications" param_name="pubs" %}
31
        </div>
32
33
        <div class="m-2 d-flex ">
            <span>{{ compounds.paginator.count }} compounds</span>
34
            {% if selected_families or selected_ppis or selected_diseases or selected_taxonomies or selected_boundcomplexes 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 %}
35
36
            <span>
                &nbsp;-&nbsp;filters:&nbsp;
37
38
39
40
41
                {% if selected_families %}
                    {% for selected in selected_families %}
                        {% include "selected_badge.html" with param_name="family" selected=selected %}
                    {% endfor %}
                {% endif %}
42
43
                {% if selected_ppis %}
                    {% for selected in selected_ppis %}
44
                        {% include "selected_badge.html" with param_name="ppi" selected=selected %}
45
46
47
48
                    {% endfor %}
                {% endif %}
                {% if selected_diseases %}
                    {% for selected in selected_diseases %}
49
                        {% include "selected_badge.html" with param_name="disease" selected=selected %}
50
51
52
53
                    {% endfor %}
                {% endif %}
                {% if selected_taxonomies %}
                    {% for selected in selected_taxonomies %}
54
                        {% include "selected_badge.html" with param_name="taxonomy" selected=selected %}
55
56
57
58
                    {% endfor %}
                {% endif %}
                {% if selected_boundcomplexes %}
                    {% for selected in selected_boundcomplexes %}
59
                        {% include "selected_badge.html" with param_name="boundcomplex" selected=selected %}
60
61
                    {% endfor %}
                {% endif %}
62
63
64
                {% if molecular_weight != molecular_weight_max %}
                    {% include "slider_badge.html" with param_name="molecular_weight" param_value=molecular_weight param_label="MW cutoff" %}
                {% endif %}
65
66
67
                {% 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 %}
68
69
70
                {% 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 %}
71
                {% if pubs != pubs_min %}
72
73
                    {% include "slider_badge.html" with param_name="pubs" param_value=pubs param_label="Publications" %}
                {% endif %}
74
            </span>
75
            {% endif %}
76
77
78
79
80
81
82
83
84
            <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>
85
            </div>
86
87
88
89
90
91
92
93
94
95
96
            <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>
97
98
        </div>
    </form>
Hervé  MENAGER's avatar
Hervé MENAGER committed
99
{% if compounds %}
100
    <div class="container-fluid">
101
    {% if display == 'v' %}
102
        <div class="d-flex flex-wrap m-2 justify-content-around">
103
104
105
        {% for compound in compounds %}
            {% include "compound_v_item.html" with compound=compound %}
        {% endfor %}
106
        </div>
107
    {% elif display == 'l'%}
108
        {% for compound in compounds %}
109
            {% include "compound_l_item.html" with compound=compound %}
110
111
        {% endfor %}
    {% else %}
112
        {% include "compound_t_list.html" with compounds=compounds %}
113
    {% endif %}
114
    </div>
Hervé  MENAGER's avatar
Hervé MENAGER committed
115
{% else %}
116
    <p>Nothing found there!</p>
Hervé  MENAGER's avatar
Hervé MENAGER committed
117
118
119
120
121
{% endif %}					
                    </main>
</div>
</div>

122
123
<nav class="d-flex">
  <ul class="pagination pagination-sm ml-auto">
Hervé  MENAGER's avatar
Hervé MENAGER committed
124
125
    {% if compounds.has_previous %}
    <li class="page-item">
126
127
128
129
      <a class="page-link" href="?{% url_replace request 'page' compounds.previous_page_number  %}" aria-label="Previous">
        <span aria-hidden="true">&laquo;</span>
        <span class="sr-only">Previous</span>
      </a>
Hervé  MENAGER's avatar
Hervé MENAGER committed
130
131
132
133
134
135
136
137
138
    </li>
    {% endif %}

    <li class="page-item disabled">
     <span class="page-link">Page {{ compounds.number }} of {{ compounds.paginator.num_pages }}.</span>
    </li>

    {% if compounds.has_next %}
    <li class="page-item">
139
140
141
142
      <a class="page-link" href="?{% url_replace request 'page' compounds.next_page_number  %}" aria-label="Next">
        <span aria-hidden="true">&raquo;</span>
        <span class="sr-only">Next</span>
      </a>
Hervé  MENAGER's avatar
Hervé MENAGER committed
143
144
    </li>
    {% endif %}
145
146
147
148
149
150
151
152
153
154

    <li class="page-item ml-3">
      <div class="input-group input-group-sm">
        <input id="pageNumber" type="number" min="1" max="{{compounds.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>

Hervé  MENAGER's avatar
Hervé MENAGER committed
155
156
  </ul>
</nav>
157

158
  {% include "multiselection_modal.html" with label="PPI Family" selected_list=selected_families unselected_list=families param_name="family" all_param_name="families_all" all_param_value=families_all %}
159
160
161
162
  {% include "multiselection_modal.html" with label="PPI" selected_list=selected_ppis unselected_list=ppis param_name="ppi" all_param_name="ppis_all" all_param_value=ppis_all %}
  {% include "multiselection_modal.html" with label="Disease" selected_list=selected_diseases unselected_list=diseases param_name="disease" all_param_name="diseases_all" all_param_value=diseases_all %}
  {% include "multiselection_modal.html" with label="Organism" selected_list=selected_taxonomies unselected_list=taxonomies param_name="taxonomy" all_param_name="taxonomies_all" all_param_value=taxonomies_all %}
  {% include "multiselection_modal.html" with label="Bound complex" selected_list=selected_boundcomplexes unselected_list=boundcomplexes param_name="boundcomplex" all_param_name="boundcomplexes_all" all_param_value=boundcomplexes_all %}
163
164
  {% 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'%}
165
  {% 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'%}
166
  {% 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'%}
167

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