Mercurial > piecrust2
comparison piecrust/admin/views/sources.py @ 886:dcdec4b951a1
admin: Get the admin panel working again.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 20 Jun 2017 21:13:08 -0700 |
parents | 82509bce94ca |
children | 7ecb946bfafd |
comparison
equal
deleted
inserted
replaced
885:13e8b50a2113 | 886:dcdec4b951a1 |
---|---|
16 | 16 |
17 i = 0 | 17 i = 0 |
18 default_author = site.config.get('site/author') | 18 default_author = site.config.get('site/author') |
19 data = {'title': "List %s" % source_name} | 19 data = {'title': "List %s" % source_name} |
20 data['pages'] = [] | 20 data['pages'] = [] |
21 pgn = Paginator(None, source, page_num=page_num, items_per_page=20) | 21 pgn = Paginator(source, None, sub_num=page_num, items_per_page=20) |
22 for p in pgn.items: | 22 for p in pgn.items: |
23 page_data = { | 23 page_data = { |
24 'title': p['title'], | 24 'title': p['title'], |
25 'author': p.get('author', default_author), | 25 'author': p.get('author', default_author), |
26 'slug': p['slug'], | |
27 'timestamp': p['timestamp'], | 26 'timestamp': p['timestamp'], |
28 'tags': p.get('tags', []), | 27 'tags': p.get('tags', []), |
29 'category': p.get('category'), | 28 'category': p.get('category'), |
30 'source': source_name, | 29 'source': source_name, |
31 'url': url_for('.edit_page', slug=p['slug']) | 30 'url': url_for('.edit_page', uri=p['slug']) |
32 } | 31 } |
33 data['pages'].append(page_data) | 32 data['pages'].append(page_data) |
34 | 33 |
35 prev_page_url = None | 34 prev_page_url = None |
36 if pgn.prev_page_number: | 35 if pgn.prev_page_number: |