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
a8b775d6
Commit
a8b775d6
authored
4 years ago
by
Martin Mareš
Browse files
Options
Downloads
Plain Diff
Merge branch 'jk/issue-213' into 'devel'
Odkazy na soutěže z míst See merge request
!79
parents
ad1e354c
658a072c
No related branches found
No related tags found
1 merge request
!79
Odkazy na soutěže z míst
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mo/web/org_place.py
+9
-1
9 additions, 1 deletion
mo/web/org_place.py
mo/web/templates/org_place.html
+25
-0
25 additions, 0 deletions
mo/web/templates/org_place.html
with
34 additions
and
1 deletion
mo/web/org_place.py
+
9
−
1
View file @
a8b775d6
...
...
@@ -32,11 +32,19 @@ def org_place(id: int):
children
=
sorted
(
place
.
children
,
key
=
lambda
p
:
locale
.
strxfrm
(
p
.
name
))
rr
=
g
.
gatekeeper
.
rights_for
(
place
)
contests
=
(
sess
.
query
(
db
.
Contest
)
.
options
(
joinedload
(
db
.
Contest
.
round
))
.
filter_by
(
place
=
place
)
.
all
())
contests
.
sort
(
key
=
lambda
c
:
(
-
c
.
round
.
year
,
c
.
round
.
category
,
c
.
round
.
seq
,
c
.
round
.
part
))
return
render_template
(
'
org_place.html
'
,
place
=
place
,
school
=
school
,
can_edit
=
rr
.
can_edit_place
(
place
),
can_add_child
=
rr
.
can_add_place_child
(
place
),
children
=
children
children
=
children
,
contests
=
contests
)
...
...
This diff is collapsed.
Click to expand it.
mo/web/templates/org_place.html
+
25
−
0
View file @
a8b775d6
...
...
@@ -55,4 +55,29 @@
<a
class=
"btn btn-primary"
href=
"{{ url_for('org_place_new_child', id=place.place_id) }}"
>
Přidat nové podřízené místo
</a>
{% endif %}
{% endif %}
<h3>
Soutěže
</h3>
{% if not contests %}
<p>
K tomuto místu nejsou přidružené žádné soutěže.
{% else %}
<table
class=
data
>
<thead><tr>
<th>
ID
<th>
Ročník
<th>
Kat.
<th>
Název
<th>
Stav
</thead>
{% for c in contests %}
<tr>
{% set r = c.round %}
<td><a
href=
'{{ url_for('
org_contest
',
id=
c.contest_id)
}}'
>
{{ r.round_code() }}
</a>
<td>
{{ r.year }}
<td>
{{ r.category }}
<td>
{{ r.name }}
<td
class=
'rstate-{{c.state.name}}'
>
{{ c.state.friendly_name() }}
{% endfor %}
</table>
{% endif %}
{% endblock %}
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