Web M&M
https://mam.matfyz.cz
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
105 lines
2.7 KiB
105 lines
2.7 KiB
{% extends "base.html" %}
|
|
{% load static %}
|
|
{% block script %}
|
|
<script src="{% static 'odevzdavatko/dynamic_formsets.js' %}"></script>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<h1>
|
|
{% block nadpis1a %}
|
|
Nahrát řešení
|
|
{% endblock %}
|
|
</h1>
|
|
|
|
<form enctype="multipart/form-data" action="{% url 'seminar_nahraj_reseni' nadproblem_id %}" method="post" onsubmit="return zkontroluj_prilohy();">
|
|
{% csrf_token %}
|
|
<table class='form'>
|
|
<tr>
|
|
<td><label class="field-label field-required" for="tema">Téma:</label></td>
|
|
<td><input id="tema" disabled="" type="text" value="{{ nadproblem }}"></td>
|
|
</tr>
|
|
|
|
{% with field=form.problem %}
|
|
<tr>
|
|
<td>
|
|
<label class="field-label{% if field.field.required %} field-required{% endif %}" for="{{ field.id_for_label }}">
|
|
{{ field.label }}:
|
|
</label>
|
|
</td>
|
|
<td>
|
|
{{ field }}
|
|
</td>
|
|
</tr>
|
|
|
|
{% if field.errors %}
|
|
<tr>
|
|
<td colspan="2"><span class="field-error">{{ field.errors }}</span></td>
|
|
</tr>
|
|
{% endif %}
|
|
|
|
{% endwith %}
|
|
</table>
|
|
|
|
{% for field in form.hidden_fields %}
|
|
{{ field }}
|
|
{% endfor %}
|
|
|
|
<hr>
|
|
<h4>Spolupráce s dalšími řešiteli</h4>
|
|
|
|
<p>Pokud řešíte ve více lidech, je <strong>potřeba</strong> přidat tyto lidi jako „Další autory“. V tomto poli se vyhledává podle přezdívek, které si lze nastavit v „Osobních údajích“. Sebe vyplňovat nemusíte a za skupinu odevzdávejte pouze <strong>jednou</strong> (ne každý sám).</p>
|
|
|
|
<table class='form'>
|
|
{% with field=form.resitele %}
|
|
<tr>
|
|
<td>
|
|
<label class="field-label{% if field.field.required %} field-required{% endif %}" for="{{ field.id_for_label }}">
|
|
{{ field.label }}:
|
|
</label>
|
|
</td>
|
|
<td>
|
|
{{ field }}
|
|
</td>
|
|
</tr>
|
|
|
|
{% if field.errors %}
|
|
<tr>
|
|
<td colspan="2"><span class="field-error">{{ field.errors }}</span></td>
|
|
</tr>
|
|
{% endif %}
|
|
|
|
{% endwith %}
|
|
</table>
|
|
|
|
<hr>
|
|
|
|
{% include "odevzdavatko/prilohy.html" %}
|
|
|
|
{{form.non_field_errors}}
|
|
|
|
<hr>
|
|
<h4>Odevzdat řešení</h4>
|
|
<input type="submit" value="Odevzdat">
|
|
</form>
|
|
|
|
<script type="text/javascript">
|
|
function zkontroluj_prilohy() {
|
|
var soucet = 0;
|
|
var formulare = document.getElementById("form_set").children;
|
|
for (var formular of formulare) {
|
|
var upload = formular.getElementsByTagName("input")[0];
|
|
soucet += upload.files.length;
|
|
}
|
|
if (soucet == 0) {
|
|
var vysledek = confirm("Nepřiložil jsi žádný soubor. Přesto odeslat?");
|
|
if (!vysledek) {
|
|
event.preventDefault();
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
</script>
|
|
|
|
|
|
{% endblock %}
|
|
|