2020-10-27 23:54:35 +01:00
|
|
|
{% extends "base.html" %}
|
2021-03-30 19:23:13 +02:00
|
|
|
{% load static %}
|
2021-03-30 23:01:58 +02:00
|
|
|
{% load deadliny %}
|
2020-10-27 23:54:35 +01:00
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
|
2022-11-21 22:09:24 +01:00
|
|
|
{% if edit %}
|
|
|
|
<script src="{% static 'odevzdavatko/dynamic_formsets_for_detail.js' %}"></script>
|
|
|
|
<script src="{% static 'odevzdavatko/check_for_detail.js' %}"></script>
|
|
|
|
{% endif %}
|
2021-02-09 22:48:49 +01:00
|
|
|
|
|
|
|
|
2020-12-02 01:12:50 +01:00
|
|
|
<p>Řešené problémy: {{ object.problem.all | join:", " }}</p>
|
|
|
|
|
2022-12-20 12:29:19 +01:00
|
|
|
<p>Řešitelé: {% for r in object.resitele.all %}{{ r }}{# mailto -> #}{% if edit %} (<a href="mailto:{{ r.osoba.email }}?subject={{ "Oprava řešení M&M " | urlencode }}{{ object.problem.all.0.hlavni_problem | urlencode }}">{{ r.osoba.email }}</a>){% endif %}{# <- mailto #}{# čárky -> #}{% if forloop.revcounter0 != 0 %}, {% endif %}{# <- čárky #}{% endfor %}</p>
|
2020-12-02 01:12:50 +01:00
|
|
|
|
|
|
|
{# https://docs.djangoproject.com/en/3.1/ref/models/instances/#django.db.models.Model.get_FOO_display #}
|
2021-03-30 23:01:58 +02:00
|
|
|
<p>Forma: {{ object.get_forma_display }}</p>
|
|
|
|
|
2022-10-09 11:50:27 +02:00
|
|
|
<p>Doručeno {{ object.cas_doruceni }}, deadline: {{object.deadline_reseni | deadline_html }}</p>
|
2020-12-02 01:12:50 +01:00
|
|
|
|
|
|
|
{# Soubory: #}
|
|
|
|
<h3>Přílohy:</h3>
|
|
|
|
{% if object.prilohy.all %}
|
2021-09-20 01:28:08 +02:00
|
|
|
<table class="dosla_reseni">
|
2020-12-02 01:12:50 +01:00
|
|
|
<tr><th>Soubor</th><th>Řešitelova poznámka</th><th>Datum</th></tr>
|
|
|
|
{% for priloha in object.prilohy.all %}
|
|
|
|
<tr>
|
|
|
|
<td><a href="{{ priloha.soubor.url }}" download>{{ priloha.split | last }}</a></td>
|
|
|
|
<td>{{ priloha.res_poznamka }}</td>
|
|
|
|
<td>{{ priloha.vytvoreno }}</td></tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
{% else %}
|
|
|
|
<p>Žádné přílohy</p>
|
|
|
|
{% endif %}
|
|
|
|
|
2022-11-21 22:09:24 +01:00
|
|
|
{% if edit %}
|
2021-09-26 22:56:15 +02:00
|
|
|
<form method=post onsubmit="return zkontroluj_hodnoceni();">
|
2021-09-14 19:02:47 +02:00
|
|
|
{# Poznámka #}
|
2022-10-10 23:49:24 +02:00
|
|
|
<h3>Neveřejná poznámka:</h3>
|
2021-09-20 04:17:04 +02:00
|
|
|
<p>{{ poznamka_form.poznamka }}</p>
|
2021-09-14 19:02:47 +02:00
|
|
|
|
2020-12-02 01:12:50 +01:00
|
|
|
{# Hodnocení: #}
|
|
|
|
<h3>Hodnocení:</h3>
|
2021-09-20 04:17:04 +02:00
|
|
|
<table>
|
2021-01-19 19:25:39 +01:00
|
|
|
{% csrf_token %}
|
2021-02-09 22:48:49 +01:00
|
|
|
{{ form.management_form }}
|
2021-09-11 11:17:46 +02:00
|
|
|
</table>
|
2021-02-09 22:48:49 +01:00
|
|
|
<table id="form_set">
|
2022-10-10 23:49:24 +02:00
|
|
|
<tr><th>Problém</th><th>Body</th><th>Deadline pro body</th><th>Zpětná vazba pro řešitele</th></tr>
|
2021-02-09 22:48:49 +01:00
|
|
|
{% for subform in form %}
|
2021-09-26 22:56:15 +02:00
|
|
|
<tbody>
|
2021-02-09 22:48:49 +01:00
|
|
|
<tr class="hodnoceni">
|
|
|
|
<td>{{ subform.problem }}</td>
|
|
|
|
<td>{{ subform.body }}</td>
|
2022-10-01 14:41:47 +02:00
|
|
|
<td>{{ subform.deadline_body }}</td>
|
2022-10-10 23:49:24 +02:00
|
|
|
<td>{{ subform.feedback }}</td>
|
2022-12-04 20:14:59 +01:00
|
|
|
<td class="has_smazat_hodnoceni"><a href="#" class="smazat_hodnoceni" id="id_{{subform.prefix}}-jsremove" title="Smazat hodnocení"><img src="{% static "odevzdavatko/cross.png" %}" alt="Smazat"></a></td>
|
2021-02-09 22:48:49 +01:00
|
|
|
</tr>
|
2021-09-26 22:56:15 +02:00
|
|
|
</tbody>
|
2021-02-09 22:48:49 +01:00
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
2022-12-06 01:09:46 +01:00
|
|
|
<a href="#" title="Přidat hodnocení"> <img src="{% static "odevzdavatko/plus.png" %}" id="pridat_hodnoceni" alt="Přidat hodnocení"></a> <br/>
|
2021-03-30 19:23:13 +02:00
|
|
|
<input type=submit value="Uložit"></form>
|
2021-02-16 23:11:40 +01:00
|
|
|
|
2021-02-09 22:48:49 +01:00
|
|
|
<table id="empty_form" style="display: none;">
|
|
|
|
<tr class="hodnoceni">
|
|
|
|
<td>{{ form.empty_form.problem }}</td>
|
|
|
|
<td>{{ form.empty_form.body }}</td>
|
2022-10-01 14:41:47 +02:00
|
|
|
<td>{{ form.empty_form.deadline_body }}</td>
|
2022-10-10 23:49:24 +02:00
|
|
|
<td>{{ form.empty_form.feedback }}</td>
|
2022-12-04 20:14:59 +01:00
|
|
|
<td class="has_smazat_hodnoceni"><a href="#" class="smazat_hodnoceni" id="id_{{form.empty_form.prefix}}-jsremove" title="Smazat hodnocení"><img src="{% static "odevzdavatko/cross.png" %}" alt="Smazat"></a></td>
|
2021-02-09 22:48:49 +01:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
2022-11-21 22:09:24 +01:00
|
|
|
{% else %}
|
|
|
|
<h3>Hodnocení:</h3>
|
|
|
|
<table class="dosla_reseni">
|
|
|
|
<tr><th>Problém</th><th>Body</th><th>Zpětná vazba od opravovatele</th></tr>
|
|
|
|
{% for h in hodnoceni %}
|
|
|
|
<tr class="hodnoceni">
|
|
|
|
<td>{{ h.problem }}</td>
|
|
|
|
<td>{{ h.body }}</td>
|
|
|
|
<td>{{ h.feedback }}</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
{% endif %}
|
2021-09-26 22:56:15 +02:00
|
|
|
|
|
|
|
|
2020-10-27 23:54:35 +01:00
|
|
|
{% endblock %}
|