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
3a9560fd
Commit
3a9560fd
authored
4 years ago
by
Jiří Setnička
Browse files
Options
Downloads
Patches
Plain Diff
Round: Zobrazení a editace nastavení výsledkovky
parent
bbc9ea83
No related branches found
No related tags found
1 merge request
!33
Výsledkové listiny - backend modul & pravidla MO
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
mo/web/jinja.py
+5
-0
5 additions, 0 deletions
mo/web/jinja.py
mo/web/org_round.py
+10
-0
10 additions, 0 deletions
mo/web/org_round.py
mo/web/templates/org_round.html
+3
-0
3 additions, 0 deletions
mo/web/templates/org_round.html
with
18 additions
and
0 deletions
mo/web/jinja.py
+
5
−
0
View file @
3a9560fd
...
...
@@ -72,6 +72,11 @@ def or_dash(s: Any) -> str:
return
str
(
s
)
if
s
else
'
–
'
@app.template_filter
()
def
none_value
(
s
:
Any
,
none_value
:
Any
)
->
Any
:
return
none_value
if
s
is
None
else
s
@app.template_filter
()
def
json_pretty
(
js
:
Any
)
->
str
:
return
json
.
dumps
(
js
,
sort_keys
=
True
,
indent
=
4
,
ensure_ascii
=
False
)
...
...
This diff is collapsed.
Click to expand it.
mo/web/org_round.py
+
10
−
0
View file @
3a9560fd
...
...
@@ -8,6 +8,7 @@ from typing import Optional, Tuple
import
werkzeug.exceptions
import
wtforms
from
wtforms
import
validators
from
wtforms.fields.html5
import
IntegerField
import
mo
import
mo.db
as
db
...
...
@@ -360,6 +361,15 @@ class RoundEditForm(FlaskForm):
pr_tasks_start
=
MODateTimeField
(
"
Čas zveřejnění úloh pro dozor
"
,
validators
=
[
validators
.
Optional
()])
ct_submit_end
=
MODateTimeField
(
"
Konec odevzdávání pro účastníky
"
,
validators
=
[
validators
.
Optional
()])
pr_submit_end
=
MODateTimeField
(
"
Konec odevzdávání pro dozor
"
,
validators
=
[
validators
.
Optional
()])
score_mode
=
wtforms
.
SelectField
(
"
Výsledková listina
"
,
choices
=
db
.
RoundScoreMode
.
choices
(),
coerce
=
db
.
RoundScoreMode
.
coerce
)
score_winner_limit
=
IntegerField
(
"
Hranice bodů pro vítěze
"
,
validators
=
[
validators
.
Optional
()],
description
=
"
Řešitelé s alespoň tolika body budou označeni za vítěze, prázdná hodnota = žádné neoznačovat
"
,
)
score_successful_limit
=
IntegerField
(
"
Hranice bodů pro úspěšné řešitele
"
,
validators
=
[
validators
.
Optional
()],
description
=
"
Řešitelé s alespoň tolika body budou označeni za úspěšné řešitele, prázdná hodnota = žádné neoznačovat
"
,
)
submit
=
wtforms
.
SubmitField
(
'
Uložit
'
)
...
...
This diff is collapsed.
Click to expand it.
mo/web/templates/org_round.html
+
3
−
0
View file @
3a9560fd
...
...
@@ -30,6 +30,9 @@
{% else %}
–
{% endif %}
<tr><td>
Výsledková listina
<td>
{{ round.score_mode.friendly_name() }}
<tr><td>
Hranice bodů pro vítěze
<td>
{{ round.score_winner_limit|none_value(Markup('
<i>
nenastaveno
</i>
')) }}
<tr><td>
Hranice bodů pro úspěšné řešitele
<td>
{{ round.score_successful_limit|none_value(Markup('
<i>
nenastaveno
</i>
')) }}
</table>
<div
class=
"btn-group"
>
...
...
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