From 73236f48e7995e32c72b96fb4cf56144c3e28226 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Sun, 6 Aug 2023 12:03:24 -0500 Subject: links: cleaned up tag views --- app/links/templates/links/link_list.html | 6 +++--- app/links/urls.py | 5 ----- app/links/views.py | 8 ++------ 3 files changed, 5 insertions(+), 14 deletions(-) (limited to 'app/links') diff --git a/app/links/templates/links/link_list.html b/app/links/templates/links/link_list.html index 8f80a28..35992fc 100644 --- a/app/links/templates/links/link_list.html +++ b/app/links/templates/links/link_list.html @@ -17,15 +17,15 @@ {% endblock %} {%block bodyid%}class="links" id="links-archive"{%endblock%} - {% block breadcrumbs %}{% if breadcrumbs %}{% include "lib/breadcrumbs.html" with breadcrumbs=breadcrumbs %}{%endif%}{% endblock %} {% block primary %}
+ {{object_list}} {% autopaginate object_list 100 %}{% for object in object_list %}
@@ -34,7 +34,7 @@
{% endblock %} diff --git a/app/links/urls.py b/app/links/urls.py index 792a5ea..f789b4d 100644 --- a/app/links/urls.py +++ b/app/links/urls.py @@ -17,11 +17,6 @@ urlpatterns = [ views.LinkTagListView.as_view(), name='list-tag' ), - re_path( - r'(?P[-\d]+).txt$', - views.LinkDetailViewTXT.as_view(), - name="detail-txt" - ), path( r'', views.LinkDetailView.as_view(), diff --git a/app/links/views.py b/app/links/views.py index 4beff5d..e95cff4 100644 --- a/app/links/views.py +++ b/app/links/views.py @@ -20,21 +20,17 @@ class LinkTagListView(PaginatedListView): model = Link def get_queryset(self): - print(self.kwargs['slug']) - return Link.objects.filter(tags__slug=self.kwargs['slug']) + return Link.objects.filter(tags__name__in=[self.kwargs['slug']]) def get_context_data(self, **kwargs): # Call the base implementation first to get a context context = super(LinkTagListView, self).get_context_data(**kwargs) context['tag'] = Tag.objects.get(slug__exact=self.kwargs['slug']) context['tags'] = Link.tags.all() + context['breadcrumbs'] = ('Links',) return context class LinkDetailView(DetailView): model = Link slug_field = "id" - - -class LinkDetailViewTXT(LinkDetailView): - template_name = "details/entry.txt" -- cgit v1.2.3-70-g09d2