From 9510c1d3878408741b203786e5b21f90a52ef8e6 Mon Sep 17 00:00:00 2001 From: "Tomas \"Jethro\" Pokorny" Date: Thu, 25 Jul 2019 21:15:48 +0200 Subject: [PATCH 1/7] Opraveno generovani obalek. --- seminar/templates/seminar/archiv/obalky.tex | 12 ++++++++---- seminar/views.py | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/seminar/templates/seminar/archiv/obalky.tex b/seminar/templates/seminar/archiv/obalky.tex index 4995d105..ea20f63d 100644 --- a/seminar/templates/seminar/archiv/obalky.tex +++ b/seminar/templates/seminar/archiv/obalky.tex @@ -96,25 +96,29 @@ {% for r in resitele %} + {% with o=r.osoba %} + {% with s=r.osoba.skola %} {% spaceless %} {% if r.zasilat == "do_skoly" %} {% if r.stat == "CZ" %} -\obalka{{r.jmeno|sloz}}{{r.prijmeni|sloz}}{{r.skola.nazev|sloz}}{{r.skola.ulice|sloz}}{{r.skola.psc|sloz}}{{r.skola.mesto|sloz}}{{''|sloz}} +\obalka{{o.jmeno|sloz}}{{o.prijmeni|sloz}}{{s.nazev|sloz}}{{s.ulice|sloz}}{{s.psc|sloz}}{{s.mesto|sloz}}{{''|sloz}} {% else %} -\obalka{{r.jmeno|sloz}}{{r.prijmeni|sloz}}{{r.skola.nazev|sloz}}{{r.skola.ulice|sloz}}{{r.skola.psc|sloz}}{{r.skola.mesto|sloz}}{{r.stat.name|sloz}} +\obalka{{o.jmeno|sloz}}{{o.prijmeni|sloz}}{{s.nazev|sloz}}{{s.ulice|sloz}}{{s.psc|sloz}}{{s.mesto|sloz}}{{o.stat.name|sloz}} {% endif %} {% elif r.zasilat == "domu" %} {% if r.stat == "CZ" %} -\obalka{{r.jmeno|sloz}}{{r.prijmeni|sloz}}{{''|sloz}}{{r.ulice|sloz}}{{r.psc|sloz}}{{r.mesto|sloz}}{{''|sloz}} +\obalka{{o.jmeno|sloz}}{{o.prijmeni|sloz}}{{''|sloz}}{{o.ulice|sloz}}{{o.psc|sloz}}{{o.mesto|sloz}}{{''|sloz}} {% else %} -\obalka{{r.jmeno|sloz}}{{r.prijmeni|sloz}}{{''|sloz}}{{r.ulice|sloz}}{{r.psc|sloz}}{{r.mesto|sloz}}{{r.stat.name|sloz}} +\obalka{{o.jmeno|sloz}}{{o.prijmeni|sloz}}{{''|sloz}}{{o.ulice|sloz}}{{o.psc|sloz}}{{o.mesto|sloz}}{{o.stat.name|sloz}} {% endif %} {% else %} % zasilat: {{r.zasilat}} %\obalka{{r.jmeno|sloz}}{{r.prijmeni|sloz}}{{''|sloz}}{{r.ulice|sloz}}{{r.psc|sloz}}{{r.mesto|sloz}}{{r.stat.name|sloz}} {% endif %} {% endspaceless %} + {% endwith %} + {% endwith %} {% endfor %} \end{document} diff --git a/seminar/views.py b/seminar/views.py index 7ac0701e..0829711a 100644 --- a/seminar/views.py +++ b/seminar/views.py @@ -524,7 +524,7 @@ def obalkyView(request,resitele): tex = render(request,'seminar/archiv/obalky.tex', {'resitele': resitele}).content tempdir = tempfile.mkdtemp() - with open(tempdir+"/obalky.tex","w") as texfile: + with open(tempdir+"/obalky.tex","wb") as texfile: texfile.write(tex) shutil.copy(os.path.join(settings.STATIC_ROOT, 'seminar/lisak.eps'),tempdir) subprocess.call(["pdflatex","obalky.tex"],cwd = tempdir) From 2ad3c425f7715ba23a5e1e33cace0bc431973d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kate=C5=99ina=20=C4=8C=C3=AD=C5=BEkov=C3=A1?= Date: Thu, 25 Jul 2019 21:20:15 +0200 Subject: [PATCH 2/7] =?UTF-8?q?opraveno=20zobrazen=C3=AD=20seznamu=20organ?= =?UTF-8?q?iz=C3=A1tor=C5=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../seminar/cojemam/organizatori.html | 26 +++++++++---------- seminar/views.py | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/seminar/templates/seminar/cojemam/organizatori.html b/seminar/templates/seminar/cojemam/organizatori.html index 4f3709a4..0b9c62ac 100644 --- a/seminar/templates/seminar/cojemam/organizatori.html +++ b/seminar/templates/seminar/cojemam/organizatori.html @@ -25,40 +25,40 @@ {% endif %} {% for org in object_list %}

- {{org.user.first_name}} + {{org.osoba.jmeno}} {% if org.prezdivka %} - „{{org.prezdivka}}“ + „{{org.osoba.prezdivka}}“ {% endif %} - {{org.user.last_name}} + {{org.osoba.prijmeni}}

- + From 4836d10493fd7da3eb04a139bfbfaf563c234708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kate=C5=99ina=20=C4=8C=C3=AD=C5=BEkov=C3=A1?= Date: Thu, 25 Jul 2019 21:42:54 +0200 Subject: [PATCH 4/7] =?UTF-8?q?opraven=C3=AD=20testdat=20ps=C4=8D,=20telef?= =?UTF-8?q?on,=20p=C5=99ezd=C3=ADvka,=20m=C4=9Bsto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/testutils.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/seminar/testutils.py b/seminar/testutils.py index e8f302bc..9aa58dca 100644 --- a/seminar/testutils.py +++ b/seminar/testutils.py @@ -23,7 +23,7 @@ def gen_osoby(rnd, size): 'Pokora', 'Koch', 'Szegedy', 'Rudý', "von Neumann", "d'Este"] prijmeni_f = ['Novotná', 'Svobodová', 'Machová', 'Zelená', 'Yu-Xin', 'Mlsná', 'Dubná', 'Mrkvová', 'Suchá', 'Lovelace', 'Holcová', 'Rui'] - prezdivka = ['Kaki', 'Hurdur', 'Maracuja', 'Bobbo', "", "", "", "", "", + prezdivky = ['Kaki', 'Hurdur', 'Maracuja', 'Bobbo', "", "", "", "", "", "", "", 'Riki', 'Sapa', "", '', '---', 'Koko'] domain = ['example.com', 'dolujeme.eu', 'mff.cuni.cz', 'strcprstskrzkrk.cz', 'british.co.uk', 'splachni.to', 'haha.org'] @@ -42,16 +42,16 @@ def gen_osoby(rnd, size): pohlavi = rnd.randint(0,1) jmeno = rnd.choice([jmena_m, jmena_f][pohlavi]) prijmeni = rnd.choice([prijmeni_m, prijmeni_f][pohlavi]) - prezdivka = rnd.choice([prezdivka]) + prezdivka = rnd.choice(prezdivky) email = "@".join([unidecode.unidecode(jmeno), rnd.choice(domain)]) - telefon = [rnd.choice([k for k in range(10)]) for i in range(10)] + telefon = "".join([str(rnd.choice([k for k in range(10)])) for i in range(9)]) narozeni = datetime.date(rnd.randint(1980, 2020), rnd.randint(1, 12), rnd.randint(1, 28)) ulic = rnd.choice(seznam_ulic) cp = rnd.randint(1, 99) ulice = " ".join([ulic, str(cp)]) - mesto = rnd.choice([seznam_mest]) - psc = [rnd.choice([k for k in range(10)]) for i in range(6)] + mesto = rnd.choice(seznam_mest) + psc = "".join([str(rnd.choice([k for k in range(10)])) for i in range(5)]) osoby.append(Osoba.objects.create(jmeno = jmeno, prijmeni = prijmeni, prezdivka = prezdivka, pohlavi_muz = pohlavi, email = email, telefon = telefon, datum_narozeni = narozeni, ulice = ulice, From 0a737390b4f610412f7d431cec979ef833687e58 Mon Sep 17 00:00:00 2001 From: "Tomas \"Jethro\" Pokorny" Date: Thu, 25 Jul 2019 22:25:46 +0200 Subject: [PATCH 5/7] Opraveny fluentcomments Nevim, jestli se to nekde skutecne pouziva, ale aspon si to nebude porad stezovat, ze neexistuji. --- mamweb/templates/base.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mamweb/templates/base.html b/mamweb/templates/base.html index 2f5826ef..aeb5f51b 100644 --- a/mamweb/templates/base.html +++ b/mamweb/templates/base.html @@ -13,8 +13,8 @@ {% include 'autocomplete_light/static.html' %} - - + + {# nastavení MathJaxu, aby nahrazoval i matiku obalenou jednoduchými $ #}
- {% if org.foto %} - {# #} - {{org.user.first_name}} {{org.user.last_name}} + {% if org.osoba.foto %} + {# #} + {{org.osoba.jmeno}} {{org.osoba.prijmeni}} {% endif %}
    {% if aktivni %} - {% if org.organizuje_od_roku %} + {% if org.organizuje_od %}
  • - Organizuje od roku {{org.organizuje_od_roku}} + Organizuje od roku {{org.organizuje_od}} {% endif %} {% else %}
  • - Aktivní v letech {{org.organizuje_od_roku | default:"?" }}–{{org.organizuje_do_roku | default:"?" }} + Aktivní v letech {{org.organizuje_od | default:"?" }}–{{org.organizuje_do | default:"?" }} {% endif %} - {% if org.studuje %} -
  • {{org.studuje}} + {% if org.skola %} +
  • {{org.studuje}} na {{org.skola}} {% endif %} - {% if org.user.email %} + {% if org.osoba.email %}
  • Pošta: {# zobrazeni e-mailu (na jednom radku, aby nevznikaly mezery navic) #} - {% for znak in org.user.email %}{% if znak == '@' %} <zavináč> {% elif znak == '.' %} <tečka> {% else %}{{znak}}{% endif %}{% endfor %} + {% for znak in org.osoba.email %}{% if znak == '@' %} <zavináč> {% elif znak == '.' %} <tečka> {% else %}{{znak}}{% endif %}{% endfor %} {% endif %}
{# {{org.strucny_popis_organizatora}} #} diff --git a/seminar/views.py b/seminar/views.py index 7ac0701e..42d8b388 100644 --- a/seminar/views.py +++ b/seminar/views.py @@ -146,7 +146,7 @@ def aktivniOrganizatori(datum=date.today()): return Organizator.objects.exclude( organizuje_do__isnull=False, organizuje_do__lt=datum - ).order_by('user__first_name') + ).order_by('osoba__jmeno') class CojemamOrganizatoriView(generic.ListView): From 080405a2940c548b0aa0f2b96a4d695a2d6006b0 Mon Sep 17 00:00:00 2001 From: "Tomas \"Jethro\" Pokorny" Date: Thu, 25 Jul 2019 21:34:21 +0200 Subject: [PATCH 3/7] Opravena stara reference na telefonni cislo, zruseny stvrzenky. --- seminar/templates/seminar/soustredeni/seznam_soustredeni.html | 2 +- seminar/templates/seminar/soustredeni/seznam_ucastniku.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/seminar/templates/seminar/soustredeni/seznam_soustredeni.html b/seminar/templates/seminar/soustredeni/seznam_soustredeni.html index 538843bd..a607e41e 100644 --- a/seminar/templates/seminar/soustredeni/seznam_soustredeni.html +++ b/seminar/templates/seminar/soustredeni/seznam_soustredeni.html @@ -51,7 +51,7 @@ HTML tabulka pro tisk, CSV, E-maily
- Stvrzenky (42 v URL nahraďte prvním číslem z rozsahu) + {% endif %} diff --git a/seminar/templates/seminar/soustredeni/seznam_ucastniku.html b/seminar/templates/seminar/soustredeni/seznam_ucastniku.html index 346b348b..926b4905 100644 --- a/seminar/templates/seminar/soustredeni/seznam_ucastniku.html +++ b/seminar/templates/seminar/soustredeni/seznam_ucastniku.html @@ -25,7 +25,7 @@
{{sous_ucast.resitel}} {{sous_ucast.resitel.rok_maturity}}{{sous_ucast.resitel.telefon}}{{sous_ucast.resitel.osoba.telefon}} {{sous_ucast.poznamka}}