def get(self, category_id): data = { 'title': 'Category | 博客', 'blogs': Blog.get_blog_by_category_id(category_id), 'all_category': BlogCategory.get_all_category() } self.render('purecss_ui/blog_category.html', **data)
def get(self): data = { 'title': '添加 | 博客', 'tags': BlogTags.get_all_tags(), 'category': BlogCategory.get_all_category() } self.render('admin/admin_blog_add.html', **data)
def get(self, year, month): data = { 'title': 'Category | 博客', 'blogs': Blog.get_blog_by_date(year, month), 'tags': BlogTags.get_all_tags(), 'category': BlogCategory.get_all_category() } self.render('admin/admin_blog.html', **data)
def get(self, tag_id): data = { 'title': 'Tag | 博客', 'blogs': Blog.get_blog_by_tag_id(tag_id), 'tags': BlogTags.get_all_tags(), 'category': BlogCategory.get_all_category() } self.render('admin/admin_blog.html', **data)
def get(self, blog_id): data = { 'title': 'blog | detail', 'blog': Blog.get_blog(blog_id), 'all_tag': BlogTags.get_all_tags(), 'all_category': BlogCategory.get_all_category(), } self.render('purecss_ui/blog_detail.html', **data)
def get(self, blog_id): blog = Blog.get_blog(blog_id) data = { 'title': '修改 | 博客', 'blog': blog, 'tags': BlogTags.get_all_tags(), 'category': BlogCategory.get_all_category() } self.render('admin/admin_blog_modify.html', **data)
def get(self): search = self.get_argument('search', '') data = { 'title': '搜索', 'query': search, 'blog': Blog.search_blog(search), 'tag': BlogTags.search_tags(search), 'category': BlogCategory.search_category(search) } self.render('search_result.html', **data)
def get(self): page = self.get_int('page', 1) per_page = self.get_int('per_page', 10) query = Blog.select().where(Blog.hide == False).order_by(Blog.id.desc()) ip = self.request.headers['X-Real-Ip'] if ip != '127.0.0.1': AccessRecord.create_a_r(ip) data = { 'title': 'khahux | 平凡的一生', 'paginator': Paginator(query, page, per_page), 'all_tag': BlogTags.get_all_tags(), 'all_category': BlogCategory.get_all_category() } self.render('purecss_ui/blog.html', **data)
def get(self): page = self.get_int('page', 1) per_page = self.get_int('per_page', 10) query = Blog.select().where(Blog.hide == False).order_by( Blog.id.desc()) ip = self.request.headers['X-Real-Ip'] if ip != '127.0.0.1': AccessRecord.create_a_r(ip) data = { 'title': 'khahux | 平凡的一生', 'paginator': Paginator(query, page, per_page), 'all_tag': BlogTags.get_all_tags(), 'all_category': BlogCategory.get_all_category() } self.render('purecss_ui/blog.html', **data)