Ejemplo n.º 1
0
def splash():
    # Splash page, if user is logged in then show dashboard
    if g.user is None:
        return render_template('splash.html')
    else:
        projects = Project.query.filter_by(login=g.user.login).all()
        cache = ProjectCache.get_user_cache(g.user.login)
        if cache:
            import json
            _func = lambda x: {"url": x['git_url'], "name": x['full_name']}
            cache = json.dumps(map(_func, cache.data))
        else:
            cache = []
        return render_template('dashboard.html', repos=projects, cache=cache)
Ejemplo n.º 2
0
def repos():
    # pylint:disable-msg=E1101
    cache = ProjectCache.get_user_cache(g.user.login)
    myprojects = Project.query.filter_by(
        login=g.user.login, is_github=True).all()
    mygit = Project.query.filter_by(login=g.user.login, is_github=False).all()

    p = {}
    if myprojects:
        for i in myprojects:
            p[i.full_name] = i
    # import ipdb; ipdb.set_trace()
    return render_template('settings/index.html',
                           cache=cache, projects=p, gitprojects=mygit)
Ejemplo n.º 3
0
def splash():
    # Splash page, if user is logged in then show dashboard
    if g.user is None:
        return render_template("splash.html")
    else:
        projects = Project.query.order_by(Project.id.desc())
        cache = ProjectCache.get_user_cache(g.user.login)
        if cache:
            import json

            _func = lambda x: {"url": x["git_url"], "name": x["full_name"]}
            cache = json.dumps(unique(map(_func, cache.data), "name"))
        else:
            cache = []

        datadir_sizes = get_directory_sizes(app.config["DATA_ROOT"])
        datadir_sizes = [{"key": item[0], "value": item[1]} for item in datadir_sizes]
        return render_template("dashboard.html", repos=projects, cache=cache, datadir_sizes=datadir_sizes)