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
d2da6a71
Commit
d2da6a71
authored
1 year ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
JavaScript k tabulce řešení osamostatněn
parent
6f047a54
No related branches found
No related tags found
1 merge request
!134
Prázdné protokoly
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mo/web/templates/parts/org_solution_js.html
+41
-0
41 additions, 0 deletions
mo/web/templates/parts/org_solution_js.html
mo/web/templates/parts/org_solution_table.html
+1
-40
1 addition, 40 deletions
mo/web/templates/parts/org_solution_table.html
with
42 additions
and
40 deletions
mo/web/templates/parts/org_solution_js.html
0 → 100644
+
41
−
0
View file @
d2da6a71
{# Společný JavaScript a checkbox povolující zakládání pro tabulky řešení #}
{% if edit %}
<script
type=
"text/javascript"
>
window
.
addEventListener
(
"
load
"
,
function
()
{
for
(
const
ch
of
document
.
querySelectorAll
(
"
input[type=checkbox]
"
))
{
ch
.
onchange
();
}
for
(
const
i
of
document
.
querySelectorAll
(
"
input[type=text]
"
))
{
i
.
oninput
();
}
});
function
update_disabled_fields
(
allow_create
)
{
for
(
const
i
of
document
.
querySelectorAll
(
"
input[type=text]
"
))
{
if
(
i
.
dataset
.
sol
==
"
0
"
)
{
i
.
disabled
=
!
allow_create
;
}
}
}
</script>
{% endif %}
{% if edit_create %}
<div
class=
"form-group"
><div
class=
"checkbox"
>
<label>
<input
type=
"checkbox"
name=
"create_sols"
onchange=
"update_disabled_fields(this.checked)"
value=
"y"
{%
if
not
edit_create
%}
disabled
{%
elif
not
ctx.contest.online_submit
%}
checked
{%
endif
%}
>
Zakládat nová řešení
</label>
</div></div>
{% endif %}
This diff is collapsed.
Click to expand it.
mo/web/templates/parts/org_solution_table.html
+
1
−
40
View file @
d2da6a71
...
...
@@ -148,43 +148,4 @@ finální (ve výchozím stavu poslední nahrané).{% elif rights.can_upload_sol
{% endfor %}
</table>
{% if edit %}
<script
type=
"text/javascript"
>
window
.
addEventListener
(
"
load
"
,
function
()
{
for
(
const
ch
of
document
.
querySelectorAll
(
"
input[type=checkbox]
"
))
{
ch
.
onchange
();
}
for
(
const
i
of
document
.
querySelectorAll
(
"
input[type=text]
"
))
{
i
.
oninput
();
}
});
function
update_disabled_fields
(
allow_create
)
{
for
(
const
i
of
document
.
querySelectorAll
(
"
input[type=text]
"
))
{
if
(
i
.
dataset
.
sol
==
"
0
"
)
{
i
.
disabled
=
!
allow_create
;
}
}
}
</script>
{% endif %}
{% if edit_create %}
<div
class=
"form-group"
><div
class=
"checkbox"
>
<label>
<input
type=
"checkbox"
name=
"create_sols"
onchange=
"update_disabled_fields(this.checked)"
tabindex=
{{
tabindex.value
}}
autofocus
value=
"y"
{%
if
not
edit_create
%}
disabled
{%
elif
not
contest_online_submit
%}
checked
{%
endif
%}
>
Zakládat nová řešení
</label>
</div></div>
{% endif %}
{% include "parts/org_solution_js.html" %}
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