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
1b68d732
Project 'mj/mo-submit' was moved to 'mo-p/osmo'. Please update any links and bookmarks that may still have the old path.
Commit
1b68d732
authored
8 months ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
User: Odkazy na diplomy z účastnické hlavní stránky
parent
c186eb79
Branches
Branches containing commit
No related tags found
1 merge request
!137
Sazba diplomů
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mo/web/templates/user_index.html
+4
-1
4 additions, 1 deletion
mo/web/templates/user_index.html
mo/web/user.py
+9
-3
9 additions, 3 deletions
mo/web/user.py
with
13 additions
and
4 deletions
mo/web/templates/user_index.html
+
4
−
1
View file @
1b68d732
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
<th>
Stav soutěže
<th>
Stav soutěže
<th>
Odkazy
<th>
Odkazy
<tbody>
<tbody>
{% for pion, contest, round in pions %}
{% for pion, contest, round
, certs
in pions %}
{% set state = contest.ct_state() %}
{% set state = contest.ct_state() %}
<tr>
<tr>
<td
class=
"text-center"
><b>
{{ round.category }}
</b>
<td
class=
"text-center"
><b>
{{ round.category }}
</b>
...
@@ -41,6 +41,9 @@
...
@@ -41,6 +41,9 @@
{% if contest.ct_state() in [RoundState.graded, RoundState.closed] and contest.scoretable_id %}
{% if contest.ct_state() in [RoundState.graded, RoundState.closed] and contest.scoretable_id %}
<a
class=
'btn btn-xs btn-success'
href=
"{{ url_for('user_contest_score', id=contest.contest_id) }}"
>
Výsledková listina
</a>
<a
class=
'btn btn-xs btn-success'
href=
"{{ url_for('user_contest_score', id=contest.contest_id) }}"
>
Výsledková listina
</a>
{% endif %}
{% endif %}
{% if certs %}
<a
class=
'btn btn-xs btn-success'
href=
"{{ url_for('user_contest_certificates', id=contest.contest_id) }}"
>
Diplomy
</a>
{% endif %}
{% endfor %}
{% endfor %}
</table>
</table>
{% else %}
{% else %}
...
...
This diff is collapsed.
Click to expand it.
mo/web/user.py
+
9
−
3
View file @
1b68d732
...
@@ -12,7 +12,7 @@ import hmac
...
@@ -12,7 +12,7 @@ import hmac
import
os
import
os
import
pikepdf
import
pikepdf
from
pikepdf.models.metadata
import
encode_pdf_date
from
pikepdf.models.metadata
import
encode_pdf_date
from
sqlalchemy
import
and_
from
sqlalchemy
import
and_
,
func
from
sqlalchemy.dialects.postgresql
import
insert
as
pgsql_insert
from
sqlalchemy.dialects.postgresql
import
insert
as
pgsql_insert
from
sqlalchemy.orm
import
joinedload
from
sqlalchemy.orm
import
joinedload
from
tempfile
import
NamedTemporaryFile
from
tempfile
import
NamedTemporaryFile
...
@@ -50,11 +50,17 @@ def user_index():
...
@@ -50,11 +50,17 @@ def user_index():
)
)
def
load_pcrs
()
->
List
[
Tuple
[
db
.
Participation
,
db
.
Contest
,
db
.
Round
]]:
def
load_pcrs
()
->
List
[
Tuple
[
db
.
Participation
,
db
.
Contest
,
db
.
Round
,
int
]]:
return
(
db
.
get_session
().
query
(
db
.
Participation
,
db
.
Contest
,
db
.
Round
)
cert_subq
=
(
db
.
get_session
()
.
query
(
db
.
Certificate
.
user_id
,
db
.
Certificate
.
cert_set_id
,
func
.
count
(
db
.
Certificate
.
type
).
label
(
'
count
'
))
.
group_by
(
db
.
Certificate
.
user_id
,
db
.
Certificate
.
cert_set_id
)
.
subquery
())
return
(
db
.
get_session
().
query
(
db
.
Participation
,
db
.
Contest
,
db
.
Round
,
cert_subq
.
c
.
count
)
.
select_from
(
db
.
Participation
)
.
select_from
(
db
.
Participation
)
.
join
(
db
.
Contest
,
db
.
Contest
.
master_contest_id
==
db
.
Participation
.
contest_id
)
.
join
(
db
.
Contest
,
db
.
Contest
.
master_contest_id
==
db
.
Participation
.
contest_id
)
.
join
(
db
.
Round
)
.
join
(
db
.
Round
)
.
outerjoin
(
cert_subq
,
and_
(
cert_subq
.
c
.
user_id
==
db
.
Participation
.
user_id
,
cert_subq
.
c
.
cert_set_id
==
db
.
Participation
.
contest_id
))
.
filter
(
db
.
Participation
.
user
==
g
.
user
)
.
filter
(
db
.
Participation
.
user
==
g
.
user
)
.
filter
(
db
.
Round
.
year
==
config
.
CURRENT_YEAR
)
.
filter
(
db
.
Round
.
year
==
config
.
CURRENT_YEAR
)
.
options
(
joinedload
(
db
.
Contest
.
place
))
.
options
(
joinedload
(
db
.
Contest
.
place
))
...
...
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