diff options
-rw-r--r-- | snakeplan/projects/templates/projects/iteration_list.html | 2 | ||||
-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 | ||||
-rwxr-xr-x | snakeplan/urls.py | 2 |
6 files changed, 30 insertions, 7 deletions
diff --git a/snakeplan/projects/templates/projects/iteration_list.html b/snakeplan/projects/templates/projects/iteration_list.html index 6d33251..4c2af14 100644 --- a/snakeplan/projects/templates/projects/iteration_list.html +++ b/snakeplan/projects/templates/projects/iteration_list.html | |||
@@ -5,7 +5,7 @@ | |||
5 | {% for iteration in object_list %} | 5 | {% for iteration in object_list %} |
6 | <div id="{{iteration.id}}"> | 6 | <div id="{{iteration.id}}"> |
7 | <ul> | 7 | <ul> |
8 | <li><a href="{{iteration.id}}">{{iteration.name}}</a></li> | 8 | <li><a href="/project/iteration/{{iteration.id}}/">{{iteration.name}}</a></li> |
9 | <li>{{iteration.description}}</li> | 9 | <li>{{iteration.description}}</li> |
10 | <li>{{iteration.status}}</li> | 10 | <li>{{iteration.status}}</li> |
11 | <li>{{iteration.start_date}}</li> | 11 | <li>{{iteration.start_date}}</li> |
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 | ) |
diff --git a/snakeplan/urls.py b/snakeplan/urls.py index 591c69f..eaa566a 100755 --- a/snakeplan/urls.py +++ b/snakeplan/urls.py | |||
@@ -8,6 +8,6 @@ from snakeplan.projects import admin as snakeplan_admin | |||
8 | 8 | ||
9 | 9 | ||
10 | urlpatterns = patterns('', | 10 | urlpatterns = patterns('', |
11 | (r'^admin/', include('django.contrib.admin.site.urls')), | 11 | (r'^admin/', include(admin.site.urls)), |
12 | (r'^project/', include('snakeplan.projects.urls')), | 12 | (r'^project/', include('snakeplan.projects.urls')), |
13 | ) | 13 | ) |