Browse Source

FIX: Výsledkovka

okenkove_obalky
Jonas Havelka 2 years ago
parent
commit
75f7d17f95
  1. 37
      vysledkovky/templates/vysledkovky/vysledkovka_cisla.html

37
vysledkovky/templates/vysledkovky/vysledkovka_cisla.html

@ -4,16 +4,16 @@
<th class='border-r'># <th class='border-r'>#
<th class='border-r'>Jméno <th class='border-r'>Jméno
{% for p in problemy %} {% for p in problemy %}
<th class='border-r' id="problem{{ forloop.counter }}">{# <a href="{{ p.verejne_url }}"> #}{{ p.kod_v_rocniku }}{# </a> #} <th class='border-r' id="problem{{ forloop.counter0 }}">{# <a href="{{ p.verejne_url }}"> #}{{ p.kod_v_rocniku }}{# </a> #}
{# TODELETE #} {# TODELETE #}
{% for podproblemy in podproblemy_iter.next %} {% for podproblemy in podproblemy_iter.next %}
<th class='border-r podproblem{{ forloop.parentloop.counter }} podproblem'>{# <a href="{{ podproblemy.verejne_url }}"> #}{{ podproblemy.kod_v_rocniku }}{# </a> #} <th class='border-r podproblem{{ forloop.parentloop.counter0 }} podproblem'>{# <a href="{{ podproblemy.verejne_url }}"> #}{{ podproblemy.kod_v_rocniku }}{# </a> #}
{% endfor %} {% endfor %}
{# TODELETE #} {# TODELETE #}
{% endfor %} {% endfor %}
{% if ostatni %}<th class='border-r'>Ostatní {% endif %} {% if ostatni %}<th class='border-r' id='problem{{ problemy | length }}'>Ostatní {% endif %}
{# TODELETE #} {# TODELETE #}
{% for podproblemy in podproblemy_iter.next %} {% for podproblemy in podproblemy_iter.next %}
@ -38,7 +38,7 @@
{# TODELETE #} {# TODELETE #}
{% for body_podproblemu in rv.body_podproblemy_iter.next %} {% for body_podproblemu in rv.body_podproblemy_iter.next %}
<td class='border-r podproblem{{ forloop.parentloop.counter }} podproblem'>{{ body_podproblemu }} <td class='border-r podproblem{{ forloop.parentloop.counter0 }} podproblem'>{{ body_podproblemu }}
{% endfor %} {% endfor %}
{# TODELETE #} {# TODELETE #}
@ -56,17 +56,30 @@
{# TODELETE #} {# TODELETE #}
<script> <script>
{% for p in problemy %} {% for p in problemy %}
diplayed{{ forloop.counter }} = false; diplayed{{ forloop.counter0 }} = false;
$(".podproblem{{ forloop.counter }}").css("display", "none") $(".podproblem{{ forloop.counter0 }}").css("display", "none")
$("#problem{{ forloop.counter }}")[0].addEventListener('click', podproblem{{ forloop.counter }}); $("#problem{{ forloop.counter0 }}")[0].addEventListener('click', podproblem{{ forloop.counter0 }});
function podproblem{{ forloop.counter }}(event) { function podproblem{{ forloop.counter0 }}(event) {
diplayed{{ forloop.counter }} = !diplayed{{ forloop.counter }}; diplayed{{ forloop.counter0 }} = !diplayed{{ forloop.counter0 }};
if (diplayed{{ forloop.counter }}) { if (diplayed{{ forloop.counter0 }}) {
$(".podproblem{{ forloop.counter }}").css("display", ""); $(".podproblem{{ forloop.counter0 }}").css("display", "");
} else { } else {
$(".podproblem{{ forloop.counter }}").css("display", "none"); $(".podproblem{{ forloop.counter0 }}").css("display", "none");
} }
} }
{% endfor %} {% endfor %}
{% if ostatni %}
diplayed{{ problemy | length }} = false;
$(".podproblem{{ problemy | length }}").css("display", "none")
$("#problem{{ problemy | length }}")[0].addEventListener('click', podproblem{{ problemy | length }});
function podproblem{{ problemy | length }}(event) {
diplayed{{ problemy | length }} = !diplayed{{ problemy | length }};
if (diplayed{{ problemy | length }}) {
$(".podproblem{{ problemy | length }}").css("display", "");
} else {
$(".podproblem{{ problemy | length }}").css("display", "none");
}
}
{% endif %}
</script> </script>
{# TODELETE #} {# TODELETE #}

Loading…
Cancel
Save