Beispiel #1
0
def index(html=None):
    """"""
    if current_app.debug and html is not None:
        if html=='favicon.ico':
            return send_from_directory(os.path.join(current_app.root_path, 'templates'),
                                       'favicon.ico', mimetype='image/vnd.microsoft.icon')
        else:
            pos = html.find('.')
            if pos != -1 :
                return render_template('/%s' % html)
            else:
                abort(404)

    jobs = api_job.get_lastest_page(1, per_page=5)
    carinfos = api_carpool.get_lastest_page(1, per_page=5)
    #blogs = api_blog.get_lastest_page(1, per_page=5)
    # return render_template('index/index.html', jobs=jobs, carinfos=carinfos)#, blogs=blogs)
    return redirect(url_for('job.list_job'))
Beispiel #2
0
def list_carpool(page=None):
    """"""
    page = int(request.args.get("page", 1))
    if page == None or page <= 0:
        page = 1
    carpools = api_carpool.get_lastest_page(page)
    pageInfo = paginationInfo(carpools)
    carpools = [
        dict(
            id=carpool.id,
            price=carpool.price,
            start=carpool.start,
            target=carpool.target,
            route=carpool.route,
            publish_time=mkmillseconds(carpool.create_at),
        )
        for carpool in carpools.items
    ]
    return jsonres(rv=dict(datas=carpools, pageInfo=pageInfo))
Beispiel #3
0
def list_carinfo(page=None):
    if page == None or page <= 0:
        page = 1
    carinfos = api_carpool.get_lastest_page(page)
    return render_template('carpool/list.html', carinfos = carinfos)