diff options
-rw-r--r-- | app/gtd/templates/gtd/project_detail.html | 14 | ||||
-rw-r--r-- | app/gtd/views.py | 2 |
2 files changed, 12 insertions, 4 deletions
diff --git a/app/gtd/templates/gtd/project_detail.html b/app/gtd/templates/gtd/project_detail.html index d9a5657..543b9f6 100644 --- a/app/gtd/templates/gtd/project_detail.html +++ b/app/gtd/templates/gtd/project_detail.html @@ -14,14 +14,19 @@ <main role="main" class="archive-wrapper"> <div class="post-header detail-header"> <h1>Project: {{object.title}}</h1> + +<select class="form-control" style="margin-top: 2%;" onchange="go_from_select(this.options[this.selectedIndex].value)"> + <option value="">All Projects</option>{% for object in projects %} + <option {% if object.title == project %}selected="selected" {%endif%}value="{% url 'gtd:project-detail' object.id%}">{{object}}</option>{%endfor%} +</select> </div> <div class="post-body"> {{object.body_html|smartypants|safe}} - {% regroup object.gtdnote_set.all by note_type as type_list %} + {% regroup note_set by note_type as type_list %} {% for type in type_list %} <h4>{% get_note_type type.grouper %}</h4> <div class="note-list">{% for object in type.list %}<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> + <h2>{% if object.get_status_display == 'Completed' %}<strike style="color: #918d8d">{%endif%}{% 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>{% if object.get_status_display == 'Completed' %}</strike>{%endif%}</h2> {{object.body_html|smartypants|safe}} {% if object.get_status_display != 'None' %}<p class="small">{{object.get_status_display}}</p>{% endif %} <p class="small"><a href="{% url 'gtd:note-delete' object.pk %}">delete</a></p></article> @@ -30,5 +35,6 @@ </div> </main> {% endblock %} - {% block js %} - {% endblock%} +{% block js %} +<script type="text/javascript">var go_from_select = function(opt) { console.log(opt); window.location = opt };</script> +{% endblock%} diff --git a/app/gtd/views.py b/app/gtd/views.py index 9643511..985fdf0 100644 --- a/app/gtd/views.py +++ b/app/gtd/views.py @@ -125,6 +125,8 @@ class GTDProjectDetailView(DetailView): def get_context_data(self, **kwargs): context = super(GTDProjectDetailView, self).get_context_data(**kwargs) + context['note_set'] = GTDNote.objects.filter(project=self.object).order_by('note_type') + context['projects'] = GTDProject.objects.all() return context |