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
2a417179
Commit
2a417179
authored
Dec 4, 2021
by
Jiří Setnička
Browse files
Options
Downloads
Patches
Plain Diff
Score: Přesun OrderCell do mo.web.table
Bude použita i z účastnické části webu.
parent
daf7ab1f
Branches
Branches containing commit
No related tags found
1 merge request
!110
Zveřejňování výsledkovky účastníkům
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mo/web/org_score.py
+1
-26
1 addition, 26 deletions
mo/web/org_score.py
mo/web/table.py
+25
-0
25 additions, 0 deletions
mo/web/table.py
with
26 additions
and
26 deletions
mo/web/org_score.py
+
1
−
26
View file @
2a417179
...
@@ -12,35 +12,10 @@ from mo.rights import Right
...
@@ -12,35 +12,10 @@ from mo.rights import Right
from
mo.score
import
Score
from
mo.score
import
Score
from
mo.web
import
app
from
mo.web
import
app
from
mo.web.org_contest
import
get_context
from
mo.web.org_contest
import
get_context
from
mo.web.table
import
Cell
,
CellInput
,
CellLink
,
Column
,
Row
,
Table
,
cell_pion_link
from
mo.web.table
import
Cell
,
CellInput
,
CellLink
,
Column
,
Row
,
Table
,
OrderCell
,
cell_pion_link
from
mo.util_format
import
format_decimal
,
inflect_number
from
mo.util_format
import
format_decimal
,
inflect_number
class
OrderCell
(
Cell
):
place
:
int
span
:
int
continuation
:
bool
def
__init__
(
self
,
place
:
int
,
span
:
int
=
1
,
continuation
:
bool
=
False
):
self
.
place
=
place
self
.
span
=
span
self
.
continuation
=
continuation
def
__str__
(
self
)
->
str
:
if
self
.
span
==
1
:
return
f
"
{
self
.
place
}
.
"
else
:
return
f
"
{
self
.
place
}
.–
{
self
.
place
+
self
.
span
-
1
}
.
"
def
to_html
(
self
)
->
str
:
if
self
.
continuation
:
return
""
# covered by rowspan cell above this one
elif
self
.
span
==
1
:
return
f
"
<td>
{
self
.
__str__
()
}
"
else
:
return
f
"
<td rowspan=
'
{
self
.
span
}
'
>
{
self
.
__str__
()
}
"
class
SolPointsCell
(
Cell
):
class
SolPointsCell
(
Cell
):
contest_id
:
int
contest_id
:
int
user
:
db
.
User
user
:
db
.
User
...
...
This diff is collapsed.
Click to expand it.
mo/web/table.py
+
25
−
0
View file @
2a417179
...
@@ -116,6 +116,31 @@ class CellMarkup(Cell):
...
@@ -116,6 +116,31 @@ class CellMarkup(Cell):
return
self
.
html
return
self
.
html
class
OrderCell
(
Cell
):
place
:
int
span
:
int
continuation
:
bool
def
__init__
(
self
,
place
:
int
,
span
:
int
=
1
,
continuation
:
bool
=
False
):
self
.
place
=
place
self
.
span
=
span
self
.
continuation
=
continuation
def
__str__
(
self
)
->
str
:
if
self
.
span
==
1
:
return
f
"
{
self
.
place
}
.
"
else
:
return
f
"
{
self
.
place
}
.–
{
self
.
place
+
self
.
span
-
1
}
.
"
def
to_html
(
self
)
->
str
:
if
self
.
continuation
:
return
""
# covered by rowspan cell above this one
elif
self
.
span
==
1
:
return
f
"
<td>
{
self
.
__str__
()
}
"
else
:
return
f
"
<td rowspan=
'
{
self
.
span
}
'
>
{
self
.
__str__
()
}
"
class
Table
:
class
Table
:
columns
:
Sequence
[
Column
]
columns
:
Sequence
[
Column
]
rows
:
Iterable
[
Row
]
rows
:
Iterable
[
Row
]
...
...
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