Select Git revision
org_solution_js.html
org_solution_js.html 991 B
{# 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]")) {
if (ch.onchange)
ch.onchange();
}
for (const i of document.querySelectorAll("input[type=text]")) {
if (i.oninput)
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 %}