示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 def get(self):
     data = {
         'title': '添加 | 博客',
         'tags': BlogTags.get_all_tags(),
         'category': BlogCategory.get_all_category()
     }
     self.render('admin/admin_blog_add.html', **data)
示例#4
0
 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)
示例#5
0
 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)
示例#6
0
    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)
示例#7
0
 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)
示例#8
0
    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)
示例#9
0
    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)
示例#10
0
    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)
示例#11
0
    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)
示例#12
0
    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)