Mercurial > piecrust2
diff foodtruck/views/sources.py @ 657:c1a94e1beb9d
admin: Show a more classic blog post listing in FoodTruck.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 25 Feb 2016 22:30:16 -0800 |
parents | efc1dc916e7c |
children | 3885421c29a3 |
line wrap: on
line diff
--- a/foodtruck/views/sources.py Mon Feb 22 22:44:39 2016 -0800 +++ b/foodtruck/views/sources.py Thu Feb 25 22:30:16 2016 -0800 @@ -16,16 +16,21 @@ abort(400) i = 0 + default_author = site.config.get('site/author') data = {'title': "List %s" % source_name} data['pages'] = [] pgn = Paginator(None, source, page_num=page_num, items_per_page=20) for p in pgn.items: page_data = { 'title': p['title'], + 'author': p.get('author', default_author), 'slug': p['slug'], + 'timestamp': p['timestamp'], + 'tags': p.get('tags', []), + 'category': p.get('category'), 'source': source_name, - 'url': url_for('edit_page', slug=p['slug']), - 'text': text_preview(html_to_text(p['content']), length=300)} + 'url': url_for('edit_page', slug=p['slug']) + } data['pages'].append(page_data) prev_page_url = None