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
52d51371
Commit
52d51371
authored
2 years ago
by
Jiří Setnička
Browse files
Options
Downloads
Patches
Plain Diff
Zveřejnění uložené verze výsledkové listiny ze stránky verze
parent
9f920bf6
No related branches found
No related tags found
1 merge request
!124
Zjednodušení práce s joby
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mo/web/org_score.py
+4
-0
4 additions, 0 deletions
mo/web/org_score.py
mo/web/templates/org_score_snapshot.html
+20
-2
20 additions, 2 deletions
mo/web/templates/org_score_snapshot.html
with
24 additions
and
2 deletions
mo/web/org_score.py
+
4
−
0
View file @
52d51371
...
@@ -261,6 +261,7 @@ def org_score(round_id: Optional[int] = None, hier_id: Optional[int] = None, ct_
...
@@ -261,6 +261,7 @@ def org_score(round_id: Optional[int] = None, hier_id: Optional[int] = None, ct_
class
SetFinalScoretableForm
(
FlaskForm
):
class
SetFinalScoretableForm
(
FlaskForm
):
scoretable_id
=
wtforms
.
IntegerField
()
scoretable_id
=
wtforms
.
IntegerField
()
back_url
=
wtforms
.
HiddenField
()
submit_set_final
=
wtforms
.
SubmitField
(
"
Zveřejnit
"
)
submit_set_final
=
wtforms
.
SubmitField
(
"
Zveřejnit
"
)
submit_hide
=
wtforms
.
SubmitField
(
"
Skrýt
"
)
submit_hide
=
wtforms
.
SubmitField
(
"
Skrýt
"
)
...
@@ -323,6 +324,8 @@ def org_score_snapshots(ct_id: int):
...
@@ -323,6 +324,8 @@ def org_score_snapshots(ct_id: int):
flash
(
"
Výsledková listina skryta.
"
,
"
success
"
)
flash
(
"
Výsledková listina skryta.
"
,
"
success
"
)
else
:
else
:
flash
(
"
Neznámé ID výsledkové listiny.
"
,
"
danger
"
)
flash
(
"
Neznámé ID výsledkové listiny.
"
,
"
danger
"
)
if
set_final_form
.
back_url
.
data
:
return
redirect
(
set_final_form
.
back_url
.
data
)
return
redirect
(
ctx
.
url_for
(
'
org_score_snapshots
'
))
return
redirect
(
ctx
.
url_for
(
'
org_score_snapshots
'
))
return
render_template
(
return
render_template
(
...
@@ -382,6 +385,7 @@ def org_score_snapshot(ct_id: int, scoretable_id: int):
...
@@ -382,6 +385,7 @@ def org_score_snapshot(ct_id: int, scoretable_id: int):
'
org_score_snapshot.html
'
,
'
org_score_snapshot.html
'
,
ctx
=
ctx
,
ctx
=
ctx
,
table
=
table
,
table
=
table
,
set_final_form
=
SetFinalScoretableForm
()
if
ctx
.
rights
.
have_right
(
Right
.
manage_contest
)
else
None
,
scoretable
=
scoretable
,
scoretable
=
scoretable
,
)
)
else
:
else
:
...
...
This diff is collapsed.
Click to expand it.
mo/web/templates/org_score_snapshot.html
+
20
−
2
View file @
52d51371
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
{% if ctx.rights.have_right(Right.view_contestants) %}
{% if ctx.rights.have_right(Right.view_contestants) %}
<div
class=
"btn-group pull-right"
>
<div
class=
"btn-group pull-right"
>
<a
class=
"btn btn-default"
href=
"{{ ctx.url_for('org_score') }}"
>
Aktuální výsledky
</a>
<a
class=
"btn btn-default"
href=
"{{ ctx.url_for('org_score') }}"
>
Aktuální výsledky
</a>
<a
class=
"btn btn-default"
href=
"{{ ctx.url_for('org_score_snapshots') }}"
>
U
ložené v
ýsledky
</a>
<a
class=
"btn btn-default"
href=
"{{ ctx.url_for('org_score_snapshots') }}"
>
Všechny u
ložené v
erze
</a>
{% if scoretable.pdf_file %}
{% if scoretable.pdf_file %}
<a
class=
"btn btn-default"
href=
"{{ ctx.url_for('org_score_snapshot_pdf', scoretable_id=scoretable.scoretable_id) }}"
>
PDF
</a>
<a
class=
"btn btn-default"
href=
"{{ ctx.url_for('org_score_snapshot_pdf', scoretable_id=scoretable.scoretable_id) }}"
>
PDF
</a>
{% endif %}
{% endif %}
...
@@ -21,9 +21,27 @@
...
@@ -21,9 +21,27 @@
{% block body %}
{% block body %}
{% if set_final_form %}
<form
method=
"POST"
action=
"{{ ctx.url_for('org_score_snapshots') }}"
class=
"pull-right"
>
{{ set_final_form.csrf_token }}
<input
type=
"hidden"
name=
"back_url"
value=
"{{ ctx.url_for('org_score_snapshot', scoretable_id=scoretable.scoretable_id) }}"
>
{% if ctx.contest.scoretable_id == scoretable.scoretable_id %}
<input
type=
"submit"
name=
"submit_hide"
class=
"btn btn-danger"
value=
"Zrušit zveřejnění"
>
{% else %}
<input
type=
"hidden"
name=
"scoretable_id"
value=
"{{ scoretable.scoretable_id }}"
>
<input
type=
"submit"
name=
"submit_set_final"
class=
"btn btn-primary"
value=
"Zveřejnit tuto verzi"
>
{% endif %}
</form>
{% endif %}
{% if ctx.rights.have_right(Right.view_contestants) %}
{% if ctx.rights.have_right(Right.view_contestants) %}
<p>
Výsledková listina odpovídající stavu k {{ scoretable.created_at|timeformat }}.
<p>
Výsledková listina odpovídající stavu k {{ scoretable.created_at|timeformat }}.
Lze ji zveřejnit jako oficiální výsledkovou listinu v přehledu všech uložených verzí výsledkových listin pro tuto soutěž.
</p>
{% if scoretable.scoretable_id == ctx.contest.scoretable_id %}
<strong>
Tato verze je zveřejněna jako oficiální výsledková listina.
</strong>
{% else %}
Tato verze není zveřejněna jako oficiální výsledková listina.
{% endif %}
</p>
{% endif %}
{% endif %}
<table
class=
'data'
>
<table
class=
'data'
>
...
...
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