Example #1
0
def book_category(category, level):
    # level = request.args.get('level')
    if category == "teach_book":
        book_list = Book.query.filter(Book.publish == True, Book.category == u"幼教教材")
        if level:
            book_list = book_list.filter(Book.level == level)
        book_list = book_list.limit(8)
        top10 = Book.top10()
        return render_template(
            "book/sub_node.html",
            book_list=book_list,
            top10=top10,
            level=level,
            slider=Slider.book_slider(),
            category=category,
        )

    elif category == "read_book":
        book_list = Book.query.filter(Book.publish == True, Book.category == u"幼教读物")
        if level:
            book_list = book_list.filter(Book.level == level)
        book_list = book_list.limit(8)
        return render_template(
            "book/sub_node.html", book_list=book_list, level=level, slider=Slider.book_slider(), category=category
        )
    else:
        abort(404)
Example #2
0
def book_category(category, level):
    # level = request.args.get('level')
    if category == 'teach_book':
        book_list = Book.query.filter(Book.publish == True,
                                      Book.category == u'幼教教材')
        if level:
            book_list = book_list.filter(Book.level == level)
        book_list = book_list.limit(8)
        top10 = Book.top10()
        return render_template('book/sub_node.html',
                               book_list=book_list,
                               top10=top10,
                               level=level,
                               slider=Slider.book_slider(),
                               category=category)

    elif category == 'read_book':
        book_list = Book.query.filter(Book.publish == True,
                                      Book.category == u'幼教读物')
        if level:
            book_list = book_list.filter(Book.level == level)
        book_list = book_list.limit(8)
        return render_template('book/sub_node.html',
                               book_list=book_list,
                               level=level,
                               slider=Slider.book_slider(),
                               category=category)
    else:
        abort(404)
Example #3
0
def courseware():
    courseware_list = Courseware.query.limit(12).all()
    return render_template('courseware/home.html',
                           current_page='courseware',
                           courseware_list=courseware_list,
                           Courseware=Courseware,
                           slider=Slider.courseware_slider())
Example #4
0
def book():
    teach_book_list = Book.query.filter(
        and_(Book.category == u'幼教教材', Book.publish == True)).limit(9)
    read_book_list = Book.query.filter_by(category=u'幼教读物').limit(9)
    # import ipdb; ipdb.set_trace()
    return render_template('book/home.html', teach_book_list=teach_book_list,
                           read_book_list=read_book_list, Book=Book,
                           slider=Slider.book_slider())
Example #5
0
def school_sub(category):
    video_list = OnlineCourse.query.filter(OnlineCourse.publish==True)
    if category == 'lecture':
        video_list = video_list.filter(OnlineCourse.category==u'优秀讲座')
        slider = Slider.onlinecourse_slider()
        return render_template('onlinecourse/sub_node.html', current_page='school',
                               video_list=video_list, slider=slider)
    else:
        abort(404)
Example #6
0
def courseware():
    courseware_list = Courseware.query.limit(12).all()
    return render_template(
        "courseware/home.html",
        current_page="courseware",
        courseware_list=courseware_list,
        Courseware=Courseware,
        slider=Slider.courseware_slider(),
    )
Example #7
0
def book():
    teach_book_list = Book.query.filter(
        and_(Book.category == u'幼教教材', Book.publish == True)).limit(9)
    read_book_list = Book.query.filter_by(category=u'幼教读物').limit(9)
    # import ipdb; ipdb.set_trace()
    return render_template('book/home.html',
                           teach_book_list=teach_book_list,
                           read_book_list=read_book_list,
                           Book=Book,
                           slider=Slider.book_slider())
Example #8
0
def school_sub(category):
    video_list = OnlineCourse.query.filter(OnlineCourse.publish == True)
    if category == 'lecture':
        video_list = video_list.filter(OnlineCourse.category == u'优秀讲座')
        slider = Slider.onlinecourse_slider()
        return render_template('onlinecourse/sub_node.html',
                               current_page='school',
                               video_list=video_list,
                               slider=slider)
    else:
        abort(404)
Example #9
0
def book_category(category):
    level = request.args.get('level')
    if category == 'teach_book':
        book_list = Book.query.filter(Book.publish==True, Book.category==u'幼教教材')
        if level:
            book_list = book_list.filter(Book.level==level)
        book_list = book_list.limit(8)
        top10 = Book.top10()
        return render_template('book/sub_node.html', book_list=book_list, top10=top10,
                               level=level, slider=Slider.book_slider())

    elif category == 'read_book':
        book_list = Book.query.filter(Book.publish==True, Book.category==u'幼教读物')
        if level:
            book_list = book_list.filter(Book.level==level)
        book_list = book_list.limit(8)
        return render_template('book/sub_node.html', book_list=book_list, level=level,
                               slider=Slider.book_slider())
    else:
        abort(404)
Example #10
0
def courseware_sub():
    top10 = Courseware.top10()
    level = request.args.get('level')
    if not level:
        courseware_list = Courseware.query.limit(10).all()
    elif level in [u'小班', u'中班', u'大班']:
        courseware_list = Courseware.query.join(Book).filter(Book.level == level).all()
    else:
        courseware_list = []
    return render_template('courseware/sub_node.html', current_page='courseware',
                           top10=top10, courseware_list=courseware_list,
                           slider=Slider.courseware_slider())
Example #11
0
def courseware_sub(args):
    top10 = Courseware.top10()
    level = args.get('level')
    if not level:
        courseware_list = Courseware.query.limit(10).all()
    elif level in [u'小班', u'中班', u'大班']:
        courseware_list = Courseware.query.join(Book).filter(
            Book.level == level).all()
    else:
        courseware_list = []
    return render_template('courseware/sub_node.html',
                           current_page='courseware',
                           top10=top10,
                           courseware_list=courseware_list,
                           slider=Slider.courseware_slider())
Example #12
0
def courseware_sub(args):
    top10 = Courseware.top10()
    level = args.get("level")
    if not level:
        courseware_list = Courseware.query.limit(10).all()
    elif level in [u"小班", u"中班", u"大班"]:
        courseware_list = Courseware.query.join(Book).filter(Book.level == level).all()
    else:
        courseware_list = []
    return render_template(
        "courseware/sub_node.html",
        current_page="courseware",
        top10=top10,
        courseware_list=courseware_list,
        slider=Slider.courseware_slider(),
    )
Example #13
0
def school():
    slider = Slider.onlinecourse_slider()
    return render_template('onlinecourse/home.html', current_page='school',
                           Video=OnlineCourse, slider=slider)
Example #14
0
def school():
    slider = Slider.onlinecourse_slider()
    return render_template('onlinecourse/home.html',
                           current_page='school',
                           Video=OnlineCourse,
                           slider=slider)