compound_list.html 5.2 KB
Newer Older
1
{% extends "queries.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 id="mainnav">
8
        <nav class="secondary-nav">
9
10
11
        <div class="inner-wrap">
            <ul>
                <li>
12
                    <a href="/compound">By Compounds</a>
13
14
                </li>
                <li>
15
                    <a href="/queries/pockets">By Pockets</a>
16
17
18
19
20
21
22
23
24
                </li>
            </ul>
        </div>
    </nav>
</div>
<div class="inner-wrap">
    <nav class="breadcrumb" role="navigation">
        <div id="breadcrumb-label" class="breadcrumb-label">You are here</div>
        <div aria-labelledby="breadcrumb-label">
25
          {% block breadcrumb %} {{block.super}}> <a href="/compound/">By compounds</a>{% endblock %} 
26
27
28
        </div>
    </nav>
</div>
Hervé  MENAGER's avatar
Hervé MENAGER committed
29
30
31
32
33

<div class="container-fluid">
<div class="row flex-xl-nowrap">
  <div class="col-12 col-md-3 col-xl-2 bd-sidebar">
<form>
34
35
36
37
  {% include "multiselection_list_menu.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_list_menu.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_list_menu.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_list_menu.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 %}
38
  <input type="hidden" name="display" value="{{ display }}" />
Hervé  MENAGER's avatar
Hervé MENAGER committed
39
40
</form>
</div>
41

42
<main class="col-12 col-md-9 col-xl-10 pl-md-5 bd-content" role="main">
43
    <form>
44
45
        <div class="row">
        <span class="col-md-10"><span>{{ count }} compounds</span>
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
            {% if selected_ppis or selected_diseases or selected_taxonomies or selected_boundcomplexes %}
                <span>&nbsp;-&nbsp;filters:&nbsp;</span>
                {% if selected_ppis %}
                    {% for selected in selected_ppis %}
                        {% include "selected_badge.html" with selected=selected %}
                    {% endfor %}
                {% endif %}
                {% if selected_diseases %}
                    {% for selected in selected_diseases %}
                        {% include "selected_badge.html" with selected=selected %}
                    {% endfor %}
                {% endif %}
                {% if selected_taxonomies %}
                    {% for selected in selected_taxonomies %}
                        {% include "selected_badge.html" with selected=selected %}
                    {% endfor %}
                {% endif %}
                {% if selected_boundcomplexes %}
                    {% for selected in selected_boundcomplexes %}
                        {% include "selected_badge.html" with selected=selected %}
                    {% endfor %}
                {% endif %}
68
            {% endif %}
69
        </span>
70
        <span class="btn-group col-md-2">
71
            <a class="btn btn-default btn-outline-primary {% if display == 'v' %}active{% endif %}" href="#" {% if display != 'v' %}onclick="modifyUrl('display', 'v')"{% endif %}>
72
73
                <i class="fa fa-th" title="Vignettes"></i>
            </a>
74
            <a class="btn btn-default btn-outline-primary {% if display == 'l' %}active{% endif %}" href="#" {% if display != 'l' %}onclick="modifyUrl('display', 'l')"{% endif %}>
75
76
                <i class="fa fa-bars" title="List"></i>
            </a>
77
78
79
            <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>
80
        </span>
81
82
        </div>
    </form>
Hervé  MENAGER's avatar
Hervé MENAGER committed
83
{% if compounds %}
84
85
86
87
88
89
    <div class="row">
    {% if display == 'v' %}
        {% for compound in compounds %}
            {% include "compound_v_item.html" with compound=compound %}
        {% endfor %}
    {% elif display == 'l'%}
90
        {% for compound in compounds %}
91
            {% include "compound_l_item.html" with compound=compound %}
92
93
        {% endfor %}
    {% else %}
94
        {% include "compound_t_list.html" with compounds=compounds %}
95
    {% endif %}
96
    </div>
Hervé  MENAGER's avatar
Hervé MENAGER committed
97
{% else %}
98
    <p>Nothing found there!</p>
Hervé  MENAGER's avatar
Hervé MENAGER committed
99
100
101
102
103
104
105
106
107
{% endif %}					
                    </main>
</div>
</div>

<nav>
  <ul class="pagination justify-content-end">
    {% if compounds.has_previous %}
    <li class="page-item">
108
     <a class="page-link" href="?{% url_replace request 'page' compounds.previous_page_number  %}" tabindex="-1">Previous</a>
Hervé  MENAGER's avatar
Hervé MENAGER committed
109
110
111
112
113
114
115
116
117
    </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">
118
     <a class="page-link" href="?{% url_replace request 'page' compounds.next_page_number  %}" tabindex="-1">Next</a>
Hervé  MENAGER's avatar
Hervé MENAGER committed
119
120
121
122
123
    </li>
    {% endif %}
  </ul>
</nav>
{% endblock %}