Exemple #1
0
def project_issue(num):
    issue = Issue.objects(number=num)[0]
    child_issues = Issue.objects(base_issue=num)
    comment = Comment()
    form = CommentForm(request.form, comment)
    if form.validate_on_submit():
        form.populate_obj(comment)
        comment.author = session['user_id']
        issue.comments.append(comment)
        issue.save()
        return redirect('/projects/issues/' + num)
    return render_template('projects_issue.html',
                           issue=issue,
                           child_issues=child_issues,
                           form=form)
Exemple #2
0
def project_issue(num):
    issue = Issue.objects(number=num)[0]
    child_issues = Issue.objects(base_issue=num)
    comment = Comment()
    form = CommentForm(request.form, comment)
    if form.validate_on_submit():
        form.populate_obj(comment)
        comment.author = session['user_id']
        issue.comments.append(comment)
        issue.save()
        return redirect('/projects/issues/' + num)
    return render_template('projects_issue.html',
                           issue=issue,
                           child_issues=child_issues,
                           form=form)
Exemple #3
0
def projects_childissue(num):
    base_issue = Issue.objects(number=num)[0]
    project = Project.objects(id=base_issue.project_id)[0]
    issue = Issue()
    form = IssueForm(request.form, issue)
    if form.validate_on_submit():
        form.populate_obj(issue)
        counter = Counter.objects(id_for="issue")[0]
        counter.set_next_id()
        counter.save()
        issue.number = counter.number
        issue.author = session['user_id']
        issue.base_issue = num
        issue.save()
        return redirect('projects/issues/' + str(num))
    return render_template('projects_childissue.html',
                           project=project,
                           base_issue=base_issue,
                           issue=issue,
                           form=form)
Exemple #4
0
def project_show(num):
    project = Project.objects(number=num)[0]
    issues = Issue.objects(project_id=str(project.id))
    for issue in issues:
        issue.comments_count = len(issue.comments)
    issue = Issue()
    form = IssueForm(request.form, issue)
    if form.validate_on_submit():
        counter = Counter.objects(id_for="issue")[0]
        counter.set_next_id()
        counter.save()
        form.populate_obj(issue)
        issue.number = counter.number
        issue.author = session['user_id']
        issue.save()
        return redirect('/projects/' + str(project.number))
    return render_template('projects_show.html',
                           project=project,
                           issues=issues,
                           form=form)
Exemple #5
0
def projects_childissue(num):
    base_issue = Issue.objects(number=num)[0]
    project = Project.objects(id=base_issue.project_id)[0]
    issue = Issue()
    form = IssueForm(request.form, issue)
    if form.validate_on_submit():
        form.populate_obj(issue)
        counter = Counter.objects(id_for="issue")[0]
        counter.set_next_id()
        counter.save()
        issue.number = counter.number
        issue.author = session['user_id']
        issue.base_issue = num
        issue.save()
        return redirect('projects/issues/' + str(num))
    return render_template('projects_childissue.html',
                            project=project,
                            base_issue=base_issue,
                            issue=issue,
                            form=form)
Exemple #6
0
def project_show(num):
    project = Project.objects(number=num)[0]
    issues = Issue.objects(project_id=str(project.id))
    for issue in issues:
        issue.comments_count = len(issue.comments)
    issue = Issue()
    form = IssueForm(request.form, issue)
    if form.validate_on_submit():
        counter = Counter.objects(id_for="issue")[0]
        counter.set_next_id()
        counter.save()
        form.populate_obj(issue)
        issue.number = counter.number
        issue.author = session['user_id']
        issue.save()
        return redirect('/projects/' + str(project.number))
    return render_template('projects_show.html',
                           project=project,
                           issues=issues,
                           form=form)