示例#1
0
文件: front.py 项目: rajbot/tikical
    def GET_duplicates(self, article, num, after, reverse, count):
        links = link_duplicates(article)

        builder = IDBuilder(
            [link._fullname for link in links], num=num, after=after, reverse=reverse, count=count, skip=False
        )
        listing = LinkListing(builder).listing()

        res = LinkInfoPage(
            link=article, comment=None, duplicates=links, content=listing, subtitle=_("other discussions")
        ).render()
        return res
示例#2
0
文件: front.py 项目: nod3x/reddit
    def GET_duplicates(self, article, num, after, reverse, count):
        if not can_view_link_comments(article):
            abort(403, "forbidden")

        links = link_duplicates(article)
        links.sort(key=attrgetter("num_comments"), reverse=True)
        builder = IDBuilder(
            [link._fullname for link in links], num=num, after=after, reverse=reverse, count=count, skip=False
        )
        listing = LinkListing(builder).listing()

        res = LinkInfoPage(
            link=article, comment=None, duplicates=links, content=listing, subtitle=_("other discussions")
        ).render()
        return res
示例#3
0
    def GET_duplicates(self, article, num, after, reverse, count):
        if not can_view_link_comments(article):
            abort(403, 'forbidden')

        links = link_duplicates(article)
        builder = IDBuilder([ link._fullname for link in links ],
                            num = num, after = after, reverse = reverse,
                            count = count, skip = False)
        listing = LinkListing(builder).listing()

        res = LinkInfoPage(link = article,
                           comment = None,
                           duplicates = links,
                           content = listing,
                           subtitle = _('other discussions')).render()
        return res