Пример #1
0
def web_modal_responsible(pid):
    project = get_project_record(pid)
    if "admin" in current_user.permissions():
        form = new_responsible(project, True)
    else:
        form = new_responsible(project, False)
    return jsonify(
        render_template("modals/project_add_responsible.html", form=form))
Пример #2
0
def web_project_delete_user():
    data = request.get_json()
    if not data:
        raise ValueError("Expecting application/json requests")
    pid = check_int(data["project"])
    login = check_str(data["login"].strip().lower())
    project = get_project_record(pid)
    users = list(map(lambda x: x.login, project.users))
    if login not in users:
        raise ValueError(
            "User '%s' seems not to be registered in project '%s'" %
            (login, project.get_name()))
    user = get_user_record(login)
    task = TaskQueue().project(project).user_remove(user).task
    return jsonify(message=ProjectLog(project).user_delete(task))
Пример #3
0
def web_modal_activity(pid):
    project = get_project_record(pid)
    form = activity(project)
    return jsonify(
        render_template("modals/project_upload_activity.html", form=form))
Пример #4
0
def web_modal_history(pid):
    project = get_project_record(pid)
    return jsonify(
        render_template("modals/project_show_history.html", form=project))
Пример #5
0
def web_modal_activate(pid):
    project = get_project_record(pid)
    form = activate(project)
    return jsonify(
        render_template("modals/project_activate_suspended.html", form=form))
Пример #6
0
def web_modal_extend(pid):
    project = get_project_record(pid)
    form = extend(project)
    return jsonify(render_template("modals/project_extend_cpu.html",
                                   form=form))
Пример #7
0
def web_modal_renew(pid):
    project = get_project_record(pid)
    form = renew(project)
    if not form:
        return jsonify("<div>Error processing the form</div>")
    return jsonify(render_template("modals/project_renew_cpu.html", form=form))
Пример #8
0
def web_modal_transform(pid):
    project = get_project_record(pid)
    form = transform(project)
    return jsonify(
        render_template("modals/project_transform_type.html", form=form))
Пример #9
0
def web_modal_user(pid):
    project = get_project_record(pid)
    form = new_user(project)
    return jsonify(render_template("modals/project_add_user.html", form=form))