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
8d6c3b05
Commit
8d6c3b05
authored
4 years ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
Nastavování stavu kola počítá s delegací a propaguje změny
parent
64acbb53
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/org_round.py
+14
-1
14 additions, 1 deletion
mo/web/org_round.py
mo/web/templates/org_round.html
+6
-1
6 additions, 1 deletion
mo/web/templates/org_round.html
static/mo.css
+4
-0
4 additions, 0 deletions
static/mo.css
with
24 additions
and
2 deletions
mo/web/org_round.py
+
14
−
1
View file @
8d6c3b05
...
@@ -422,12 +422,25 @@ def org_round_edit(id: int):
...
@@ -422,12 +422,25 @@ def org_round_edit(id: int):
if
sess
.
is_modified
(
round
):
if
sess
.
is_modified
(
round
):
changes
=
db
.
get_object_changes
(
round
)
changes
=
db
.
get_object_changes
(
round
)
app
.
logger
.
info
(
f
"
Round
{
id
}
modified, changes:
{
changes
}
"
)
app
.
logger
.
info
(
f
"
Round
#
{
id
}
modified, changes:
{
changes
}
"
)
mo
.
util
.
log
(
mo
.
util
.
log
(
type
=
db
.
LogType
.
round
,
type
=
db
.
LogType
.
round
,
what
=
id
,
what
=
id
,
details
=
{
'
action
'
:
'
edit
'
,
'
changes
'
:
changes
},
details
=
{
'
action
'
:
'
edit
'
,
'
changes
'
:
changes
},
)
)
if
'
state
'
in
changes
and
round
.
state
!=
db
.
RoundState
.
delegate
:
# Propagujeme změny stavu do všech soutěží
for
contest
in
sess
.
query
(
db
.
Contest
).
filter_by
(
round
=
round
).
filter
(
db
.
Contest
.
state
!=
round
.
state
):
contest
.
state
=
round
.
state
ct_changes
=
db
.
get_object_changes
(
contest
)
app
.
logger
.
info
(
f
"
Change propagated to contest #
{
contest
.
contest_id
}
:
{
ct_changes
}
"
)
mo
.
util
.
log
(
type
=
db
.
LogType
.
contest
,
what
=
contest
.
contest_id
,
details
=
{
'
action
'
:
'
propagate
'
,
'
changes
'
:
ct_changes
},
)
sess
.
commit
()
sess
.
commit
()
flash
(
'
Změny kola uloženy
'
,
'
success
'
)
flash
(
'
Změny kola uloženy
'
,
'
success
'
)
else
:
else
:
...
...
This diff is collapsed.
Click to expand it.
mo/web/templates/org_round.html
+
6
−
1
View file @
8d6c3b05
...
@@ -65,18 +65,23 @@
...
@@ -65,18 +65,23 @@
<table
class=
data
>
<table
class=
data
>
<thead>
<thead>
<tr>
<tr>
<th>
Soutěžní oblasti
<th>
Soutěžní oblast
<th>
Stav
<th>
Počet účastníků
<th>
Počet účastníků
</tr>
</tr>
</thead>
</thead>
{% for (c, count) in contests_counts %}
{% for (c, count) in contests_counts %}
<tr>
<tr>
<td><a
href=
'{{ url_for('
org_contest
',
id=
c.contest_id)
}}'
>
{{ c.place.name }}
</a>
<td><a
href=
'{{ url_for('
org_contest
',
id=
c.contest_id)
}}'
>
{{ c.place.name }}
</a>
{% with state=c.get_state() %}
<td
class=
'rstate-{{state.name}}'
>
{{ state.friendly_name() }}
{% endwith %}
<td>
{{ count }}
<td>
{{ count }}
{% endfor %}
{% endfor %}
<tfoot>
<tfoot>
<tr>
<tr>
<th>
Celkem
<th>
Celkem
<th>
<th>
{{ contests_counts|sum(attribute=1) }}
<th>
{{ contests_counts|sum(attribute=1) }}
</tr>
</tr>
</tfoot>
</tfoot>
...
...
This diff is collapsed.
Click to expand it.
static/mo.css
+
4
−
0
View file @
8d6c3b05
...
@@ -206,6 +206,10 @@ nav#main-menu a.active {
...
@@ -206,6 +206,10 @@ nav#main-menu a.active {
color
:
black
;
color
:
black
;
}
}
.rstate-delegate
{
color
:
#888
;
}
/* Solutions */
/* Solutions */
.sol-active
{
.sol-active
{
...
...
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