def new_iteration(request, projectID):
    project = project_api.get_project(projectID)
    if request.method == 'POST':
        form = IterationForm(request.POST)
        if form.is_valid():
            mdl_iteration.create_iteration(project,request.POST)
            form.save(commit=False)
            return redirect('/req/projectdetail/' + projectID)
    else:
        form = IterationForm()
    context = {
        'title': 'Create New Iteration',
        'action': '/req/newiteration/' + projectID,
        'form': form,
        'button_desc': 'Create'
    }
    return render(request, 'IterationSummary.html', context)
def edit_iteration(request,projectID,iterationID):
    project = project_api.get_project(projectID)
    iteration = mdl_iteration.get_iteration(iterationID)
    if project == None or iteration == None or iteration.project != project:
        return redirect('/req/projectdetail/' + projectID)
    if request.method == "POST":
        form = IterationForm(request.POST, instance=iteration)
        if form.is_valid():
            form.save(commit=True)
            return redirect('/req/projects/' + projectID)
    else:
        form = IterationForm(instance=iteration)
    context = {
        'title': 'Edit Iteration',
        'action': '/req/edititeration/' + projectID + '/' + iterationID,
        'form': form,
        'button_desc': 'Save Changes'
    }
    return render(request, 'IterationSummary.html', context)
Exemple #3
0
def new_iteration(request, projectID):
    project = project_api.get_project(projectID)
    if request.method == 'POST':
        form = IterationForm(request.POST)
        if form.is_valid():
            mdl_iteration.create_iteration(project, request.POST)
            form.save(commit=False)
            return redirect('/req/projectdetail/' + projectID)
    else:
        form = IterationForm()
    context = {
        'title': 'Create New Iteration',
        'action': '/req/newiteration/' + projectID,
        'form': form,
        'button_desc': 'Create'
    }
    return render(request, 'IterationSummary.html', context)
Exemple #4
0
def delete_iteration(request, projectID, iterationID):
    project = project_api.get_project(projectID)
    iteration = mdl_iteration.get_iteration(iterationID)
    if project == None or iteration == None or iteration.project != project:
        return redirect('/req/projectdetail/' + projectID)
    if request.method == "POST":
        iteration.delete()
        return redirect('/req/projectdetail/' + projectID)
    else:
        form = IterationForm(instance=iteration)
    context = {
        'title': 'Edit Iteration',
        'confirm_message':
        'This is an irreversible procedure ! You will lose all information about this iteration and stories it contains !',
        'action': '/req/deleteiteration/' + projectID + '/' + iterationID,
        'form': form,
        'button_desc': 'Delete'
    }
    return render(request, 'IterationSummary.html', context)
Exemple #5
0
def edit_iteration(request, projectID, iterationID):
    project = project_api.get_project(projectID)
    iteration = mdl_iteration.get_iteration(iterationID)
    if project == None or iteration == None or iteration.project != project:
        return redirect('/req/projectdetail/' + projectID)
    if request.method == "POST":
        form = IterationForm(request.POST, instance=iteration)
        if form.is_valid():
            form.save(commit=True)
            return redirect('/req/projects/' + projectID)
    else:
        form = IterationForm(instance=iteration)
    context = {
        'title': 'Edit Iteration',
        'action': '/req/edititeration/' + projectID + '/' + iterationID,
        'form': form,
        'button_desc': 'Save Changes'
    }
    return render(request, 'IterationSummary.html', context)
Exemple #6
0
def new_iteration(request, projectID):
    project = project_api.get_project(projectID)
    if request.method == 'POST':
        form = IterationForm(request.POST)
        if form.is_valid():
            mdl_iteration.create_iteration(project, request.POST)
            form.save(commit=False)
            # return redirect('/requirements/projectdetail/' + projectID)
            # return empty string and do the redirect stuff in front-end
            return HttpResponse('')
    else:
        form = IterationForm()
    context = {
        'title': 'Create New Iteration',
        'action': '/requirements/newiteration/' + projectID,
        'form': form,
        'button_desc': 'Create',
    }
    return render(request, 'IterationSummary.html', context)
Exemple #7
0
def edit_iteration(request, projectID, iterationID):
    project = project_api.get_project(projectID)
    iteration = mdl_iteration.get_iteration(iterationID)
    if project is None or iteration is None or iteration.project != project:
        # return redirect('/requirements/projectdetail/' + projectID)
        # return empty string and do the redirect stuff in front-end
        return HttpResponse('')
    if request.method == "POST":
        form = IterationForm(request.POST, instance=iteration)
        if form.is_valid():
            form.save(commit=True)
            # return redirect('/requirements/projectdetail/' + projectID)
            # return empty string and do the redirect stuff in front-end
            return HttpResponse('')
    else:
        form = IterationForm(instance=iteration)
    context = {
        'title': 'Edit Iteration',
        'action':
        '/requirements/edititeration/' + projectID + '/' + iterationID,
        'form': form,
        'button_desc': 'Save Changes'
    }
    return render(request, 'IterationSummary.html', context)