summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/posts/models.py2
-rw-r--r--app/posts/templates/posts/review_detail.html115
2 files changed, 117 insertions, 0 deletions
diff --git a/app/posts/models.py b/app/posts/models.py
index 2726949..cf7212b 100644
--- a/app/posts/models.py
+++ b/app/posts/models.py
@@ -138,6 +138,8 @@ class Post(models.Model):
return reverse('essays:detail', kwargs={"slug": self.slug})
if self.post_type == PostType.SRC:
return reverse('src:detail', kwargs={"slug": self.slug})
+ if self.post_type == PostType.REVIEW:
+ return reverse('reviews:review-detail', kwargs={"slug": self.slug})
if self.post_type == PostType.FIELD_NOTE:
return reverse('fieldnote:detail', kwargs={"year": self.pub_date.year, "month": self.pub_date.strftime("%m"), "slug": self.slug})
if self.post_type == PostType.GUIDE:
diff --git a/app/posts/templates/posts/review_detail.html b/app/posts/templates/posts/review_detail.html
new file mode 100644
index 0000000..7380c7e
--- /dev/null
+++ b/app/posts/templates/posts/review_detail.html
@@ -0,0 +1,115 @@
+{% extends 'base.html' %}
+{% load typogrify_tags %}
+{% load comments %}
+{%block htmlclass%}class="detail single"{%endblock%}
+{% block pagetitle %}{{object.title|title|smartypants|safe}} - by Scott Gilbertson{% endblock %}
+
+{% block metadescription %}{% autoescape on %}{{object.meta_description|striptags|safe}}{% endautoescape %}{% endblock %}{%block extrahead%}
+ <link rel="canonical" href="https://luxagraf.net{{object.get_absolute_url}}" />
+{% if object.has_code %} <link rel="stylesheet" href="/media/src/solarized.css" type="text/css" media="screen"/>{%endif %}
+{%endblock%}
+{% block breadcrumbs %}{% include "lib/breadcrumbs.html" with breadcrumbs=breadcrumbs %}{% endblock %}
+{% block primary %}<main>
+ <article class="h-entry hentry entry-content content" itemscope itemType="http://schema.org/BlogPosting">
+ <header id="header" class="post-header">
+ <h1 class="p-name post-title" itemprop="headline">{{object.title|smartypants|safe}}</h1>
+ {% if object.subtitle %}<h2 class="post-subtitle">{{object.subtitle|smartypants|safe}}</h2>{%endif%}
+ <div class="post-dateline"><time class="dt-published published dt-updated post-date" style="display:inline" datetime="{{object.pub_date|date:'c'}}" itemprop="datePublished">{{object.pub_date|date:"F"}} <span>{{object.pub_date|date:"Y"}}</span></time> &ndash;
+ {% if object.location %}<div class="p-location h-adr adr post-location" style="display:inline" itemprop="contentLocation" itemscope itemtype="http://schema.org/Place">
+ <span 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>, <span class="p-region region">{{object.location.state_name|safe}}</span><span class="p-country-name" itemprop="addressCountry"></span>{%else%}
+ <span class="p-region" itemprop="addressRegion">{{object.location.name|smartypants|safe}}</span>, <span class="p-country-name country-name"><span itemprop="addressCountry">{{object.location.country_name|safe}}</span></span>{%endif%}
+ </span>
+ </div>{%endif%}
+ <div>Filed under: <a href="/essays/">{{object.get_post_topic_display}}</a></div>
+ {% if object.originally_published_by %}<h4 class="post-source">Originally Published By: <a href="{{object.originally_published_by_url}}" title="View {{object.title}} on {{object.originally_published_by}}">{{object.originally_published_by}}</a></h4>{%endif%}
+ <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>
+ </div>
+ </header>
+ <div class="e-content entry-content post-body" itemprop="articleBody">
+ {% if object.prologue_html %}<div class="post-afterward ">
+ {{object.prologue_html|smartypants|safe}}
+ </div><hr />{%endif%}
+ {{object.body_html|safe|smartypants}}
+ {% if object.epilogue_html %}<div class="post-afterward">
+ {{object.epilogue_html|smartypants|safe}}
+ </div>{%endif%}
+ </div>
+ {%if wildlife or object.field_notes.all or object.books.all %}<div class="entry-footer">{%if wildlife %}
+ <aside id="wildlife">
+ <h3>Fauna and Flora</h3>
+ {% regroup wildlife by ap.apclass.get_kind_display as wildlife_list %}
+ <ul>
+ {% for object_list in wildlife_list %}
+ <li class="grouper">{{object_list.grouper}}<ul>
+ {% for object in object_list.list %}
+ <li>{%if object.ap.body_markdown%}<a href="{% url 'sightings:detail' object.ap.slug %}">{{object}}</a>{%else%}{{object}}{%endif%} </li>
+ {% endfor %}</ul>
+ {% endfor %}</ul>
+ </aside>
+ {% endif %}{%if object.field_notes.all %}
+ <aside {% if wildlife %}class="margin-left-none" {%endif%}id="field_notes">
+ <h3>Field Notes</h3>
+ <ul>{% for obj in object.field_notes.all %}
+ <li><a href="{% url 'fieldnotes:detail' year=obj.pub_date.year month=obj.pub_date|date:"m" slug=obj.slug %}">{{obj}}</a></li>
+ {% endfor %}</ul>
+ </aside>{% endif %}
+ {%if object.books.all %}
+ <aside id="recommended-reading" {%if object.field_notes.all and wildlife %}class="rr-clear{%endif%}" >
+ <h3>Recommended Reading</h3>
+ <ul>{% for obj in object.books.all %}
+ <li><a href="{% url 'books:detail' slug=obj.slug %}"><img src="{{obj.get_small_image_url}}" /></a></li>
+ {% endfor %}</ul>
+ </aside>{% endif %}
+ </div>{%endif%}
+ </article>
+ </main>
+ {% if object.related.all %}<div class="article-afterward related">
+ <div class="related-bottom">
+ <h6 class="hedtinycaps">You might also enjoy</h6>
+ <div class="archive-grid-quad">{% for object in related %}
+ <div class="archive-grid-card archive-grid-card-simple" itemscope itemtype="https://schema.org/Article">
+ <a href="{{object.get_absolute_url}}" title="{{object.title}}">
+ <div class="card-image-tiny">
+ {% if object.featured_image %}
+ {% include "lib/img_archive.html" with image=object.featured_image nolightbox=True %}
+ {%endif%}
+ </div>
+ <h4 class="p-name card-hed" itemprop="headline">{% if object.title %}{{object.title|safe|smartypants|widont}}{% else %}{{object.common_name}}{%endif%}</h4>
+ <p class="p-author author hide" itemprop="author"><span class="byline-author" itemscope itemtype="https://schema.org/Person"><span itemprop="name">Scott Gilbertson</span></span></p>
+ <span class="card-smcaps">
+ {% if object.location %}<span class="p-location h-adr adr card-location" itemprop="contentLocation" itemscope itemtype="https://schema.org/Place">
+ {% if object.location.country_name == "United States" %}{{object.location.state_name}}{%else%}{{object.location.country_name}}{%endif%}
+ </span>{%endif%}
+ {% if object.location and object.model_name.model != 'page' %}&ndash;{%endif%}
+ {% if object.model_name.model != 'page' %}<time class="dt-published published dt-updated" datetime="{{object.pub_date|date:'c'}}"><span>{{object.pub_date|date:" Y"}}</span></time>{%endif%}
+ </span>
+ </a>
+ </div>
+ {% endfor %}</div>
+ </div>
+ </div>{%endif%}
+ {% comment %} <div class="mailing-list--wrapper">
+ <h5>If you enjoyed this, you should join the mailing&nbsp;list&hellip;</h5>
+ {% include 'mailing_list.html' %}
+ </div> {% endcomment %}
+ {% if object.enable_comments %}
+{% get_comment_count for object as comment_count %}
+{%if comment_count > 0 %}
+<div class="comment-wrapper">
+<p class="comments-header">{{comment_count}} Comment{{ comment_count|pluralize }}</p>
+{% render_comment_list for object %}
+{%endif%}
+<div class="comment-form-wrapper {%if comment_count > 0%}comment-form-border{%endif%}">
+{% render_comment_form for object %}
+</div>
+{% else %}
+<p class="comments--header" style="text-align: center">Sorry, comments have been disabled for this post.</p>
+</div>
+{%endif%}
+</div>
+{% endblock %}
+{% block js %}
+<script src="/media/js/detail.min.js"></script>
+{{ block.super }}
+{%endblock%}