Example #1
0
def list_dongtan(blogs_matrix=dict()):
    page = int(request.args.get('page', 1));
    if page == None or page <= 0:
        page = 1
    blogs = api_blog.get_latest_page_filterby(page=page, per_page=10,
                                              category_id=int(blogs_matrix.get('category', 0)))
    pageInfo = paginationInfo(blogs)
    #这个用在动弹里的
    if blogs_matrix.get('showcontent'):
            blogdatas = [dict(id=blog.id,
                      title=blog.title,
                      content=blog.content,
                      userid = blog.user_id,
                      useravatar = blog.user.avatar or url_for('static', filename='/image/'),
                      username = blog.user.validname(),
                      create_at=mkmillseconds(blog.create_at)) for blog in blogs.items]
    else:
        blogdatas = [dict(id=blog.id,
                          title=blog.title,
                          create_at=mkmillseconds(blog.create_at)) for blog in blogs.items]
    return jsonres(rv=dict(pageInfo=pageInfo, datas=blogdatas))
Example #2
0
def list_auditblogs(page=1):
    """显示需要审核的文章列表"""
    blogs = api_blog.get_latest_page_filterby(page=page, can_publish=0)
    return render_template('blog/profile_auditblogs.html', blogs=blogs)
Example #3
0
def list_profileblogs(category=0, page=1):
    """在个人中心显示自己发的blog"""
    if page == None or page <= 0:
        page = 1
    blogs = api_blog.get_latest_page_filterby(page=page, category_id=category, user=current_user)
    return render_template('blog/profile_blogs.html', blogs=blogs, category=category)
Example #4
0
def list_blog(category=0, page=1):
    if page == None or page <= 0:
        page = 1
    blogs = api_blog.get_latest_page_filterby(page=page, category_id=category, can_publish=1)
    return render_template('blog/list.html', blogs=blogs, category=category)