From ec8aa75e17bc96735782b6d481fb8805f9c5ff24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kate=C5=99ina=20=C4=8C?= Date: Wed, 19 May 2021 13:19:06 +0200 Subject: [PATCH] =?UTF-8?q?zkr=C3=A1cen=C3=AD=20n=C3=A1zv=C5=AF=20probl?= =?UTF-8?q?=C3=A9m=C5=AF=20v=20tabulce=20odevzdan=C3=BDch=20=C5=99e=C5=A1e?= =?UTF-8?q?n=C3=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/seminar/odevzdavatko/resitel_prehled.html | 7 ++++++- seminar/templatetags/deadliny.py | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/seminar/templates/seminar/odevzdavatko/resitel_prehled.html b/seminar/templates/seminar/odevzdavatko/resitel_prehled.html index 6a24123f..4f23a0a2 100644 --- a/seminar/templates/seminar/odevzdavatko/resitel_prehled.html +++ b/seminar/templates/seminar/odevzdavatko/resitel_prehled.html @@ -10,6 +10,8 @@
  • ✓ 2. deadline
  • +
    + {% for rocnik, hodnoceni in podle_rocniku %}

    Ročník {{ rocnik }}

    @@ -22,11 +24,14 @@ {% for hodn in hodnoceni %} - + {% endfor %}
    {{ hodn.reseni.cas_doruceni | date:"d.m.Y H:i"}}{{ hodn.problem }}{{ hodn.problem.nazev | zkrat_nazev_problemu }} {{ hodn.body|default_if_none:"---" }} {{ hodn.reseni.cas_doruceni | deadline_html }}
    + +
    + {% endfor %} {% endblock %} diff --git a/seminar/templatetags/deadliny.py b/seminar/templatetags/deadliny.py index 7251f92c..37cf77af 100644 --- a/seminar/templatetags/deadliny.py +++ b/seminar/templatetags/deadliny.py @@ -39,3 +39,12 @@ def deadline_html(datum): TypDeadline.FinalDeadline: 'final_deadline', } return mark_safe(f'{text}') + +@register.filter(name='zkrat_nazev_problemu') +def zkrat_nazev_problemu(nazev): + if len(nazev) > 10: + if nazev[9] == " ": + nazev = nazev[:9] + "..." + else: + nazev = nazev[:10] + "..." + return nazev