def get(self, board, page=0): if page > BOARD_PAGES: raise NotFound() if page == 0: cache = models.Cache.load(Board=board) if cache: return Response(cache) data = {} data['threads'] = get_threads(board,page=page) # last threads data['show_captcha'] = True data['reply'] = True data['board_name'] = boardlist.get(board, 'WHooo??') data['board'] = board # board name data['boards'] = boardlist_order data['pages'] = range(BOARD_PAGES) html = render_template("thread.html", **data) if page == 0: models.Cache.save(data = html, Board=board) return Response(html)
def get(self, board, page=0): if page > self.PAGES: raise NotFound() if page == 0: cache = models.Cache.load("board", board) if cache: return Response(cache.data) data = {} data['threads'] = get_threads(board,page=page) # last threads data['show_captcha'] = True data['reply'] = True data['board_name'] = self.NAMES.get(board) or "Woooo???" data['board'] = board # board name data['boards'] = get_config("aib", "boardlist") data['pages'] = range(self.PAGES) data['overlay'] = board in self.OVER html = render_template("board.html", **data) if page == 0: cache = models.Cache.create("board", board) cache.data = html cache.put() return Response(html)
def get(self, board): return json_response(util.get_threads(board, fmt_name='plain'))