From f285089977c17a79f5458af7e57096674633bc4a Mon Sep 17 00:00:00 2001 From: Johannes Schilling Date: Sun, 27 Oct 2013 02:00:22 +0200 Subject: [PATCH] =?utf8?q?neue=20felder=20im=20teilnehmertool=20und=20temp?= =?utf8?q?lates=20ber=C3=BCcksichtigen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- teilnehmertool.py | 21 ++++++++++++++------- templates/teilnehmerliste.tex | 16 +++++++++------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/teilnehmertool.py b/teilnehmertool.py index 0408eb2..d80d2a1 100755 --- a/teilnehmertool.py +++ b/teilnehmertool.py @@ -163,14 +163,14 @@ def create_nametag(outdir='output'): uni1=hochschule.decode('utf-8')).encode('utf-8')) - +## TODO: feld 'comments', alle abgemeldeten checken und eintragen, +## nicht-tüter, nicht-XYer.. def create_teilnehmer_list(outdir = 'output'): template = env.get_template('teilnehmerliste.tex') teilnehmer = [] - i = 1 - for vor, nach, nick, hochschule, betrag, bezahlt, shirtsize, zippersize in \ - conn.execute("SELECT vorname, nachname, namensschild, hochschule, betrag, bezahlt, tshirt, zipper FROM teilnehmer ORDER BY UPPER(nachname) ASC"): + for vor, nach, nick, hochschule, betrag, bezahlt, shirtsize, zippersize, dochned, comment in \ + conn.execute("SELECT vorname, nachname, namensschild, hochschule, betrag, bezahlt, tshirt, zipper, dochned, orga_comment FROM teilnehmer ORDER BY UPPER(nachname) ASC"): vor = vor.decode('utf8') nach = nach.decode('utf8') @@ -186,10 +186,17 @@ def create_teilnehmer_list(outdir = 'output'): if re.match("kein", zippersize, flags=re.IGNORECASE): zippersize = "" - teilnehmer.append({'vorname': vor, 'nachname': nach, 'num': i, + ## string to bool.. + if dochned == "false": + will_attend = True + else: + will_attend = False + comment = comment.decode('utf8') + + teilnehmer.append({'vorname': vor, 'nachname': nach, 'hochschule': hochschule, 'nick': nick, 'betrag': betrag, 'bezahlt': - bezahlt, 'shirtsize': shirtsize, 'zippersize': zippersize}) - i = i+1 + bezahlt, 'shirtsize': shirtsize, 'zippersize': zippersize, + 'will_attend': will_attend, 'comment': comment}) with open(os.path.join(outdir, "teilnehmerliste.tex"), 'w') as out: diff --git a/templates/teilnehmerliste.tex b/templates/teilnehmerliste.tex index 34e2dc4..c5337a6 100644 --- a/templates/teilnehmerliste.tex +++ b/templates/teilnehmerliste.tex @@ -1,6 +1,6 @@ \documentclass[a4paper,landscape]{scrartcl} -\usepackage[margin=2cm]{geometry} +\usepackage[left=1.2cm,right=2cm,top=1.5cm,bottom=2cm]{geometry} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} @@ -43,17 +43,19 @@ \begin{document} \begin{center} - \begin{longtable}{|m{.1\textwidth}|m{.1\textwidth}|m{.18\textwidth}|m{.15\textwidth}|m{.07\textwidth}|m{.07\textwidth}|m{.05\textwidth}|m{.05\textwidth}|m{.1\textwidth}|} + \begin{longtable}{|m{.08\textwidth}|m{.08\textwidth}|m{.12\textwidth}|m{.15\textwidth}|m{.05\textwidth}|m{.05\textwidth}|m{.05\textwidth}|m{.05\textwidth}|m{.05\textwidth}|m{.2\textwidth}|} \textbf{Vorname} & \textbf{Nachname} & \textbf{Namensschild} & \textbf{Hochschule} & \textbf{Betrag} & \textbf{Bezahlt} & \textbf{Bar bezahlt} & \textbf{T-Shirt-Größe} & - \textbf{Zippergröße} \\ + \textbf{Zipper-Größe} & \textbf{kommentar} \\ \hline \hline \endhead -{% for t in teilnehmer %} - {{ t['vorname'] | escape_tex }} & {{ t['nachname'] | escape_tex }} & {{ t['nick'] | escape_tex }} & {{ - t['hochschule'] | escape_tex }} & {{ t['betrag'] }} & {{ t['bezahlt'] }} & \vspace{1em} & {{ - t['shirtsize'] | escape_tex }} & {{ t['zippersize'] | escape_tex }} \\ +{% for t in teilnehmer %}% +{% if t['will_attend'] %}% + {{ t['vorname'] | escape_tex }} & {{ t['nachname'] | escape_tex }} & {{ t['nick'] | escape_tex }} & {{ + t['hochschule'] | escape_tex }} & {{ t['betrag'] }} & {{ t['bezahlt'] }} & \vspace{1em} & {{ + t['shirtsize'] | escape_tex }} & {{ t['zippersize'] | escape_tex }} & {{ t['comment'] }} \\ +{% endif %}% \hline{% endfor %} \end{longtable} \end{center} -- 2.39.2