Пример #1
0
def project_edit(project_id):
    if request.method == 'POST':
        update_project(project_id, request.form['title'])
        return redirect(url_for('index'))
    
    project = get_project(project_id)
    return render_template('edit_project.html', project=project)
Пример #2
0
def update(project_id):
    if request.method == 'POST':
        title = request.form.get("title")
        update_project(project_id, title)
        return title
    else:
        data = get_project(project_id)
        return render_template('page_update.html', data=data)
Пример #3
0
def edit_task(project_id, task_id):
    if request.method == 'POST':
        update_task(task_id, request.form['description'])
        return redirect(url_for('tasks', project_id=project_id))

    project = get_project(project_id)
    task = get_task(task_id)
    return render_template('edit_task.html', project=project, task=task)
Пример #4
0
def edit_project(project_id):
    if request.method == 'POST':
        try:
            update_project(project_id, request.form['title'])
        except:
            pass
        return redirect(url_for('project_index'))

    project = get_project(project_id)
    return render_template('project/show.html', project=project)
Пример #5
0
def task_edit(project_id, task_id):
    project = get_project(project_id)
    task = get_task(task_id)

    if request.method == 'POST':
        description = request.form['description']
        update_task(task_id, description)
        return redirect(url_for('task_all', project_id=project_id))

    return render_template('edit_task.html', project=project, task=task)
Пример #6
0
def view_project(id):
    project = get_project(id)
    tasks = get_all_tasks(id)
    return render_template('page_update.html', tasks=tasks, project=project)
Пример #7
0
def task_index(project_id):
    project = get_project(project_id)
    return render_template('task/index.html', project=project)
Пример #8
0
def task_all(project_id):
    project = get_project(project_id)
    tasks = get_all_tasks(project_id)
    return render_template('task.html', project=project, all_tasks=tasks)
Пример #9
0
def tasks(project_id):
    project = get_project(project_id)
    all_tasks = get_all_tasks(project_id)
    return render_template('tasks.html', all_tasks=all_tasks, project=project)