diff options
-rw-r--r-- | snakeplan/projects/urls.py | 1 | ||||
-rw-r--r-- | snakeplan/projects/views/stories.py | 4 | ||||
-rw-r--r-- | snakeplan/projects/views/tasks.py | 10 | ||||
-rw-r--r-- | snakeplan/templates/projects/story_detail.html | 13 | ||||
-rw-r--r-- | snakeplan/templates/projects/task_detail.html | 12 |
5 files changed, 38 insertions, 2 deletions
diff --git a/snakeplan/projects/urls.py b/snakeplan/projects/urls.py index d823476..ca1077a 100644 --- a/snakeplan/projects/urls.py +++ b/snakeplan/projects/urls.py | |||
@@ -7,4 +7,5 @@ urlpatterns = patterns('snakeplan.projects.views', | |||
7 | (r'^project/(.*)/iterations/', 'projects.project_iterations'), | 7 | (r'^project/(.*)/iterations/', 'projects.project_iterations'), |
8 | (r'^iteration/(.*)/stories/', 'iterations.index'), | 8 | (r'^iteration/(.*)/stories/', 'iterations.index'), |
9 | (r'^story/(.*)/tasks/', 'stories.index'), | 9 | (r'^story/(.*)/tasks/', 'stories.index'), |
10 | (r'^task/(.*)/', 'tasks.index'), | ||
10 | ) | 11 | ) |
diff --git a/snakeplan/projects/views/stories.py b/snakeplan/projects/views/stories.py index 39bc323..504d930 100644 --- a/snakeplan/projects/views/stories.py +++ b/snakeplan/projects/views/stories.py | |||
@@ -1,10 +1,14 @@ | |||
1 | from django.views.generic import list_detail | 1 | from django.views.generic import list_detail |
2 | from snakeplan.projects.models import Story | 2 | from snakeplan.projects.models import Story |
3 | from snakeplan.projects.models import Task | ||
3 | 4 | ||
4 | 5 | ||
5 | def index(request, story_id): | 6 | def index(request, story_id): |
7 | tasks = Task.objects.filter(story=story_id).all() | ||
8 | |||
6 | return list_detail.object_detail( | 9 | return list_detail.object_detail( |
7 | request=request, | 10 | request=request, |
8 | queryset=Story.objects.filter(id=story_id).all(), | 11 | queryset=Story.objects.filter(id=story_id).all(), |
9 | object_id=story_id, | 12 | object_id=story_id, |
13 | extra_context={'tasks': tasks}, | ||
10 | ) | 14 | ) |
diff --git a/snakeplan/projects/views/tasks.py b/snakeplan/projects/views/tasks.py new file mode 100644 index 0000000..4857a98 --- /dev/null +++ b/snakeplan/projects/views/tasks.py | |||
@@ -0,0 +1,10 @@ | |||
1 | from django.views.generic import list_detail | ||
2 | from snakeplan.projects.models import Task | ||
3 | |||
4 | |||
5 | def index(request, task_id): | ||
6 | return list_detail.object_detail( | ||
7 | request=request, | ||
8 | queryset=Task.objects.filter(id=task_id).all(), | ||
9 | object_id=task_id, | ||
10 | ) | ||
diff --git a/snakeplan/templates/projects/story_detail.html b/snakeplan/templates/projects/story_detail.html index 360ce79..4e73397 100644 --- a/snakeplan/templates/projects/story_detail.html +++ b/snakeplan/templates/projects/story_detail.html | |||
@@ -2,10 +2,19 @@ | |||
2 | 2 | ||
3 | {% block content %} | 3 | {% block content %} |
4 | 4 | ||
5 | <h1>{{ object.name }}</h1> | 5 | <h1>Story: {{ object.name }}</h1> |
6 | |||
7 | <h2>Descipton:</h2> | ||
8 | <p class="story_description">{{ object.description }}</p> | ||
9 | |||
10 | <h2>Tasks:</h2> | ||
6 | 11 | ||
7 | <ol> | 12 | <ol> |
8 | <li> {{ object }} </li> | 13 | {% for task in tasks %} |
14 | <li> | ||
15 | <a href="/p/task/{{ task.id }}/">{{ task.name }}</a> | ||
16 | </li> | ||
17 | {% endfor %} | ||
9 | </ol> | 18 | </ol> |
10 | 19 | ||
11 | {% endblock %} | 20 | {% endblock %} |
diff --git a/snakeplan/templates/projects/task_detail.html b/snakeplan/templates/projects/task_detail.html new file mode 100644 index 0000000..a972dd1 --- /dev/null +++ b/snakeplan/templates/projects/task_detail.html | |||
@@ -0,0 +1,12 @@ | |||
1 | {% extends "base.html" %} | ||
2 | |||
3 | {% block content %} | ||
4 | |||
5 | <h1>Task: {{ object.name }}</h1> | ||
6 | |||
7 | <h2>Descipton:</h2> | ||
8 | <p class="task_description">{{ object.description }}</p> | ||
9 | |||
10 | |||
11 | |||
12 | {% endblock %} | ||