summaryrefslogtreecommitdiff
path: root/app/posts
diff options
context:
space:
mode:
Diffstat (limited to 'app/posts')
-rw-r--r--app/posts/admin.py2
-rw-r--r--app/posts/models.py5
-rw-r--r--app/posts/templates/posts/guide_detail.html9
3 files changed, 10 insertions, 6 deletions
diff --git a/app/posts/admin.py b/app/posts/admin.py
index a8831e7..3c93411 100644
--- a/app/posts/admin.py
+++ b/app/posts/admin.py
@@ -94,7 +94,7 @@ class EntryAdmin(OSMGeoAdmin):
openlayers_url = '/static/admin/js/OpenLayers.js'
class Media:
- js = ('image-loader.js', 'next-prev-links.js')
+ js = ('image-loader.js', 'product-loader.js', 'next-prev-links.js')
css = {
"all": ("my_styles.css",)
}
diff --git a/app/posts/models.py b/app/posts/models.py
index 1d71ecb..2168df1 100644
--- a/app/posts/models.py
+++ b/app/posts/models.py
@@ -30,7 +30,7 @@ from books.models import Book
from fieldnotes.models import FieldNote
from taxonomy.models import TaggedItems, Category
from jrnl.models import Entry
-from utils.util import render_images, parse_video, markdown_to_html
+from utils.util import render_images, render_products, parse_video, markdown_to_html
class Post(models.Model):
@@ -139,7 +139,8 @@ class Post(models.Model):
created = self.pk is None
if not created:
md = render_images(self.body_markdown)
- self.body_html = markdown_to_html(md)
+ prods = render_products(md)
+ self.body_html = markdown_to_html(prods)
self.epilogue_html = markdown_to_html(self.epilogue_markdown)
self.prologue_html = markdown_to_html(self.prologue_markdown)
self.has_video = parse_video(self.body_html)
diff --git a/app/posts/templates/posts/guide_detail.html b/app/posts/templates/posts/guide_detail.html
index 12fb7e1..360480b 100644
--- a/app/posts/templates/posts/guide_detail.html
+++ b/app/posts/templates/posts/guide_detail.html
@@ -38,6 +38,10 @@
<li itemprop="title">{{object.short_title|smartypants|safe}}</li>
</ul>
<article class="h-entry hentry {% with object.get_template_name_display as t %}{%if t == "double" or t == "double-dark" %} post--article--double{%endif%}{%endwith%}" itemscope itemType="http://schema.org/Article">
+ <span class="hide" itemprop="author" itemscope itemtype="http://schema.org/Person">by
+ <a class="p-author h-card" href="/about"><span itemprop="name">Scott Gilbertson</span></a>
+ </span>
+ <meta itemprop="image" content="https://images.luxagraf.net/header.gif" /> <!--{{self.featured_image.url}}" />-->
<header id="header" class="post-header {% with object.get_template_name_display as t %}{%if t == "double" or t == "double-dark" %}post--header--double{%endif%}{%endwith%}">
<h1 class="p-name entry-title post-title" itemprop="headline">{%if object.template_name == 1 or object.template_name == 3 %}{{object.title|smartypants|safe}}{%else%}{{object.title|smartypants|safe}}{%endif%}</h1>
<h2 class="post-subtitle">{{object.sub_title|smartypants|safe}}</h2>
@@ -47,9 +51,8 @@
<h3 class="h-adr" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">{% if object.location.country_name == "United States" %}<span class="p-locality locality" itemprop="addressLocality">{{object.location.name|smartypants|safe}}</span>, <a class="p-region region" href="/jrnl/united-states/" title="travel writing from the United States">{{object.location.state_name|safe}}</a>, <span class="p-country-name" itemprop="addressCountry">U.S.</span>{%else%}<span class="p-region" itemprop="addressRegion">{{object.location.name|smartypants|safe}}</span>, <a class="p-country-name country-name" href="/jrnl/{{object.location.country_slug}}/" title="travel writing from {{object.location.country_name}}"><span itemprop="addressCountry">{{object.location.country_name|safe}}</span></a>{%endif%}</h3>
&ndash;&nbsp;<a href="" onclick="showMap({{object.latitude}}, {{object.longitude}}, { type:'point', lat:'{{object.latitude}}', lon:'{{object.longitude}}'}); return false;" title="see a map">Map</a>
</div>{%endif%}
- <h3>Filed Under: <a href="/guides/">Guides</a>, {% for tag in object.tags.all %}<a href="/guides/{{tag.slug}}">{{tag}}</a>{%endfor%}</h3>
- <time class="dt-published published dt-updated post-date" datetime="{{object.pub_date|date:'c'}}" itemprop="datePublished">{{object.pub_date|date:"F"}} <span>{{object.pub_date|date:"j, Y"}}</span></time>
- <span class="hide" itemprop="author" itemscope itemtype="http://schema.org/Person">by <a class="p-author h-card" href="/about"><span itemprop="name">Scott Gilbertson</span></a></span>
+ <h3 class="post-location">Filed Under: <a href="/guides/">Guides</a>, {% for topic in object.topics.all %}<a href="/guides/topic/{{topic.slug}}">{{topic}}</a>{%endfor%}</h3>
+ <time class="dt-published published dt-updated post-date" datetime="{{object.pub_date|date:'c'}}" itemprop="datePublished">Last Updated: {{object.last_updated|date:"F"}} <span>{{object.last_updated|date:"j, Y"}}</span></time>
</div>
</header>
<div id="article" class="e-content entry-content post--body post--body--{% with object.template_name as t %}{%if t == 0 or t == 2 %}single{%endif%}{%if t == 1 or t == 3 %}double{%endif%}{%endwith%} post-guide" itemprop="articleBody">