예제 #1
0
def iteration(request, projectID, iterationID):
    if project_api.can_user_access_project(request.user.id, projectID):
        projects = project_api.get_projects_for_user(request.user.id)
        project = project_api.get_project(projectID)
        if project == None:
            return redirect('/req/projects')
        association = UserAssociation.objects.get(user=request.user,
                                                  project=project)
        iterations = project_api.get_iterations_for_project(project)
        iteration = project_api.get_iteration(iterationID)
        if iteration != None:
            stories = project_api.get_stories_for_iteration(iteration)
        else:
            stories = project_api.get_stories_with_no_iteration(project)
        context = {
            'projects': projects,
            'project': project,
            'association': association,
            'iterations': iterations,
            'iteration': iteration,
            'stories': stories,
            'owns_project':
            project_api.user_owns_project(request.user, project)
        }
        if iteration == None:
            context['isIceBox'] = True
        return render(request, 'IterationDetail.html', context)
    else:
        # return HttpResponse("You cannot access project " + proj)
        return redirect('/req/projects')
예제 #2
0
def backlog(request, projectID, iterationID):
    if project_api.can_user_access_project(request.user.id, projectID):
        projects = project_api.get_projects_for_user(request.user.id)
        project = project_api.get_project(projectID)
        if project is None:
            return redirect('/req/projects')
        association = UserAssociation.objects.get(user=request.user,
                                                  project=project)
        iterations = project_api.get_iterations_for_project(project)
        iteration = project_api.get_iteration(iterationID)
        priorities = Story.PRIORITY_CHOICES
        if iteration is not None:
            stories = project_api.get_stories_for_iteration(iteration)
        else:
            stories = project_api.get_stories_with_no_iteration(project)
        context = {
            'projects': projects,
            'project': project,
            'priorities': priorities,
            'association': association,
            'iterations': iterations,
            'iteration': iteration,
            'stories': stories,
            'owns_project':
            project_api.user_owns_project(request.user, project)
        }
        return render(request, 'BacklogDetail.html', context)
    else:
        # return HttpResponse("You cannot access project " + proj)
        return redirect('/req/projects')
예제 #3
0
def backlog(request, projectID, iterationID):
    if project_api.can_user_access_project(request.user.id, projectID):
        projects = project_api.get_projects_for_user(request.user.id)
        project = project_api.get_project(projectID)
        if project is None:
            return redirect('/req/projects')
        association = UserAssociation.objects.get(
            user=request.user,
            project=project)
        iterations = project_api.get_iterations_for_project(project)
        iteration = project_api.get_iteration(iterationID)
        priorities = Story.PRIORITY_CHOICES
        if iteration is not None:
            stories = project_api.get_stories_for_iteration(iteration)
        else:
            stories = project_api.get_stories_with_no_iteration(project)
        context = {'projects': projects,
                   'project': project,
                   'priorities': priorities,
                   'association': association,
                   'iterations': iterations,
                   'iteration': iteration,
                   'stories': stories,
                   'owns_project': project_api.user_owns_project(request.user, project)
                   }
        return render(request, 'BacklogDetail.html', context)
    else:
        # return HttpResponse("You cannot access project " + proj)
        return redirect('/req/projects')
예제 #4
0
def iteration(request, projectID, iterationID):
    if project_api.can_user_access_project(request.user.id, projectID):
        projects = project_api.get_projects_for_user(request.user.id)
        project = project_api.get_project(projectID)
        if project == None:
            return redirect('/req/projects')
        association = UserAssociation.objects.get(user=request.user, project=project)
        iterations = project_api.get_iterations_for_project(project)
        iteration = project_api.get_iteration(iterationID)
        if iteration != None:
            stories = project_api.get_stories_for_iteration(iteration)
        else:
            stories = project_api.get_stories_with_no_iteration(project)
        context = {'projects' : projects,
                   'project' : project,
                   'association' : association,
                   'iterations' : iterations,
                   'iteration' : iteration,
                   'stories' : stories,
                   'owns_project' : project_api.user_owns_project(request.user,project)
                   }
        if iteration == None:
            context['isIceBox'] = True
        return render(request, 'IterationDetail.html', context)
    else:
        # return HttpResponse("You cannot access project " + proj)
        return redirect('/req/projects')