From 63e150b8685c489941e33965cc50479a87412c82 Mon Sep 17 00:00:00 2001 From: "Bc. Petr Pecha" Date: Sat, 27 Feb 2016 08:49:37 +0100 Subject: [PATCH] prispevek | stylovani + titul nutno jeste dostylovat --- mamweb/static/css/mamweb.css | 4 ++++ .../templates/seminar/archiv/prispevek.html | 12 +++++++----- seminar/views.py | 18 ++++++++++++++++-- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/mamweb/static/css/mamweb.css b/mamweb/static/css/mamweb.css index a8f48643..7880c7e2 100644 --- a/mamweb/static/css/mamweb.css +++ b/mamweb/static/css/mamweb.css @@ -679,3 +679,7 @@ div.zadani_azad_termin { div.novinka_obrazek { width: 100%; } + +div.org-text { + font-style: italic; +} diff --git a/seminar/templates/seminar/archiv/prispevek.html b/seminar/templates/seminar/archiv/prispevek.html index 5cf84f09..fdf2b3f2 100644 --- a/seminar/templates/seminar/archiv/prispevek.html +++ b/seminar/templates/seminar/archiv/prispevek.html @@ -6,16 +6,18 @@ {% block content %} {% if not prispevek.zverejnit %}
{% endif %} -

Příspěvek k tématu {{prispevek.problem.nazev}} - řešitele {{prispevek.reseni.resitel}}

+

{{prispevek.nazev}}

+

{{titul}} {{prispevek.reseni.resitel}}

+

Příspěvek k tématu {{prispevek.problem.nazev}}

+ {% if prispevek.reseni.body %} +
({{prispevek.reseni.body}} b)
+ {% endif %} {% if prispevek.text_org %} -

Organizátorský komentář:

- {% autoescape off %}{{prispevek.text_org}}{% endautoescape %} +
{% autoescape off %}{{prispevek.text_org}}{% endautoescape %}
{% endif %} {% if prispevek.text_resitel %} -

Text od Řešitele

{% autoescape off %}{{prispevek.text_resitel}}{% endautoescape %} {% endif %} {% if not prispevek.zverejnit %}
{% endif %} diff --git a/seminar/views.py b/seminar/views.py index 029fe8f0..c34bcd36 100644 --- a/seminar/views.py +++ b/seminar/views.py @@ -260,8 +260,6 @@ class PrispevekView(generic.DetailView): prispevek_arg = self.kwargs.get('prispevek') queryset = queryset.filter(pk=prispevek_arg) - print queryset - try: obj = queryset.get() except queryset.model.DoesNotExist: @@ -272,6 +270,22 @@ class PrispevekView(generic.DetailView): return obj else: raise Http404() + + def get_context_data(self, **kwargs): + context = super(PrispevekView, self).get_context_data(**kwargs) + # snaho o ziskani titulu + titul = '' + try: + resitel = context['prispevek'].reseni.resitel + cislo = context['prispevek'].reseni.cislo_body + body = VysledkyKCisluOdjakziva.objects.filter(resitel=resitel, + cislo=cislo) + body = body.first().body + titul = resitel.get_titul(body) + except: + pass + context['titul'] = titul + return context