Add basic Stories dashboard

This commit is contained in:
Thierry Carrez 2013-07-11 18:10:17 +02:00
parent a93a0e035a
commit b43903eab8
5 changed files with 33 additions and 6 deletions

View File

@ -50,7 +50,7 @@
<div class="nav-collapse collapse">
<ul class="nav">
<li id="tab-projects"><a href="/project">Projects</a></li>
<li id="tab-tasks"><a href="/story">Tasks</a></li>
<li id="tab-stories"><a href="/story">Stories</a></li>
<li id="tab-about"><a href="/">About</a></li>
</ul>
<ul class="nav pull-right">

View File

@ -2,7 +2,7 @@
{% block content %}
<div class="row-fluid">
<div class="span12">
<h2>Projects</h2>
<h3>Projects</h3>
<table class="table table-striped table-hover">
<thead>
<tr>

View File

@ -23,7 +23,7 @@
{% endblock %}
{% block postscript %}
<script type="text/javascript">
$("#tab-tasks").addClass('active');
$("#tab-stories").addClass('active');
</script>
{% include "stories.modal_addstory.html" %}
{% block modals %}

View File

@ -1,9 +1,33 @@
{% extends "stories.base.html" %}
{% load storyviewfilters %}
{% block content %}
<div class="row-fluid">
<div class="span12">
<p>Hola. This should contain the Tasks dashboard one day.</p>
<p>In the meantime, try <a href="/story/1">this one</a>.</p>
<h3>Stories</h3>
<h5>Recent bugs</h5>
<table class="table table-condensed table-hover">
<thead>
<tr>
<th>#</th>
<th>Story</th>
<th>Priority</th>
<th>Affects</th>
</tr>
</thead>
<tbody>
{% for story in recent_bugs %}
<tr>
<td>{{ story.id }}</td>
<td><small><a href="/story/{{story.id}}">{{ story.title }}</a></small></td>
<td><span class="badge{{ story.priority|priobadge }}">
{{ story.get_priority_display }}</span></td>
<td>
{% for task in story.task_set.all %}{{ task.project.name }}{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}

View File

@ -22,7 +22,10 @@ from projects.models import Project, Milestone, Series
from stories.models import Story, Task, Comment, StoryTag
def dashboard(request):
return render(request, "stories.dashboard.html")
recent_bugs = Story.objects.order_by("-id")[:5]
return render(request, "stories.dashboard.html", {
'recent_bugs': recent_bugs,
})
def view(request, storyid):