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
Martin Mareš
Odevzdávací Systém MO
Commits
20332028
Commit
20332028
authored
1 year ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
Jinja: Používáme knihovnu points
parent
7653de02
No related branches found
No related tags found
1 merge request
!134
Prázdné protokoly
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mo/web/jinja.py
+4
-9
4 additions, 9 deletions
mo/web/jinja.py
with
4 additions
and
9 deletions
mo/web/jinja.py
+
4
−
9
View file @
20332028
...
...
@@ -11,7 +11,9 @@ import urllib.parse
import
mo.config
as
config
import
mo.db
as
db
import
mo.place_level
import
mo.points
from
mo.rights
import
Right
from
mo.util
import
assert_not_none
import
mo.util_format
as
util_format
from
mo.web
import
app
from
mo.web.org_place
import
place_breadcrumbs
...
...
@@ -139,14 +141,7 @@ def user_flags(u: db.User) -> Markup:
@app.template_filter
()
def
sol_editable_points
(
s
:
Optional
[
db
.
Solution
])
->
str
:
if
s
is
None
:
return
'
X
'
elif
s
.
is_empty
:
return
'
P
'
elif
s
.
points
is
None
:
return
""
else
:
return
util_format
.
format_decimal
(
s
.
points
)
return
mo
.
points
.
format_sol_editable_points
(
s
)
@app.template_filter
()
...
...
@@ -161,4 +156,4 @@ def sol_display_points(s: Optional[db.Solution], user: bool = False) -> Union[st
else
:
return
Markup
(
'
<span class=
"
unknown
"
>?</span>
'
)
else
:
return
util_format
.
format_decimal
(
s
.
points
)
return
assert_not_none
(
util_format
.
format_decimal
(
s
.
points
)
)
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