Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odevzdávací Systém MO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MO-P
Odevzdávací Systém MO
Commits
e4bb29b3
Commit
e4bb29b3
authored
Jun 11, 2021
by
Jiří Kalvoda
Browse files
Options
Downloads
Patches
Plain Diff
Jinja filtr bool -> ano/ne
parent
6e16fde0
Branches
Branches containing commit
No related tags found
1 merge request
!78
UI pro nastavení testovacích účtů
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mo/web/jinja.py
+5
-0
5 additions, 0 deletions
mo/web/jinja.py
with
5 additions
and
0 deletions
mo/web/jinja.py
+
5
−
0
View file @
e4bb29b3
...
@@ -87,6 +87,11 @@ def none_value(s: Any, none_value: Any) -> Any:
...
@@ -87,6 +87,11 @@ def none_value(s: Any, none_value: Any) -> Any:
return
none_value
if
s
is
None
else
s
return
none_value
if
s
is
None
else
s
@app.template_filter
()
def
yes_no
(
a
:
bool
)
->
str
:
return
"
ano
"
if
a
else
"
ne
"
@app.template_filter
()
@app.template_filter
()
def
json_pretty
(
js
:
Any
)
->
str
:
def
json_pretty
(
js
:
Any
)
->
str
:
return
json
.
dumps
(
js
,
sort_keys
=
True
,
indent
=
4
,
ensure_ascii
=
False
)
return
json
.
dumps
(
js
,
sort_keys
=
True
,
indent
=
4
,
ensure_ascii
=
False
)
...
...
...
...
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
sign in
to comment