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
8eb15613
Commit
8eb15613
authored
Nov 18, 2020
by
Hervé MENAGER
Browse files
reformat customtags.py with black
parent
3cc5752b
Pipeline
#41739
failed with stages
in 12 minutes and 6 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ippisite/ippidb/templatetags/customtags.py
View file @
8eb15613
...
...
@@ -28,18 +28,21 @@ 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
'
class_suffix
=
"
success
"
icon_suffix
=
"
check
"
elif
value
is
False
:
class_suffix
=
'
danger
'
icon_suffix
=
'
times
'
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>'
)
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
...
...
@@ -101,7 +104,11 @@ def bootstrap_core(object):
css_classes
.
add
(
"formset-item-delete"
)
# HACK: if the css_class is a bootstrap column layout, transfer it to container element
for
css_class
in
css_classes
:
if
css_class
.
startswith
(
"col"
)
or
css_class
.
startswith
(
"order-"
)
or
css_class
.
startswith
(
"mb-"
):
if
(
css_class
.
startswith
(
"col"
)
or
css_class
.
startswith
(
"order-"
)
or
css_class
.
startswith
(
"mb-"
)
):
wrapping_classes
+=
f
"
{
css_class
}
"
css_classes
=
set
(
[
...
...
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