Allow user to set whether comments are ascending or descending

This commit is contained in:
Christopher Allan Webber 2011-11-19 14:01:38 -06:00
parent 5db324f7c6
commit 7c378f2cd5
2 changed files with 9 additions and 2 deletions

View File

@ -27,6 +27,9 @@ allow_registration = boolean(default=True)
tags_delimiter = string(default=",") tags_delimiter = string(default=",")
tags_max_length = integer(default=50) tags_max_length = integer(default=50)
# Whether comments are ascending or descending
comments_ascending = boolean(default=True)
# By default not set, but you might want something like: # By default not set, but you might want something like:
# "%(here)s/user_dev/templates/" # "%(here)s/user_dev/templates/"
local_templates = string() local_templates = string()

View File

@ -106,11 +106,15 @@ def media_home(request, media, page, **kwargs):
""" """
if ObjectId(request.matchdict.get('comment')): if ObjectId(request.matchdict.get('comment')):
pagination = Pagination( pagination = Pagination(
page, media.get_comments(True), MEDIA_COMMENTS_PER_PAGE, page, media.get_comments(
mg_globals.app_config['comments_ascending']),
MEDIA_COMMENTS_PER_PAGE,
ObjectId(request.matchdict.get('comment'))) ObjectId(request.matchdict.get('comment')))
else: else:
pagination = Pagination( pagination = Pagination(
page, media.get_comments(True), MEDIA_COMMENTS_PER_PAGE) page, media.get_comments(
mg_globals.app_config['comments_ascending']),
MEDIA_COMMENTS_PER_PAGE)
comments = pagination() comments = pagination()