Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ippidb-web
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iPPIDB
ippidb-web
Commits
4d26c3ad
Commit
4d26c3ad
authored
7 years ago
by
Hervé MENAGER
Browse files
Options
Downloads
Patches
Plain Diff
add badges for filters and matches count in compounds list (WIP)
Former-commit-id: 20733216244f5b9ba737f1d8cd52c009199e92b6
parent
80a8933e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ippisite/ippidb/templates/compound_list.html
+26
-0
26 additions, 0 deletions
ippisite/ippidb/templates/compound_list.html
ippisite/ippidb/views.py
+3
-1
3 additions, 1 deletion
ippisite/ippidb/views.py
with
29 additions
and
1 deletion
ippisite/ippidb/templates/compound_list.html
+
26
−
0
View file @
4d26c3ad
...
@@ -40,7 +40,33 @@
...
@@ -40,7 +40,33 @@
{% 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 %}
{% 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 %}
</form>
</form>
</div>
</div>
<main
class=
"col-12 col-md-9 col-xl-10 pl-md-5 bd-content"
role=
"main"
>
<main
class=
"col-12 col-md-9 col-xl-10 pl-md-5 bd-content"
role=
"main"
>
<div
class=
"row m-2 border border- bg-light"
><span>
{{ count }} compounds
</span>
{% if selected_ppis or selected_diseases or selected_taxonomies or selected_boundcomplexes %}
<span>
-
filters:
</span>
{% if selected_ppis %}
{% for selected in selected_ppis %}
<span
class=
"badge badge-info"
style=
"font-size: 100%"
>
{{ selected.name }}
</span>
{% endfor %}
{% endif %}
{% if selected_diseases %}
{% for selected in selected_diseases %}
<span
class=
"badge badge-info"
style=
"font-size: 100%"
>
{{ selected.name }}
</span>
{% endfor %}
{% endif %}
{% if selected_taxonomies %}
{% for selected in selected_taxonomies %}
<span
class=
"badge badge-info"
style=
"font-size: 100%"
>
{{ selected.name }}
</span>
{% endfor %}
{% endif %}
{% if selected_boundcomplexes %}
{% for selected in selected_boundcomplexes %}
<span
class=
"badge badge-info"
style=
"font-size: 100%"
>
{{ selected.name }}
</span>
{% endfor %}
{% endif %}
{% endif %}
</div>
{% if compounds %}
{% if compounds %}
{% for compound in compounds %}
{% for compound in compounds %}
{% include "compound_abstract.html" with compound=compound %}
{% include "compound_abstract.html" with compound=compound %}
...
...
This diff is collapsed.
Click to expand it.
ippisite/ippidb/views.py
+
3
−
1
View file @
4d26c3ad
...
@@ -219,6 +219,7 @@ def compound_list(request):
...
@@ -219,6 +219,7 @@ def compound_list(request):
boundcomplexes
=
ProteinDomainBoundComplex
.
objects
.
exclude
(
id__in
=
request
.
GET
.
getlist
(
'
boundcomplex
'
))
boundcomplexes
=
ProteinDomainBoundComplex
.
objects
.
exclude
(
id__in
=
request
.
GET
.
getlist
(
'
boundcomplex
'
))
if
boundcomplexes_all
is
None
:
if
boundcomplexes_all
is
None
:
boundcomplexes
=
boundcomplexes
[:
5
]
boundcomplexes
=
boundcomplexes
[:
5
]
count
=
compounds
.
count
()
# handle pagination in compounds list
# handle pagination in compounds list
paginator
=
Paginator
(
compounds
,
5
)
paginator
=
Paginator
(
compounds
,
5
)
page
=
request
.
GET
.
get
(
'
page
'
)
page
=
request
.
GET
.
get
(
'
page
'
)
...
@@ -230,7 +231,8 @@ def compound_list(request):
...
@@ -230,7 +231,8 @@ def compound_list(request):
except
EmptyPage
:
except
EmptyPage
:
# If page is out of range (e.g. 9999), deliver last page of results.
# If page is out of range (e.g. 9999), deliver last page of results.
compounds
=
paginator
.
page
(
paginator
.
num_pages
)
compounds
=
paginator
.
page
(
paginator
.
num_pages
)
return
render
(
request
,
'
compound_list.html
'
,
{
'
compounds
'
:
compounds
,
return
render
(
request
,
'
compound_list.html
'
,
{
'
compounds
'
:
compounds
,
'
count
'
:
count
,
'
selected_ppis
'
:
selected_ppis
,
'
selected_ppis
'
:
selected_ppis
,
'
ppis
'
:
ppis
,
'
ppis
'
:
ppis
,
'
ppis_all
'
:
ppis_all
,
'
ppis_all
'
:
ppis_all
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment