From 548ed0739f559656aba6eda379ee65159640fba2 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Sun, 15 Nov 2020 16:28:13 -0500 Subject: fixed templates for multiple sites in pages --- app/pages/templates/pages/discursive/homepage.html | 20 +++++ .../templates/pages/discursive/page_detail.html | 30 +++++++ .../templates/pages/discursive/page_detail.txt | 7 ++ app/pages/templates/pages/homepage.html | 98 ---------------------- app/pages/templates/pages/luxagraf/homepage.html | 98 ++++++++++++++++++++++ .../templates/pages/luxagraf/page_detail.html | 37 ++++++++ app/pages/templates/pages/luxagraf/page_detail.txt | 8 ++ app/pages/templates/pages/page_detail.html | 37 -------- app/pages/templates/pages/page_detail.txt | 8 -- app/pages/views.py | 8 +- 10 files changed, 206 insertions(+), 145 deletions(-) create mode 100644 app/pages/templates/pages/discursive/homepage.html create mode 100644 app/pages/templates/pages/discursive/page_detail.html create mode 100644 app/pages/templates/pages/discursive/page_detail.txt delete mode 100644 app/pages/templates/pages/homepage.html create mode 100644 app/pages/templates/pages/luxagraf/homepage.html create mode 100644 app/pages/templates/pages/luxagraf/page_detail.html create mode 100644 app/pages/templates/pages/luxagraf/page_detail.txt delete mode 100644 app/pages/templates/pages/page_detail.html delete mode 100644 app/pages/templates/pages/page_detail.txt (limited to 'app/pages') diff --git a/app/pages/templates/pages/discursive/homepage.html b/app/pages/templates/pages/discursive/homepage.html new file mode 100644 index 0000000..68490ba --- /dev/null +++ b/app/pages/templates/pages/discursive/homepage.html @@ -0,0 +1,20 @@ +{% extends 'discursive_base.html' %} +{% load typogrify_tags %} +{% load comments %} +{% block pagetitle %}Learn Discursive Meditation{% endblock %} +{% block metadescription %}{{object.meta_description}}{% endblock %} +{%block bodyclass%}detail{%endblock%} +{%block bodyid%}{%endblock%} +{% block breadcrumbs %}{% include "lib/breadcrumbs.html" with breadcrumbs=breadcrumbs %}{% endblock %} +{% block content %}
+
+
+

{{object.title}}

+ {%if object.sub_title %}

{{object.sub_title}}

{%endif%} +
+
+ {{object.body_html|safe|smartypants|widont}} +
+
+
+{% endblock %} diff --git a/app/pages/templates/pages/discursive/page_detail.html b/app/pages/templates/pages/discursive/page_detail.html new file mode 100644 index 0000000..8941cd2 --- /dev/null +++ b/app/pages/templates/pages/discursive/page_detail.html @@ -0,0 +1,30 @@ +{% extends 'discursive_base.html' %} +{% load typogrify_tags %} +{% load comments %} +{% block pagetitle %}{{object.title}}{% endblock %} +{% block metadescription %}{{object.meta_description}}{% endblock %} +{%block htmlclass%}class="detail"{%endblock%} +{%block bodyid%}{{object.title|slugify}}{%endblock%} +{% block breadcrumbs %}{% include "lib/breadcrumbs.html" with breadcrumbs=breadcrumbs %}{% endblock %} +{% block content %}
+
+
+

{{object.title}}

+ {%if object.sub_title %}

{{object.sub_title}}

{%endif%} +
+
+ {{object.body_html|safe|smartypants|widont}} +
+
+ {% if object.enable_comments %} +{% get_comment_count for object as comment_count %} +{%if comment_count > 0 %} +

{{comment_count}} Comment{{ comment_count|pluralize }}

+{% render_comment_list for object %} +{%endif%} +
+{% render_comment_form for object %} +
+{%endif%} +
+{% endblock %} diff --git a/app/pages/templates/pages/discursive/page_detail.txt b/app/pages/templates/pages/discursive/page_detail.txt new file mode 100644 index 0000000..bbeb715 --- /dev/null +++ b/app/pages/templates/pages/discursive/page_detail.txt @@ -0,0 +1,7 @@ +{{object.title|safe}} +{% for letter in object.title %}={%endfor%} + + + {{object.pub_date|date:"l, d F Y"}} + +{{object.body_markdown|safe}} diff --git a/app/pages/templates/pages/homepage.html b/app/pages/templates/pages/homepage.html deleted file mode 100644 index c8075ea..0000000 --- a/app/pages/templates/pages/homepage.html +++ /dev/null @@ -1,98 +0,0 @@ -{% extends 'base.html' %} -{% load typogrify_tags %} -{% block sitename %} - - Luxagraf: thoughts on ecology, culture, travel, photography, walking and other ephemera - {%endblock%} - - {%block extrahead%} - -{%endblock%} -{%block bodyid%}id="home" class="archive"{%endblock%} - -{% block primary %} -
-

About Luxagraf

- map of travels -

We’re a family of five living full time in a vintage 1969 Dodge Travco motorhome. We’ve been at it for three years now. People always ask: What's it like for five people to live in a 26ft RV? Why do we live this way?

-

The short answer is simple: because we like it and we can. If you want more than a soundbite, read through the journal. If you like it, sign up for the newsletter, Friends of a Long Year. I'd also subscribe to the RSS feed, but that's just me.

-
- -
-
Browse the Archives
-
-{% endblock %} - -{% block js %}{% comment %} {% endcomment%}{% endblock%} diff --git a/app/pages/templates/pages/luxagraf/homepage.html b/app/pages/templates/pages/luxagraf/homepage.html new file mode 100644 index 0000000..c8075ea --- /dev/null +++ b/app/pages/templates/pages/luxagraf/homepage.html @@ -0,0 +1,98 @@ +{% extends 'base.html' %} +{% load typogrify_tags %} +{% block sitename %} + + Luxagraf: thoughts on ecology, culture, travel, photography, walking and other ephemera + {%endblock%} + + {%block extrahead%} + +{%endblock%} +{%block bodyid%}id="home" class="archive"{%endblock%} + +{% block primary %} +
+

About Luxagraf

+ map of travels +

We’re a family of five living full time in a vintage 1969 Dodge Travco motorhome. We’ve been at it for three years now. People always ask: What's it like for five people to live in a 26ft RV? Why do we live this way?

+

The short answer is simple: because we like it and we can. If you want more than a soundbite, read through the journal. If you like it, sign up for the newsletter, Friends of a Long Year. I'd also subscribe to the RSS feed, but that's just me.

+
+ +
+
Browse the Archives
+
+{% endblock %} + +{% block js %}{% comment %} {% endcomment%}{% endblock%} diff --git a/app/pages/templates/pages/luxagraf/page_detail.html b/app/pages/templates/pages/luxagraf/page_detail.html new file mode 100644 index 0000000..4644386 --- /dev/null +++ b/app/pages/templates/pages/luxagraf/page_detail.html @@ -0,0 +1,37 @@ +{% extends 'base.html' %} +{% load typogrify_tags %} +{% load comments %} +{% block pagetitle %}Luxagraf | {{object.title}}{% endblock %} +{% block metadescription %}{{object.meta_description}}{% endblock %} +{%block htmlclass%}class="detail"{%endblock%} +{%block bodyid%}id="{{object.title|slugify}}"{%endblock%} +{% block breadcrumbs %}{% include "lib/breadcrumbs.html" with breadcrumbs=breadcrumbs %}{% endblock %} +{% block primary %}
+
+
+

{{object.title}}

+ {%if object.sub_title %}

{{object.sub_title}}

{%endif%} +
+
+ {{object.body_html|safe|smartypants|widont}} +
+
+ {% if object.enable_comments %} +{% get_comment_count for object as comment_count %} +{%if comment_count > 0 %} +

{{comment_count}} Comment{{ comment_count|pluralize }}

+{% render_comment_list for object %} +{%endif%} +
+{% render_comment_form for object %} +
+{%endif%} +
+{% endblock %} +{% block js %} + + +{% endblock %} + + diff --git a/app/pages/templates/pages/luxagraf/page_detail.txt b/app/pages/templates/pages/luxagraf/page_detail.txt new file mode 100644 index 0000000..547ce79 --- /dev/null +++ b/app/pages/templates/pages/luxagraf/page_detail.txt @@ -0,0 +1,8 @@ +{{object.title|safe}} +{% for letter in object.title %}={%endfor%} + + by Scott Gilbertson + <{{SITE_URL}}{{object.get_absolute_url}}> + {{object.pub_date|date:"l, d F Y"}} + +{{object.body_markdown|safe}} diff --git a/app/pages/templates/pages/page_detail.html b/app/pages/templates/pages/page_detail.html deleted file mode 100644 index 4644386..0000000 --- a/app/pages/templates/pages/page_detail.html +++ /dev/null @@ -1,37 +0,0 @@ -{% extends 'base.html' %} -{% load typogrify_tags %} -{% load comments %} -{% block pagetitle %}Luxagraf | {{object.title}}{% endblock %} -{% block metadescription %}{{object.meta_description}}{% endblock %} -{%block htmlclass%}class="detail"{%endblock%} -{%block bodyid%}id="{{object.title|slugify}}"{%endblock%} -{% block breadcrumbs %}{% include "lib/breadcrumbs.html" with breadcrumbs=breadcrumbs %}{% endblock %} -{% block primary %}
-
-
-

{{object.title}}

- {%if object.sub_title %}

{{object.sub_title}}

{%endif%} -
-
- {{object.body_html|safe|smartypants|widont}} -
-
- {% if object.enable_comments %} -{% get_comment_count for object as comment_count %} -{%if comment_count > 0 %} -

{{comment_count}} Comment{{ comment_count|pluralize }}

-{% render_comment_list for object %} -{%endif%} -
-{% render_comment_form for object %} -
-{%endif%} -
-{% endblock %} -{% block js %} - - -{% endblock %} - - diff --git a/app/pages/templates/pages/page_detail.txt b/app/pages/templates/pages/page_detail.txt deleted file mode 100644 index 547ce79..0000000 --- a/app/pages/templates/pages/page_detail.txt +++ /dev/null @@ -1,8 +0,0 @@ -{{object.title|safe}} -{% for letter in object.title %}={%endfor%} - - by Scott Gilbertson - <{{SITE_URL}}{{object.get_absolute_url}}> - {{object.pub_date|date:"l, d F Y"}} - -{{object.body_markdown|safe}} diff --git a/app/pages/views.py b/app/pages/views.py index ed8d380..1356729 100644 --- a/app/pages/views.py +++ b/app/pages/views.py @@ -11,13 +11,17 @@ class PageDetailView(LuxDetailView): def get_template_names(self): obj = self.get_object() - return ["pages/%s.html" % obj.slug, 'pages/page_detail.html'] + return ["pages/%s/%s.html" % (obj.site.display_name, obj.slug), \ + 'pages/%spage_detail.html'% obj.site.display_name] class PageDetailTXTView(LuxDetailView): model = Page slug_field = "slug" - template_name = "pages/page_detail.txt" + + def get_template_names(self): + obj = self.get_object() + return 'pages/%spage_detail.txt'% obj.site.display_name class HomePageList(DetailView): -- cgit v1.2.3-70-g09d2