From 571edc362652693c61c3a56496152e0e03c51918 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Fri, 28 Jul 2023 15:24:29 -0500 Subject: links: moved templates to app --- app/links/templates/links/link_detail.html | 19 ++++++++++++++ app/links/templates/links/link_list.html | 40 ++++++++++++++++++++++++++++++ app/links/views.py | 7 +++--- 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 app/links/templates/links/link_detail.html create mode 100644 app/links/templates/links/link_list.html (limited to 'app/links') diff --git a/app/links/templates/links/link_detail.html b/app/links/templates/links/link_detail.html new file mode 100644 index 0000000..6ba0619 --- /dev/null +++ b/app/links/templates/links/link_detail.html @@ -0,0 +1,19 @@ +{% extends 'base.html' %} +{% load typogrify_tags %} +{%block bodyid%}class="links"{%endblock%} +{% block primary %} +
+

{{object.title|smartypants|widont|safe}}

+

{{object.url|urlize}}

+
+ {{object.render_description|amp|smartypants|safe}} +
    {% for tag in object.tags.all %} +
  • {{tag}}
  • + {%endfor%}
+
+
+{% endblock %} + diff --git a/app/links/templates/links/link_list.html b/app/links/templates/links/link_list.html new file mode 100644 index 0000000..8f80a28 --- /dev/null +++ b/app/links/templates/links/link_list.html @@ -0,0 +1,40 @@ +{% extends 'base.html' %} +{% load typogrify_tags %} +{% load pagination_tags %} +{% block pagetitle %} Links | luxagraf {% endblock %} +{% block metadescription %} {% endblock %} +{% block extrahead %} + +{% endblock %} +{%block bodyid%}class="links" id="links-archive"{%endblock%} + +{% block breadcrumbs %}{% if breadcrumbs %}{% include "lib/breadcrumbs.html" with breadcrumbs=breadcrumbs %}{%endif%}{% endblock %} +{% block primary %}
+ {% autopaginate object_list 100 %}{% for object in object_list %} + +
+ +
+ +
+{% endblock %} diff --git a/app/links/views.py b/app/links/views.py index ebde61c..4beff5d 100644 --- a/app/links/views.py +++ b/app/links/views.py @@ -4,19 +4,20 @@ from utils.views import PaginatedListView from .models import Link from taggit.models import Tag + class LinkListView(PaginatedListView): model = Link - template_name = 'archives/links.html' def get_context_data(self, **kwargs): # Call the base implementation first to get a context context = super(LinkListView, self).get_context_data(**kwargs) context['tags'] = Link.tags.all() + context['breadcrumbs'] = ('Links',) return context + class LinkTagListView(PaginatedListView): model = Link - template_name = 'archives/links.html' def get_queryset(self): print(self.kwargs['slug']) @@ -29,9 +30,9 @@ class LinkTagListView(PaginatedListView): context['tags'] = Link.tags.all() return context + class LinkDetailView(DetailView): model = Link - template_name = "details/link.html" slug_field = "id" -- cgit v1.2.3-70-g09d2