Styl přehledu řešení

This commit is contained in:
Pavel "LEdoian" Turinsky 2021-04-14 01:11:51 +02:00
parent 757d3189e7
commit adef6c6627
2 changed files with 25 additions and 2 deletions

View file

@ -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>

View file

@ -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',