summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/gtd/templates/gtd/project_detail.html24
-rw-r--r--app/gtd/views.py8
2 files changed, 22 insertions, 10 deletions
diff --git a/app/gtd/templates/gtd/project_detail.html b/app/gtd/templates/gtd/project_detail.html
index 38ea559..844a120 100644
--- a/app/gtd/templates/gtd/project_detail.html
+++ b/app/gtd/templates/gtd/project_detail.html
@@ -1,16 +1,28 @@
{% extends 'base_gtd.html' %}
{% load typogrify_tags %}
+{% block extrahead %}
+<style>
+.detail-header {
+ margin-top: 3rem;
+ margin-bottom: 1rem;
+ padding-bottom: 1rem;
+}
+</style>
+{% endblock %}
{% block primary %}
<main role="main" class="archive-wrapper">
+ <div class="post-header detail-header">
+ <h1>Project: {{object.title}}</h1>
+ </div>
<div class="post-body">
- <h2>Project: {{object.title}}</h2>
{{object.body_html|smartypants|safe}}
- <h3>Actions</h3>
- {% for object in object.gtdnote_set.all %}
- <h4>{{object.title}} <span class="note-edit"><a href="{%url 'gtd:note-edit' object.pk%}">edit</a></span></h4>
+ <h4>Actions</h4>
+ <div class="note-list">{% for object in object.gtdnote_set.all %}<article>
+ <h2>{% if object.url %}<a href="{{object.url}}">{{object.title}}</a>{%else%}{{object.title}}{%endif%} <span class="note-edit"><a href="{%url 'gtd:note-edit' object.pk%}">edit</a></span></h2>
{{object.body_html|smartypants|safe}}
- <p class="small"><a href="{% url 'gtd:note-delete' object.pk %}">delete</a></p>
- {% endfor %}
+ <p class="small">{{object.get_status_display}}</p>
+ <p class="small"><a href="{% url 'gtd:note-delete' object.pk %}">delete</a></p></article>
+ {% endfor %}</div>
</div>
</main>
{% endblock %}
diff --git a/app/gtd/views.py b/app/gtd/views.py
index c077d77..96c6387 100644
--- a/app/gtd/views.py
+++ b/app/gtd/views.py
@@ -56,12 +56,12 @@ class GTDNoteListView(ListView):
note_type_reverse = dict((v, k) for k, v in GTDNote.NOTE_TYPE)
note_type = note_type_reverse[self.kwargs['note_type'].title()]
if project:
- return GTDNote.objects.filter(note_type=note_type, project__title=project)
- return GTDNote.objects.filter(note_type=note_type)
+ return GTDNote.objects.filter(note_type=note_type, project__title=project, status__in=[0,1])
+ return GTDNote.objects.filter(note_type=note_type, status__in=[0,1])
else:
if project:
- return GTDNote.objects.filter(project__title=project)
- return GTDNote.objects.all()
+ return GTDNote.objects.filter(project__title=project, status__in=[0,1])
+ return GTDNote.objects.filter(status__in=[0,1])
def get_context_data(self, **kwargs):
context = super(GTDNoteListView, self).get_context_data(**kwargs)