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
28cf7278
Commit
28cf7278
authored
4 years ago
by
Jiří Setnička
Browse files
Options
Downloads
Patches
Plain Diff
Dělená kola v účastnické části webu
Issue
#178
parent
c2d250fa
No related branches found
No related tags found
1 merge request
!48
Dělená kola napotřetí
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mo/web/templates/org_user.html
+11
-11
11 additions, 11 deletions
mo/web/templates/org_user.html
mo/web/user.py
+3
-3
3 additions, 3 deletions
mo/web/user.py
with
14 additions
and
14 deletions
mo/web/templates/org_user.html
+
11
−
11
View file @
28cf7278
...
...
@@ -52,27 +52,27 @@
{% endif %}
<h3>
Účast v kolech
</h3>
{% if
rounds.count()
%}
{% if
participations
%}
<table
class=
"data full"
>
<thead>
<tr>
<th>
Ročník
<th>
Kategorie
<th>
Kolo
<th>
Místo
<th>
Stav účasti
<th>
Odkazy
</tr>
</thead>
{% for round in
round
s %}
{% for
(pion, contest,
round
)
in
participation
s %}
<tr>
<td>
{{
round.contest.
round.year }}
<td>
{{
round.contest.
round.category }}
<td>
{{ round.
contest.round.seq
}}
<td><a
href=
"{{ url_for('org_place', id=
round.
contest.place_id) }}"
>
{{
round.
contest.place.name }}
</a>
{% if
round
.place_id !=
round.
contest.place_id %}
<br>
(ale soutěží v
<a
href=
"{{ url_for('org_place', id=
round
.place_id) }}"
>
{{
round
.place.name }}
</a>
)
<td>
{{ round.year }}
<td>
{{ round.category }}
<td>
{{ round.
seq }}{{ round.part_code()
}}
<td><a
href=
"{{ url_for('org_place', id=contest.place_id) }}"
>
{{ contest.place.name }}
</a>
{% if
pion
.place_id != contest.place_id %}
<br>
(ale soutěží v
<a
href=
"{{ url_for('org_place', id=
pion
.place_id) }}"
>
{{
pion
.place.name }}
</a>
)
{% endif %}
<td>
{{ round.state.friendly_name() }}
<td><div
class=
"btn-group"
>
<a
class=
"btn btn-xs btn-primary"
href=
"{{ url_for('org_contest_user', contest_id=
round.
contest.contest_id, user_id=user.user_id) }}"
>
Odevzdané úlohy
</a>
<a
class=
"btn btn-xs btn-default"
href=
"{{ url_for('org_contest', id=
round.
contest.contest_id) }}"
>
Stránka soutěže
</a>
<a
class=
"btn btn-xs btn-default"
href=
"{{ url_for('org_round', id=round.
contest.round.
round_id) }}"
>
Stránka kola
</a>
<a
class=
"btn btn-xs btn-primary"
href=
"{{ url_for('org_contest_user', contest_id=contest.contest_id, user_id=user.user_id) }}"
>
Odevzdané úlohy
</a>
<a
class=
"btn btn-xs btn-default"
href=
"{{ url_for('org_contest', id=contest.contest_id) }}"
>
Stránka soutěže
</a>
<a
class=
"btn btn-xs btn-default"
href=
"{{ url_for('org_round', id=round.round_id) }}"
>
Stránka kola
</a>
{% if g.user.is_admin %}
<a
class=
"btn btn-xs btn-default"
href=
"{{ log_url('participant', user.user_id) }}"
>
Historie
</a>
{% endif %}
...
...
This diff is collapsed.
Click to expand it.
mo/web/user.py
+
3
−
3
View file @
28cf7278
...
...
@@ -22,11 +22,11 @@ def user_index():
pions
=
(
sess
.
query
(
db
.
Participation
,
db
.
Contest
,
db
.
Round
)
.
select_from
(
db
.
Participation
)
.
join
(
db
.
Contest
)
.
join
(
db
.
Contest
,
db
.
Contest
.
master_contest_id
==
db
.
Participation
.
contest_id
)
.
join
(
db
.
Round
)
.
filter
(
db
.
Participation
.
user
==
g
.
user
)
.
options
(
joinedload
(
db
.
Contest
.
place
))
.
order_by
(
db
.
Round
.
year
.
desc
(),
db
.
Round
.
category
,
db
.
Round
.
seq
)
.
order_by
(
db
.
Round
.
year
.
desc
(),
db
.
Round
.
category
,
db
.
Round
.
seq
,
db
.
Round
.
part
)
.
all
())
return
render_template
(
...
...
@@ -46,7 +46,7 @@ def get_contest(id: int) -> db.Contest:
# FIXME: Kontrolovat nějak pion.state?
pion
=
(
db
.
get_session
().
query
(
db
.
Participation
)
.
filter_by
(
user
=
g
.
user
,
contest
=
contest
)
.
filter_by
(
user
=
g
.
user
,
contest
_id
=
contest
.
master_contest_id
)
.
one_or_none
())
if
not
pion
:
raise
werkzeug
.
exceptions
.
Forbidden
()
...
...
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