added a /comments and fixed an independent.co.uk button bug

This commit is contained in:
spez
2008-10-24 14:59:04 -07:00
parent ab2c5eaf82
commit d9e398a7fe
4 changed files with 10 additions and 3 deletions

View File

@@ -89,7 +89,7 @@ def make_map(global_conf={}, app_conf={}):
action='oldinfo', dest='comments', type='ancient')
mc('/info/:article/:dest/:comment', controller='front',
action='oldinfo', type='old', dest='comments', comment=None)
mc('/related/:article/:title', controller='front',
action = 'related', title=None)
mc('/details/:article/:title', controller='front',
@@ -104,7 +104,7 @@ def make_map(global_conf={}, app_conf={}):
mc('/', controller='hot', action='listing')
listing_controllers = "hot|saved|toplinks|new|recommended|randomrising"
listing_controllers = "hot|saved|toplinks|new|recommended|randomrising|comments"
mc('/:controller', action='listing',
requirements=dict(controller=listing_controllers))

View File

@@ -32,6 +32,7 @@ from listingcontroller import MyredditsController
from listingcontroller import ByIDController as ByidController
from listingcontroller import RandomrisingController
from listingcontroller import UserController
from listingcontroller import CommentsController
from feedback import FeedbackController
from front import FrontController

View File

@@ -562,3 +562,9 @@ class MyredditsController(ListingController):
def GET_listing(self, where, **env):
self.where = where
return ListingController.GET_listing(self, **env)
class CommentsController(ListingController):
title_text = _('comments')
def query(self):
return Comment._query(sort = desc('_date'))

View File

@@ -146,7 +146,7 @@ ${class_def(3)}
fullname = thing.link._fullname
ups = thing.link.upvotes
downs = thing.link.downvotes
link = "http://%s%s" % (get_domain(cname = c.cname, subreddit = not c.cname),
link = "http://%s%s" % (get_domain(cname = c.cname, subreddit = False),
thing.link.make_permalink_slow())
else:
fullname = ""