Browse Source

Styl přehledu řešení

middleware_test
Pavel "LEdoian" Turinsky 4 years ago
parent
commit
adef6c6627
  1. 15
      seminar/templates/seminar/odevzdavatko/resitel_prehled.html
  2. 12
      seminar/templatetags/deadliny.py

15
seminar/templates/seminar/odevzdavatko/resitel_prehled.html

@ -2,10 +2,23 @@
{% load static %}
{% load deadliny %}
{% block custom_css %}
<style type=text/css>
.dosla_reseni tr th {
text-align: center;
}
.dosla_reseni tr th, .dosla_reseni tr td {
border: 1px solid black;
padding: 1px 10px 1px 10px;
border-collapse: collapse;
}
</style>
{% endblock custom_css %}
{% block content %}
{% for rocnik, hodnoceni in podle_rocniku %}
<h1>Ročník {{ rocnik }}</h1>
<table>
<table class="dosla_reseni">
<tr>
<th>Doručeno</th>
<th>Problém</th>

12
seminar/templatetags/deadliny.py

@ -13,10 +13,20 @@ def deadline_text(datum):
}
return strings[typ]
@register.filter(name='deadline_kratseji')
def deadline_kratsi_text(datum):
typ, cislo, dl = deadline(datum)
strings = {
TypDeadline.PredDeadline: f"1. deadline {cislo}",
TypDeadline.SousDeadline: f"Soustřeďkový deadline {cislo}",
TypDeadline.FinalDeadline: f"Finální deadline {cislo}",
}
return strings[typ]
@register.filter(name='deadline_html')
def deadline_html(datum):
typ, _, _ = deadline(datum)
text = deadline_text(datum)
text = deadline_kratsi_text(datum)
classes = {
TypDeadline.PredDeadline: 'preddeadline',
TypDeadline.SousDeadline: 'sous_deadline',

Loading…
Cancel
Save