Exemplo n.º 1
0
 def normal_index(self):
     book = book_controler()
     title = "小书库"
     category_list = book.get_categories()
     has_param = False
     top_books = book.get_top_books()
     print "Get normal index page success"
     return render.index(title,category_list,has_param,top_books)
Exemplo n.º 2
0
    def param_index(self, params):
        param = param_handler()
        book = book_controler()
        title = "小书库"
        category_name = params["name"]
        category_list = book.get_categories()
        tags = None
        for cate in category_list:
            if cate["name"] == category_name:
                cate["class_name"] = "category-selected"
                tags = cate["tags"]
            else:
                cate["class_name"] = ""
        has_param = True
        books = book.get_books_with_category(param.get_category_name())

        return render.index_category(title,category_list, has_param, books, tags)