diff options
author | luxagraf <sng@luxagraf.net> | 2023-07-27 08:55:31 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2023-07-27 08:55:31 -0500 |
commit | 94dc3eb97f4ddb09da3dde887703e95d5a876576 (patch) | |
tree | e6c5dbee693fe99fa9dd338583e26e12e7849022 | |
parent | 3e31c2bb0e5984d344a1c5d7144fb956b395f062 (diff) |
posts: added top level link to new stuff
-rw-r--r-- | app/posts/templates/posts/post_list.html | 19 | ||||
-rw-r--r-- | app/posts/views.py | 5 | ||||
-rw-r--r-- | templates/base.html | 5 |
3 files changed, 22 insertions, 7 deletions
diff --git a/app/posts/templates/posts/post_list.html b/app/posts/templates/posts/post_list.html index 316a11b..17828a6 100644 --- a/app/posts/templates/posts/post_list.html +++ b/app/posts/templates/posts/post_list.html @@ -4,11 +4,20 @@ {%endblock%} {% block primary %} <main class="content"> - <ul>{% for object in object_list %} - <li> - <a href="/post/{{object.id}}/notes">{{object.title}}</a> - </li>{% endfor %} - </ul> + <div class="narrow mtop"> + <h2>New Guides</h2> + <ul>{% for object in object_list %} + <li> + <a href="/post/{{object.id}}/notes">{{object.title}}</a> + </li>{% endfor %} + </ul> + <h2>Reviews and Raves</h2> + <ul>{% for object in reviews %} + <li> + <a href="{{object.get_absolute_url}}">{{object.title}}</a> + </li>{% endfor %} + </ul> + </div> </main> {% endblock %} {% block js %} diff --git a/app/posts/views.py b/app/posts/views.py index 402b473..3e0ac23 100644 --- a/app/posts/views.py +++ b/app/posts/views.py @@ -20,6 +20,11 @@ class PostNewView(LoginRequiredMixin, ListView): def get_queryset(self): return Post.objects.filter(user=self.request.user).filter(is_live=0) + def get_context_data(self, **kwargs): + context = super(PostNewView, self).get_context_data(**kwargs) + context['reviews'] = Note.objects.filter(plan__in=[1,2]) + return context + class PostTodoView(LoginRequiredMixin, ListView): template_name = 'posts/post_table.html' diff --git a/templates/base.html b/templates/base.html index 0d85eae..5d0a398 100644 --- a/templates/base.html +++ b/templates/base.html @@ -20,9 +20,10 @@ <a class="logo-link" href="/" title="Home">W</span></a> </div> <nav> - <a class="nav-item" href="/notes" title="View Guides">Notes</a> + <a class="nav-item" href="/notes" title="View Notes">Notes</a> <a class="nav-item" href="/posts" title="View Guides">Guides</a> - <a class="nav-item" href="/posts/todo" title="View Guides">todo</a> + <a class="nav-item" href="/posts/todo" title="View things that need to be done">todo</a> + <a class="nav-item" href="/posts/new" title="View new stuff todo">new</a> <span class="logout" > <form class="inline btn" action="/logout/" method="post">{% csrf_token %} <button type="submit" value="Log out" class="btn-link">Log out</button> |