|
|
@ -1,4 +1,5 @@ |
|
|
|
{% extends "base.html" %} |
|
|
|
{% load static %} |
|
|
|
|
|
|
|
{% block content %} |
|
|
|
|
|
|
@ -25,8 +26,9 @@ function deleteForm(prefix, btn) { |
|
|
|
if (total >= 1){ |
|
|
|
btn.closest('tr').remove(); |
|
|
|
var forms = $('.hodnoceni'); |
|
|
|
$('#id_' + prefix + '-TOTAL_FORMS').val(forms.length); |
|
|
|
for (var i=0, formCount=forms.length; i<formCount; i++) { |
|
|
|
var formCount = forms.length - 1; // There is one extra such form hidden as template! |
|
|
|
$('#id_' + prefix + '-TOTAL_FORMS').val(formCount); |
|
|
|
for (var i=0; i<formCount; i++) { |
|
|
|
$(forms.get(i)).find(':input').each(function() { |
|
|
|
updateElementIndex(this, prefix, i); |
|
|
|
}); |
|
|
@ -91,21 +93,21 @@ $(document).ready(function(){ |
|
|
|
<td>{{ subform.problem }}</td> |
|
|
|
<td>{{ subform.body }}</td> |
|
|
|
<td>{{ subform.cislo_body }}</td> |
|
|
|
<td><input type=button class="smazat_hodnoceni" value="Smazat" id="id_{{subform.prefix}}-jsremove"></td> |
|
|
|
<td><a href="#" class="smazat_hodnoceni" id="id_{{subform.prefix}}-jsremove"><img src="{% static "seminar/cross.png" %}" alt="Smazat"></a></td> |
|
|
|
</tr> |
|
|
|
{% endfor %} |
|
|
|
</table> |
|
|
|
|
|
|
|
|
|
|
|
<input type=button id="pridat_hodnoceni" value="Přidat hodnocení"> |
|
|
|
<input type=submit></form> |
|
|
|
<a href="#"> <img src="{% static "seminar/plus.png" %}" id="pridat_hodnoceni" alt="Přidat hodnocení"></a> </br> |
|
|
|
<input type=submit value="Uložit"></form> |
|
|
|
|
|
|
|
<table id="empty_form" style="display: none;"> |
|
|
|
<tr class="hodnoceni"> |
|
|
|
<td>{{ form.empty_form.problem }}</td> |
|
|
|
<td>{{ form.empty_form.body }}</td> |
|
|
|
<td>{{ form.empty_form.cislo_body }}</td> |
|
|
|
<td><input type=button class="smazat_hodnoceni" value="Smazat" id="id_{{form.empty_form.prefix}}-jsremove"></td> |
|
|
|
<td><a href="#" class="smazat_hodnoceni" id="id_{{subform.prefix}}-jsremove"><img src="{% static "seminar/cross.png" %}" alt="Smazat"></a></td> |
|
|
|
</tr> |
|
|
|
</table> |
|
|
|
|
|
|
|