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
820258de
Project 'mj/mo-submit' was moved to 'mo-p/osmo'. Please update any links and bookmarks that may still have the old path.
Commit
820258de
authored
Mar 8, 2021
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
Rights: Adaptace účastnického UI
parent
f26f3eb2
No related branches found
No related tags found
1 merge request
!49
Stavy soutěže
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
mo/web/templates/user_contest.html
+5
-5
5 additions, 5 deletions
mo/web/templates/user_contest.html
mo/web/templates/user_index.html
+1
-1
1 addition, 1 deletion
mo/web/templates/user_index.html
mo/web/user.py
+4
-4
4 additions, 4 deletions
mo/web/user.py
with
10 additions
and
10 deletions
mo/web/templates/user_contest.html
+
5
−
5
View file @
820258de
{% extends "base.html" %}
{% extends "base.html" %}
{% set round = contest.round %}
{% set round = contest.round %}
{% set state =
round.
state %}
{% set state =
contest.get_
state %}
{% block title %}{{ round.name }} {{ round.year }}. ročníku kategorie {{ round.category }}: {{ contest.place.name }}{% endblock %}
{% block title %}{{ round.name }} {{ round.year }}. ročníku kategorie {{ round.category }}: {{ contest.place.name }}{% endblock %}
{% block breadcrumbs %}
{% block breadcrumbs %}
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
přehled úloh a budete zde moci odevzdat svá řešení k jednotlivým úlohám.
přehled úloh a budete zde moci odevzdat svá řešení k jednotlivým úlohám.
Do té doby zde nenajdete nic jiného.
Do té doby zde nenajdete nic jiného.
</p>
</p>
{% elif state == RoundState.running and not
round
.ct_can_submit() %}
{% elif state == RoundState.running and not
contest
.ct_can_submit() %}
<p>
<p>
Soutěžní kolo
<b>
je připraveno
</b>
, ale zatím nelze odevzdávat. Odevzdávání začne
Soutěžní kolo
<b>
je připraveno
</b>
, ale zatím nelze odevzdávat. Odevzdávání začne
<b>
{{ round.ct_tasks_start|time_and_timedelta }}
</b>
.
<b>
{{ round.ct_tasks_start|time_and_timedelta }}
</b>
.
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
technickým problémům. Není však zaručeno, že řešení budou hodnocena.
technickým problémům. Není však zaručeno, že řešení budou hodnocena.
{% endif %}
{% endif %}
</p>
</p>
{% if
round
.ct_can_submit() %}
{% if
contest
.ct_can_submit() %}
<p>
Řešení odevzdávejte ve formátu PDF jako soubor o velikosti maximálně
<p>
Řešení odevzdávejte ve formátu PDF jako soubor o velikosti maximálně
{{ max_submit_size // 1048576 }} MB.
{{ max_submit_size // 1048576 }} MB.
{% endif %}
{% endif %}
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
<p>
Soutěž se nachází v neznámém stavu. To by se nemělo stát :)
<p>
Soutěž se nachází v neznámém stavu. To by se nemělo stát :)
{% endif %}
{% endif %}
{% if
round.
task_statement_available() %}
{% if
contest.ct_
task_statement_available() %}
<p>
Můžete si stáhnout
<a
href=
'{{ url_for('
user_task_statement
',
id=
contest.contest_id)
}}'
>
zadání úloh
</a>
.
<p>
Můžete si stáhnout
<a
href=
'{{ url_for('
user_task_statement
',
id=
contest.contest_id)
}}'
>
zadání úloh
</a>
.
{% endif %}
{% endif %}
...
@@ -99,7 +99,7 @@
...
@@ -99,7 +99,7 @@
{% endif %}
{% endif %}
<td>
<td>
<a
class=
'btn btn-xs btn-primary'
href=
'{{ url_for('
user_contest_task
',
contest_id=
contest.contest_id,
task_id=
task.task_id)
}}'
>
<a
class=
'btn btn-xs btn-primary'
href=
'{{ url_for('
user_contest_task
',
contest_id=
contest.contest_id,
task_id=
task.task_id)
}}'
>
{% if
round
.ct_can_submit() %}Odevzdat{% else %}Detail úlohy{% endif %}
{% if
contest
.ct_can_submit() %}Odevzdat{% else %}Detail úlohy{% endif %}
</a>
</a>
{% endfor %}
{% endfor %}
</table>
</table>
...
...
...
...
This diff is collapsed.
Click to expand it.
mo/web/templates/user_index.html
+
1
−
1
View file @
820258de
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
<td>
{{ round.category }}
<td>
{{ round.category }}
<td>
{{ round.name }}
<td>
{{ round.name }}
<td>
{{ contest.place.name }}
<td>
{{ contest.place.name }}
<td>
{{
round.
long_state() }}
<td>
{{
contest.ct_
long_state() }}
<td><div
class=
"btn-group"
>
<td><div
class=
"btn-group"
>
<a
class=
'btn btn-xs btn-primary'
href=
'{{ url_for('
user_contest
',
id=
contest.contest_id)
}}'
>
Detail kola
</a>
<a
class=
'btn btn-xs btn-primary'
href=
'{{ url_for('
user_contest
',
id=
contest.contest_id)
}}'
>
Detail kola
</a>
</div>
</div>
...
...
...
...
This diff is collapsed.
Click to expand it.
mo/web/user.py
+
4
−
4
View file @
820258de
...
@@ -89,7 +89,7 @@ def user_contest(id: int):
...
@@ -89,7 +89,7 @@ def user_contest(id: int):
def
user_task_statement
(
id
:
int
):
def
user_task_statement
(
id
:
int
):
contest
=
get_contest
(
id
)
contest
=
get_contest
(
id
)
if
not
contest
.
round
.
task_statement_available
():
if
not
contest
.
ct_
task_statement_available
():
logger
.
warn
(
f
'
Účastník #
{
g
.
user
.
user_id
}
chce zadání, na které nemá právo
'
)
logger
.
warn
(
f
'
Účastník #
{
g
.
user
.
user_id
}
chce zadání, na které nemá právo
'
)
raise
werkzeug
.
exceptions
.
Forbidden
()
raise
werkzeug
.
exceptions
.
Forbidden
()
...
@@ -108,14 +108,14 @@ def user_contest_task(contest_id: int, task_id: int):
...
@@ -108,14 +108,14 @@ def user_contest_task(contest_id: int, task_id: int):
task
=
get_task
(
contest
,
task_id
)
task
=
get_task
(
contest
,
task_id
)
sess
=
db
.
get_session
()
sess
=
db
.
get_session
()
round
=
contest
.
round
state
=
contest
.
get_state
()
if
round
.
state
==
db
.
RoundState
.
preparing
or
(
round
.
state
==
db
.
RoundState
.
running
and
not
round
.
ct_can_submit
()):
if
state
==
db
.
RoundState
.
preparing
or
(
state
==
db
.
RoundState
.
running
and
not
contest
.
ct_can_submit
()):
# Dokud se kolo připravuje nebo čeká na zveřejnění zadání, tak ani nezobrazujeme
# Dokud se kolo připravuje nebo čeká na zveřejnění zadání, tak ani nezobrazujeme
# stránku, abychom něco neprozradili jménem úlohy
# stránku, abychom něco neprozradili jménem úlohy
raise
werkzeug
.
exceptions
.
Forbidden
()
raise
werkzeug
.
exceptions
.
Forbidden
()
form
=
SubmitForm
()
form
=
SubmitForm
()
if
round
.
ct_can_submit
()
and
form
.
validate_on_submit
():
if
contest
.
ct_can_submit
()
and
form
.
validate_on_submit
():
file
=
form
.
file
.
data
.
stream
file
=
form
.
file
.
data
.
stream
paper
=
db
.
Paper
(
task
=
task
,
for_user_obj
=
g
.
user
,
uploaded_by_obj
=
g
.
user
,
type
=
db
.
PaperType
.
solution
,
note
=
form
.
note
.
data
)
paper
=
db
.
Paper
(
task
=
task
,
for_user_obj
=
g
.
user
,
uploaded_by_obj
=
g
.
user
,
type
=
db
.
PaperType
.
solution
,
note
=
form
.
note
.
data
)
submitter
=
mo
.
submit
.
Submitter
()
submitter
=
mo
.
submit
.
Submitter
()
...
...
...
...
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