def commenturl(context): """Generate the URL for the current comment.""" if comments.com_stash_var not in context: return '' c = context[comments.com_stash_var] url = context.uri(context.page, context.comment_view()) url += '#%s' % comments.anchor_for(c) return url
def _cominfo(ppath, cname): npage = rend.mod.get_page(ppath) c = rend.mod.get_comment(npage, cname) if not c: return (None, None, None) url = rend.ctx.url(npage, view) ca = comments.anchor_for(c) url += '#%s' % ca return (c, npage, url, ca)