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)
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)
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)
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)
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)
def view_project(id): project = get_project(id) tasks = get_all_tasks(id) return render_template('page_update.html', tasks=tasks, project=project)
def task_index(project_id): project = get_project(project_id) return render_template('task/index.html', project=project)
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)
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)