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.
100 lines
3.2 KiB
100 lines
3.2 KiB
{% extends "base.html" %}
|
|
{% load static %}
|
|
{% load deadliny %}
|
|
|
|
{% block content %}
|
|
|
|
{% if edit %}
|
|
<script src="{% static 'odevzdavatko/dynamic_formsets_for_detail.js' %}"></script>
|
|
<script src="{% static 'odevzdavatko/check_for_detail.js' %}"></script>
|
|
{% endif %}
|
|
|
|
|
|
<p>Řešené problémy: {{ object.problem.all | join:", " }}</p>
|
|
|
|
{% if edit %}
|
|
<p>Řešitelé:
|
|
{% for r in object.resitele.all %}{{ r }} (<a href="mailto:{{ r.osoba.email }}?subject={{ "Oprava řešení M&M " | urlencode }}{{ object.problem.all.0.hlavni_problem | urlencode }}">{{ r.osoba.email }}</a>){% if forloop.revcounter0 != 0 %}, {% endif %}{% endfor %}
|
|
</p>
|
|
{% else %}
|
|
<p>Řešitelé: {{ object.resitele.all | join:", " }}</p>
|
|
{% endif %}
|
|
|
|
{# https://docs.djangoproject.com/en/3.1/ref/models/instances/#django.db.models.Model.get_FOO_display #}
|
|
<p>Forma: {{ object.get_forma_display }}</p>
|
|
|
|
<p>Doručeno {{ object.cas_doruceni }}, deadline: {{object.deadline_reseni | deadline_html }}</p>
|
|
|
|
{# Soubory: #}
|
|
<h3>Přílohy:</h3>
|
|
{% if object.prilohy.all %}
|
|
<table class="dosla_reseni">
|
|
<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 %}
|
|
|
|
{% if edit %}
|
|
<form method=post onsubmit="return zkontroluj_hodnoceni();">
|
|
{# Poznámka #}
|
|
<h3>Neveřejná poznámka:</h3>
|
|
<p>{{ poznamka_form.poznamka }}</p>
|
|
|
|
{# Hodnocení: #}
|
|
<h3>Hodnocení:</h3>
|
|
<table>
|
|
{% csrf_token %}
|
|
{{ form.management_form }}
|
|
</table>
|
|
<table id="form_set">
|
|
<tr><th>Problém</th><th>Body</th><th>Deadline pro body</th><th>Zpětná vazba pro řešitele</th></tr>
|
|
{% for subform in form %}
|
|
<tbody>
|
|
<tr class="hodnoceni">
|
|
<td>{{ subform.problem }}</td>
|
|
<td>{{ subform.body }}</td>
|
|
<td>{{ subform.deadline_body }}</td>
|
|
<td>{{ subform.feedback }}</td>
|
|
<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>
|
|
</tr>
|
|
</tbody>
|
|
{% endfor %}
|
|
</table>
|
|
|
|
|
|
<a href="#" title="Přidat hodnocení"> <img src="{% static "odevzdavatko/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.deadline_body }}</td>
|
|
<td>{{ form.empty_form.feedback }}</td>
|
|
<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>
|
|
</tr>
|
|
</table>
|
|
|
|
{% 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 %}
|
|
|
|
|
|
{% endblock %}
|
|
|