diff --git a/render.py b/render.py index 6489704..bd63966 100755 --- a/render.py +++ b/render.py @@ -90,6 +90,7 @@ def render_template(path, week=None, **kwargs): u.username = un u.name = rec['name'] u.links = rec['links'] + u.twitter = rec.get('twitter') u.start_de = datetime.datetime.strptime(rec['start'],"%Y/%m/%d").strftime("%d.%m.%Y") u.start = rec['start'] u.end = rec.get('end') diff --git a/templates/users.tmpl b/templates/users.tmpl index acbcaf1..2d577d1 100644 --- a/templates/users.tmpl +++ b/templates/users.tmpl @@ -8,7 +8,11 @@ % for u in sorted(userlist, key=lambda u:u.username): ${u.name} - @${u.username} + + % if u.twitter != False: + @${u.username} + % endif + % if u.links: % for a in u.links: diff --git a/templates/week.tmpl b/templates/week.tmpl index 59fe0c1..dfb199e 100644 --- a/templates/week.tmpl +++ b/templates/week.tmpl @@ -2,7 +2,11 @@ Results for week beginning ${week_start.strftime("%F")}

Who posted:

% for u in sorted(good, key=lambda u:u.username): -
${u.name} - @${u.username}:
+
${u.name} \ + % if u.twitter != False: + @${u.username} \ + % endif + :