Skip to content
Snippets Groups Projects
Select Git revision
  • d2da6a712ef79686bb89e30f6053f4fe3c95d469
  • devel default
  • master
  • fo
  • jirka/typing
  • fo-base
  • mj/submit-images
  • jk/issue-96
  • jk/issue-196
  • honza/add-contestant
  • honza/mr7
  • honza/mrf
  • honza/mrd
  • honza/mra
  • honza/mr6
  • honza/submit-images
  • honza/kolo-vs-soutez
  • jh-stress-test-wip
  • shorten-schools
19 results

org_solution_js.html

Blame
  • 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 %}