diff options
author | Mike Crute <mcrute@gmail.com> | 2010-02-20 19:11:43 -0500 |
---|---|---|
committer | Mike Crute <mcrute@gmail.com> | 2010-02-20 19:11:43 -0500 |
commit | fd265db0708a5692c391a25af5a57873d8dcceab (patch) | |
tree | e5ae4d83abea01e329e9b1a61e8bd4f8217a0b51 | |
parent | 8b1db4523831bb7c4a3689828f86434d61e4c5d6 (diff) | |
parent | a2f857565a1431cfe1b51fd9c5588174349f0fac (diff) | |
download | snakeplan-fd265db0708a5692c391a25af5a57873d8dcceab.tar.bz2 snakeplan-fd265db0708a5692c391a25af5a57873d8dcceab.tar.xz snakeplan-fd265db0708a5692c391a25af5a57873d8dcceab.zip |
Merging in Ben's changes
-rw-r--r-- | snakeplan/projects/templates/projects/story_detail.html | 5 | ||||
-rw-r--r-- | snakeplan/projects/templates/projects/story_list.html | 8 | ||||
-rw-r--r-- | snakeplan/projects/urls.py | 1 | ||||
-rw-r--r-- | snakeplan/projects/views/iterations.py | 14 | ||||
-rw-r--r-- | snakeplan/projects/views/stories.py | 10 |
5 files changed, 33 insertions, 5 deletions
diff --git a/snakeplan/projects/templates/projects/story_detail.html b/snakeplan/projects/templates/projects/story_detail.html new file mode 100644 index 0000000..f8ade89 --- /dev/null +++ b/snakeplan/projects/templates/projects/story_detail.html | |||
@@ -0,0 +1,5 @@ | |||
1 | <h1>{{ object.name }}</h1> | ||
2 | |||
3 | <ol> | ||
4 | <li> {{ object }} </li> | ||
5 | </ol> | ||
diff --git a/snakeplan/projects/templates/projects/story_list.html b/snakeplan/projects/templates/projects/story_list.html new file mode 100644 index 0000000..4424ac4 --- /dev/null +++ b/snakeplan/projects/templates/projects/story_list.html | |||
@@ -0,0 +1,8 @@ | |||
1 | <h1>Iteration: {{ iteration_name }}</h1> | ||
2 | |||
3 | <h2>Stories</h2> | ||
4 | <ol> | ||
5 | {% for story in object_list %} | ||
6 | <li><a href="/project/story/{{story.id}}/">{{story.name}}</a></li> | ||
7 | {% endfor %} | ||
8 | </ol> | ||
diff --git a/snakeplan/projects/urls.py b/snakeplan/projects/urls.py index d477430..46c10a4 100644 --- a/snakeplan/projects/urls.py +++ b/snakeplan/projects/urls.py | |||
@@ -4,5 +4,6 @@ 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'^iteration/(.*)/', 'iterations.index'), | ||
7 | (r'^(.*)/', 'projects.project_iterations'), | 8 | (r'^(.*)/', 'projects.project_iterations'), |
8 | ) | 9 | ) |
diff --git a/snakeplan/projects/views/iterations.py b/snakeplan/projects/views/iterations.py new file mode 100644 index 0000000..eae5c89 --- /dev/null +++ b/snakeplan/projects/views/iterations.py | |||
@@ -0,0 +1,14 @@ | |||
1 | from django.views.generic import list_detail | ||
2 | from snakeplan.projects.models import Iteration | ||
3 | from snakeplan.projects.models import Story | ||
4 | |||
5 | def index(request, iteration_id): | ||
6 | stories = Story.objects.filter(iteration=iteration_id) | ||
7 | iteration = stories[0].iteration | ||
8 | |||
9 | return list_detail.object_list( | ||
10 | request=request, | ||
11 | queryset=stories, | ||
12 | extra_context={'iteration_name': iteration}, | ||
13 | allow_empty = True | ||
14 | ) | ||
diff --git a/snakeplan/projects/views/stories.py b/snakeplan/projects/views/stories.py index f87bb2b..39bc323 100644 --- a/snakeplan/projects/views/stories.py +++ b/snakeplan/projects/views/stories.py | |||
@@ -1,10 +1,10 @@ | |||
1 | from django.views.generic import list_detail | 1 | from django.views.generic import list_detail |
2 | from snakeplan.projects.models import Iteration | 2 | from snakeplan.projects.models import Story |
3 | 3 | ||
4 | 4 | ||
5 | def index(request, project_id): | 5 | def index(request, story_id): |
6 | return list_detail.object_list( | 6 | return list_detail.object_detail( |
7 | request=request, | 7 | request=request, |
8 | queryset=Iteration.objects.filter(project=project_id).all(), | 8 | queryset=Story.objects.filter(id=story_id).all(), |
9 | allow_empty=True | 9 | object_id=story_id, |
10 | ) | 10 | ) |