Пример #1
0
    def nav(self):
        cloud = Tag.tag_cloud_for_subreddits([c.current_or_default_sr._id])

        buttons = []
        for tag, weight in cloud:
            buttons.append(NavButton(tag.name, tag.name, css_class=self.numbers[weight - 1]))

        return NavMenu(buttons, type="flatlist", separator=' ', base_path='/tag/')
Пример #2
0
    def nav(self):
        cloud = Tag.tag_cloud_for_subreddits([c.current_or_default_sr._id])

        buttons = []
        for tag, weight in cloud:
            buttons.append(NavButton(tag.name, tag.name, css_class=self.numbers[weight - 1]))

        return NavMenu(buttons, type="flatlist", separator=' ', base_path='/tag/')
Пример #3
0
    def nav(self):
        sr_ids = Subreddit.user_subreddits(c.user) if c.default_sr else [c.site._id]
        cloud = Tag.tag_cloud_for_subreddits(sr_ids)

        buttons =[]
        for tag, weight in cloud:
            buttons.append(NavButton(tag.name, tag.name, css_class=self.numbers[weight - 1]))

        return NavMenu(buttons, type="flatlist", separator=' ', base_path='/tag/')