Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iPPIDB
ippidb-web
Commits
3cc5752b
Commit
3cc5752b
authored
Nov 18, 2020
by
Hervé MENAGER
Browse files
add icons for physicochemical rules compliance in compounds list
as requested in #251
parent
260b8088
Pipeline
#41736
failed with stages
in 11 minutes and 21 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ippisite/ippidb/templates/compound_l_item.html
View file @
3cc5752b
{% load customtags %}
<div
class=
"row m-2 border border-info bg-light border_card"
style=
"box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.2);"
>
{%if show_detail != True %}
<div
class=
"col-sm-3 border-info d-flex justify-content-center align-content-center {% if compound.replaced_with or compound.is_validated is False %}bg_warning{% endif %}"
>
...
...
@@ -8,6 +10,11 @@
{% if compound.tanimoto != None %}
<h2
class=
"position-absolute"
style=
"top:0.3em; right:0.3em;"
title=
"tanimoto similarity value"
><span
class=
"badge badge-light text-warning"
>
{{ compound.tanimoto }}
</span></h2>
{% endif %}
<h2
class=
"position-absolute"
style=
"top:270px; left:0.3em;"
><span
class=
"badge badge-light"
>
{% rule_status_icon compound.lipinsky "Lipinski's RO5" %}
{% rule_status_icon compound.veber "Veber" %}
{% rule_status_icon compound.pfizer "Pfizer" %}
</h2>
</div>
{% endif %}
<div
class=
"{%if show_detail != True %}col-sm-9{% else %}col-sm-12{% endif %}"
>
...
...
ippisite/ippidb/templatetags/customtags.py
View file @
3cc5752b
...
...
@@ -28,6 +28,19 @@ def status_class(value):
else
:
return
"table-secondary"
@
register
.
simple_tag
def
rule_status_icon
(
value
,
title
):
if
value
is
True
:
class_suffix
=
'success'
icon_suffix
=
'check'
elif
value
is
False
:
class_suffix
=
'danger'
icon_suffix
=
'times'
else
:
class_suffix
=
'secondary'
class_suffix
=
'question'
return
mark_safe
(
f
'<i class="fas fa-
{
icon_suffix
}
text-
{
class_suffix
}
" title="
{
title
}
: failed"></i>'
)
@
register
.
filter
def
bootstrap
(
object
):
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment