Release v0.1.30: improve daily workflows and mobile layout
This commit is contained in:
@@ -71,6 +71,10 @@ class Journal:
|
||||
entries.sort(key=lambda e: (e['occurredOn'], e['createdAt'], e['id']), reverse=True)
|
||||
try: page = max(0, min(100000, int(query.get('page', '0'))))
|
||||
except ValueError: raise a.Problem('页码不正确')
|
||||
if query.get('focus'):
|
||||
index = next((i for i, entry in enumerate(entries) if entry['id'] == query['focus']), None)
|
||||
if index is not None: page = index // 20
|
||||
page = min(page, max(0, (len(entries)-1)//20))
|
||||
media = {m['id']: m for m in a.HOUSEHOLDS.objects(user, 'journal_media')}
|
||||
likes = a.HOUSEHOLDS.objects(user, 'journal_likes')
|
||||
comments = a.HOUSEHOLDS.objects(user, 'journal_comments')
|
||||
|
||||
Reference in New Issue
Block a user