compound_list.html 4.8 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 %}
Hervé  MENAGER's avatar
Hervé MENAGER committed
38
39
</form>
</div>
40

41
<main class="col-12 col-md-9 col-xl-10 pl-md-5 bd-content" role="main">
42
    <form>
43
44
        <div class="">
        <span class="m-2"><span>{{ count }} compounds</span>
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
            {% 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 %}
67
            {% endif %}
68
69
70
71
72
73
74
75
76
        </span>
        <span class="btn-group float-right">
            <a class="btn btn-default btn-outline-primary {% if not display_list %}active{% endif %}" href="#" {% if display_list %}onclick="modifyUrl('display_list', null)"{% endif %}>
                <i class="fa fa-th" title="Vignettes"></i>
            </a>
            <a class="btn btn-default btn-outline-primary {% if display_list %}active{% endif %}" href="#" {% if not display_list %}onclick="modifyUrl('display_list', true)"{% endif %}>
                <i class="fa fa-bars" title="List"></i>
            </a>
        </span>
77
78
        </div>
    </form>
Hervé  MENAGER's avatar
Hervé MENAGER committed
79
{% if compounds %}
80
    {% if display_list %}
81
82
83
84
85
86
87
88
89
90
        {% for compound in compounds %}
            {% include "compound_table_item.html" with compound=compound %}
        {% endfor %}
    {% else %}
    <div class="row">
        {% for compound in compounds %}
            {% include "compound_grid_item.html" with compound=compound %}
        {% endfor %}
    </div>
    {% endif %}
Hervé  MENAGER's avatar
Hervé MENAGER committed
91
{% else %}
92
    <p>Nothing found there!</p>
Hervé  MENAGER's avatar
Hervé MENAGER committed
93
94
95
96
97
98
99
100
101
{% endif %}					
                    </main>
</div>
</div>

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