From 6e8b62d8c38f6ca366f240ea45ad738ebfd62943 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Mon, 27 Jan 2020 20:37:10 -0500 Subject: abstracted breadcrumbs into seperate template --- app/fieldnotes/templates/fieldnotes/fieldnote_detail.html | 11 ++--------- app/fieldnotes/templates/fieldnotes/fieldnote_list.html | 9 ++------- app/fieldnotes/urls.py | 2 +- app/fieldnotes/views.py | 5 +++-- 4 files changed, 8 insertions(+), 19 deletions(-) (limited to 'app/fieldnotes') diff --git a/app/fieldnotes/templates/fieldnotes/fieldnote_detail.html b/app/fieldnotes/templates/fieldnotes/fieldnote_detail.html index dc90e16..0d25108 100644 --- a/app/fieldnotes/templates/fieldnotes/fieldnote_detail.html +++ b/app/fieldnotes/templates/fieldnotes/fieldnote_detail.html @@ -13,15 +13,8 @@ {%endblock%} {% block bodyid %}class="notes--permalin detail" id="archive-{% if month %}{{month|month_number_to_name}}{%endif%}{{year}}"{%endblock%} - - -{% block primary %} -
+{% block breadcrumbs %}{% include "lib/breadcrumbs.html" with breadcrumbs=breadcrumbs %}{% endblock %} +{% block primary %}

{%if object.template_name == 1 or object.template_name == 3 %}{{object.title|smartypants|safe}}{%else%}{{object.title|smartypants|safe}}{%endif%}

diff --git a/app/fieldnotes/templates/fieldnotes/fieldnote_list.html b/app/fieldnotes/templates/fieldnotes/fieldnote_list.html index c201382..5ee6f06 100644 --- a/app/fieldnotes/templates/fieldnotes/fieldnote_list.html +++ b/app/fieldnotes/templates/fieldnotes/fieldnote_list.html @@ -5,13 +5,8 @@ {% block pagetitle %} Field Notes | luxagraf {% endblock %} {% block metadescription %}Rough notes and sketches from the field {% endblock %} {%block bodyid%}id="field-notes"{%endblock%} - -{% block primary %} - -
+{% block breadcrumbs %}{% include "lib/breadcrumbs.html" with breadcrumbs=breadcrumbs %}{% endblock %} +{% block primary %}

Field Notes

Quick notes, sketches and images from the road. This is the semi-orgnized brain dump that comes before the more organized journal entries and essays. If I used social media this is the stuff I'd probably put there, but I prefer to put it here, even if it means a lot fewer people read it.

diff --git a/app/fieldnotes/urls.py b/app/fieldnotes/urls.py index f3ef944..85ee710 100644 --- a/app/fieldnotes/urls.py +++ b/app/fieldnotes/urls.py @@ -2,7 +2,7 @@ from django.urls import path, re_path from . import views -app_name = "fieldnotes" +app_name = "field notes" urlpatterns = [ re_path( diff --git a/app/fieldnotes/views.py b/app/fieldnotes/views.py index fefd138..9b49cc0 100644 --- a/app/fieldnotes/views.py +++ b/app/fieldnotes/views.py @@ -1,19 +1,20 @@ from django.views.generic.dates import YearArchiveView, MonthArchiveView from django.views.generic.detail import DetailView -from utils.views import PaginatedListView +from utils.views import PaginatedListView, LuxDetailView from .models import FieldNote class FieldNoteListView(PaginatedListView): + model = FieldNote """ Return a list of Notes in reverse chronological order """ queryset = FieldNote.objects.filter(status=1).order_by('-pub_date') -class FieldNoteDetailView(DetailView): +class FieldNoteDetailView(LuxDetailView): model = FieldNote slug_field = "slug" -- cgit v1.2.3