diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-10-27 23:50:35 (GMT) |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-10-27 23:50:35 (GMT) |
commit | c6a045730ca0cf1ee484110a0dcc34173ce97690 (patch) | |
tree | 9ad3c8bd6c3e1b62b2bb925296e044b6c6a76712 /web/macros.py | |
parent | 652f7196b0b71554151d2c9b1ba5597222c80aa7 (diff) | |
download | site-c6a045730ca0cf1ee484110a0dcc34173ce97690.tar.gz |
Mention news article authors
Mention the names of news articles authors, as we did on the old web
site.
Diffstat (limited to 'web/macros.py')
-rw-r--r-- | web/macros.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/web/macros.py b/web/macros.py index 309e0b4..05dcf5a 100644 --- a/web/macros.py +++ b/web/macros.py | |||
@@ -107,14 +107,15 @@ def make_news_page(posts, current_index): | |||
107 | teaser = ['# ' + title] | 107 | teaser = ['# ' + title] |
108 | for p in posts: | 108 | for p in posts: |
109 | source = list() | 109 | source = list() |
110 | author = p.author.encode('ascii', 'xmlcharrefreplace') | ||
110 | timestamp = time.strptime(p.date, '%Y-%m-%d') | 111 | timestamp = time.strptime(p.date, '%Y-%m-%d') |
111 | date = time.strftime('%A, %B %-e, %Y', timestamp) | 112 | author_date = author + ', ' + time.strftime('%B %-e, %Y', timestamp) |
112 | teaser.append('## %s' % p.title) | 113 | teaser.append('## %s' % p.title) |
113 | teaser.append('*%s*' % date) | 114 | teaser.append('*%s*' % author_date) |
114 | teaser.append('%s' % p.source.split(marker, 1)[0].rstrip()) | 115 | teaser.append('%s' % p.source.split(marker, 1)[0].rstrip()) |
115 | teaser.append('<a href="%s">Read more »</a>' % p.url) | 116 | teaser.append('<a href="%s">Read more »</a>' % p.url) |
116 | source.append('# %s' % p.title) | 117 | source.append('# %s' % p.title) |
117 | source.append('*%s*' % date) | 118 | source.append('*%s*' % author_date) |
118 | source.append(p.source.replace(marker, '', 1)) | 119 | source.append(p.source.replace(marker, '', 1)) |
119 | p.source = '\n'.join(source) | 120 | p.source = '\n'.join(source) |
120 | p['parent'] = title | 121 | p['parent'] = title |