diff options
-rw-r--r-- | snakeplan/projects/templates/iteration_list.html | 9 | ||||
-rw-r--r-- | snakeplan/projects/templates/iterations/iteration_list.html | 4 | ||||
-rw-r--r-- | snakeplan/projects/urls.py | 2 | ||||
-rw-r--r-- | snakeplan/projects/views/iterations.py | 17 |
4 files changed, 13 insertions, 19 deletions
diff --git a/snakeplan/projects/templates/iteration_list.html b/snakeplan/projects/templates/iteration_list.html deleted file mode 100644 index 4b92f71..0000000 --- a/snakeplan/projects/templates/iteration_list.html +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | <h1>Project: {{project_name}}</h1> | ||
2 | |||
3 | <h2>Iterations</h2> | ||
4 | <ul> | ||
5 | {% for iteration in iterations %} | ||
6 | <li><a href="/iteration/{{iteration.id}}">{{iteration.name}}</a></li> | ||
7 | {% endfor %} | ||
8 | </ul> | ||
9 | </ul> | ||
diff --git a/snakeplan/projects/templates/iterations/iteration_list.html b/snakeplan/projects/templates/iterations/iteration_list.html index 4b92f71..f4b6e29 100644 --- a/snakeplan/projects/templates/iterations/iteration_list.html +++ b/snakeplan/projects/templates/iterations/iteration_list.html | |||
@@ -2,8 +2,8 @@ | |||
2 | 2 | ||
3 | <h2>Iterations</h2> | 3 | <h2>Iterations</h2> |
4 | <ul> | 4 | <ul> |
5 | {% for iteration in iterations %} | 5 | {% for iteration in object_list %} |
6 | <li><a href="/iteration/{{iteration.id}}">{{iteration.name}}</a></li> | 6 | <li><a href="/iteration/{{iteration.id}}">{{iteration.name}}</a></li> |
7 | {% endfor %} | 7 | {% endfor %} |
8 | </ul> | 8 | </ul> |
9 | </ul> | 9 | </ul> |
diff --git a/snakeplan/projects/urls.py b/snakeplan/projects/urls.py index 703af8f..cd16a85 100644 --- a/snakeplan/projects/urls.py +++ b/snakeplan/projects/urls.py | |||
@@ -4,5 +4,5 @@ from django.conf.urls.defaults import patterns | |||
4 | urlpatterns = patterns('snakeplan.projects.views', | 4 | urlpatterns = patterns('snakeplan.projects.views', |
5 | (r'^$', 'projects.index'), | 5 | (r'^$', 'projects.index'), |
6 | (r'^story/(.*)/', 'stories.index'), | 6 | (r'^story/(.*)/', 'stories.index'), |
7 | (r'^(.*)/', 'iterations.iteration_list'), | 7 | (r'^(.*)/', 'iterations.index'), |
8 | ) | 8 | ) |
diff --git a/snakeplan/projects/views/iterations.py b/snakeplan/projects/views/iterations.py index d44fec5..4c6568e 100644 --- a/snakeplan/projects/views/iterations.py +++ b/snakeplan/projects/views/iterations.py | |||
@@ -1,11 +1,14 @@ | |||
1 | from django.shortcuts import render_to_response | 1 | from django.views.generic import list_detail |
2 | from snakeplan.projects.models import Project, Iteration | 2 | from snakeplan.projects.models import Iteration |
3 | 3 | ||
4 | def iteration_list(request, project_id): | 4 | def index(request, project_id): |
5 | iterations = Iteration.objects.filter(project=project_id) | 5 | iterations = Iteration.objects.filter(project=project_id) |
6 | project = iterations[0].project | 6 | project = iterations[0].project |
7 | 7 | ||
8 | return render_to_response("iterations/iteration_list.html", | 8 | return list_detail.object_list( |
9 | {"project_name" : project.name, | 9 | request=request, |
10 | "iterations" : iterations, | 10 | template_name='iterations/iteration_list.html', |
11 | }) | 11 | queryset=iterations, |
12 | extra_context={'project_name': project}, | ||
13 | allow_empty=True | ||
14 | ) | ||