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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
Odevzdávací Systém MO
Commits
9767d8a1
Commit
9767d8a1
authored
3 years ago
by
Martin Mareš
Browse files
Options
Downloads
Plain Diff
Merge branch 'jirka/skeny' into 'devel'
Drobnosti ve skenech See merge request
!112
parents
f4d0cbd9
269dcff7
No related branches found
No related tags found
1 merge request
!112
Drobnosti ve skenech
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
mo/jobs/protocols.py
+1
-1
1 addition, 1 deletion
mo/jobs/protocols.py
static/js/autocomplete.js
+29
-0
29 additions, 0 deletions
static/js/autocomplete.js
static/mo.css
+3
-0
3 additions, 0 deletions
static/mo.css
with
33 additions
and
1 deletion
mo/jobs/protocols.py
+
1
−
1
View file @
9767d8a1
...
...
@@ -415,6 +415,7 @@ def schedule_sort_scans(job_id: int, for_user: db.User) -> int:
scans_desc
=
"
oprav
"
if
'
type
'
in
job
.
in_json
and
job
.
in_json
[
'
type
'
]
==
"
feedback
"
else
"
odevzdaných řešení
"
job
.
type
=
db
.
JobType
.
sort_scans
job
.
created_at
=
mo
.
now
job
.
finished_at
=
None
job
.
expires_at
=
None
job
.
user
=
for_user
job
.
description
=
f
'
Rozdělení již roztříděných skenů
{
scans_desc
}
{
contest
.
round
.
round_code_short
()
}
'
...
...
@@ -554,4 +555,3 @@ def handle_sort_scans(the_job: TheJob):
job
.
result
=
'
Celkem
'
+
mo
.
util_format
.
inflect_number
(
len
(
papers
),
'
roztříděné řešení
'
,
'
roztříděná řešení
'
,
'
roztříděných řešení
'
)
else
:
job
.
result
=
'
Celkem
'
+
mo
.
util_format
.
inflect_number
(
len
(
papers
),
'
roztříděná oprava
'
,
'
roztříděné opravy
'
,
'
roztříděných oprav
'
)
the_job
.
expires_in_minutes
=
config
.
JOB_EXPIRATION_LONG
This diff is collapsed.
Click to expand it.
static/js/autocomplete.js
+
29
−
0
View file @
9767d8a1
...
...
@@ -28,6 +28,9 @@ function autocomplete(inp, arr, callback=null, max=10) {
if
(
index
!=
-
1
)
{
listCount
++
;
b
=
document
.
createElement
(
"
DIV
"
);
if
(
text
.
toUpperCase
()
==
val
.
toUpperCase
())
{
b
.
classList
.
add
(
"
exact
"
);
}
b
.
innerHTML
=
text
.
substr
(
0
,
index
)
+
"
<strong>
"
+
text
.
substr
(
index
,
val
.
length
)
+
"
</strong>
"
+
text
.
substr
(
index
+
val
.
length
)
b
.
innerHTML
+=
"
<input type='hidden' value='
"
+
key
+
"
'>
"
;
b
.
innerHTML
+=
"
<input type='hidden' value='
"
+
text
+
"
'>
"
;
...
...
@@ -75,6 +78,32 @@ function autocomplete(inp, arr, callback=null, max=10) {
e
.
stopPropagation
();
});
inp
.
addEventListener
(
"
blur
"
,
function
(
e
)
{
var
found
=
false
;
for
(
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
var
key
,
text
;
if
(
Array
.
isArray
(
arr
[
i
]))
{
key
=
arr
[
i
][
0
];
text
=
arr
[
i
][
1
];
}
else
{
key
=
arr
[
i
];
text
=
arr
[
i
];
}
if
(
inp
.
value
.
toUpperCase
()
==
text
.
toUpperCase
())
{
found
=
true
;
if
(
callback
)
{
callback
(
key
);
}
break
;
}
}
if
(
!
found
)
{
inp
.
value
=
""
;
if
(
callback
)
{
callback
(
null
);
}
}
});
function
addActive
(
x
)
{
if
(
!
x
)
return
false
;
removeActive
(
x
);
...
...
This diff is collapsed.
Click to expand it.
static/mo.css
+
3
−
0
View file @
9767d8a1
...
...
@@ -454,6 +454,9 @@ div.message .msg-date {
background-color
:
#fff
;
border-bottom
:
1px
solid
#d4d4d4
;
}
.autocomplete-items
div
.exact
{
background-color
:
rgb
(
255
,
255
,
145
);
}
.autocomplete-items
div
:hover
{
background-color
:
#e9e9e9
;
}
...
...
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