diff options
-rw-r--r-- | app/posts/models.py | 2 | ||||
-rw-r--r-- | app/posts/templates/posts/film_detail.html | 90 | ||||
-rw-r--r-- | app/posts/templates/posts/film_list.html | 22 | ||||
-rw-r--r-- | templates/base.html | 1 |
4 files changed, 84 insertions, 31 deletions
diff --git a/app/posts/models.py b/app/posts/models.py index 1dafa1a..1510820 100644 --- a/app/posts/models.py +++ b/app/posts/models.py @@ -105,7 +105,7 @@ class Post(models.Model): def get_absolute_url(self): if self.post_type == PostType.FILM: - return reverse('essays:detail', kwargs={"slug": self.slug}) + return reverse('film:detail', kwargs={"slug": self.slug}) if self.post_type == PostType.ESSAY: return reverse('essays:detail', kwargs={"slug": self.slug}) if self.post_type == PostType.RANGE: diff --git a/app/posts/templates/posts/film_detail.html b/app/posts/templates/posts/film_detail.html index 42d06a2..b088c56 100644 --- a/app/posts/templates/posts/film_detail.html +++ b/app/posts/templates/posts/film_detail.html @@ -1,15 +1,29 @@ {% 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 %} +{% load get_image_by_size %} +{%block htmlclass%}{%endblock%} +{% block sitename %} +<head itemscope itemtype="http://schema.org/WebSite"> + <title itemprop='name'>{{object.title|safe}} by Scott Gilbertson</title> + <link rel="canonical" href="https://luxagraf.net{{object.get_absolute_url}}">{%endblock%} -{% block metadescription %}{% autoescape on %}{{object.meta_description|striptags|safe}}{% endautoescape %}{% endblock %}{%block extrahead%} + {%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> +{%block bodyid%}id="home" class="friends"{%endblock%} +{% block breadcrumbs %}<nav class="breadcrumbs" itemscope itemtype="http://schema.org/BreadcrumbList"> + <span class="nav-item" itemprop="item"> + <a href="/" itemprop="name">Home</a> + <meta itemprop="position" content="1" /> + </span> + <span class="nav-item" itemprop="item"> + <a href="/film/" itemprop="name">Films</a> + <meta itemprop="position" content="2" /> + </span> + </nav> +{% 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> @@ -89,27 +103,43 @@ {% endfor %}</div> </div> </div>{%endif%} - {% comment %} <div class="mailing-list--wrapper"> - <h5>If you enjoyed this, you should join the mailing list…</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> + + {% with object.get_next_published as next %} + {% with object.get_previous_published as prev %} + <nav class="page-navigation"> + <div>{% if prev%} + <span class="label">Previous:</span> + <a href="{{ prev.get_absolute_url }}" rel="prev" title=" {{prev.title}}">{{prev.title|safe}}</a> + </div>{%endif%}{% if next %} + <div> + <span class="label">Next:</span> + <a href="{{ next.get_absolute_url }}" rel="next" title=" {{next.title}}">{{next.title|safe}}</a> + </div>{%endif%} + </nav>{%endwith%}{%endwith%} + {% 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="http://schema.org/BlogPosting"> + <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="http://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="http://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' %}–{%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%} + </main> {% endblock %} -{% block js %} -<script src="/media/js/detail.min.js"></script> -{{ block.super }} -{%endblock%} diff --git a/app/posts/templates/posts/film_list.html b/app/posts/templates/posts/film_list.html index 7a68058..7107d47 100644 --- a/app/posts/templates/posts/film_list.html +++ b/app/posts/templates/posts/film_list.html @@ -2,6 +2,25 @@ {% load typogrify_tags %} {% block pagetitle %}Notes and Essays On Living - By Scott Gilbertson {% endblock %} {% block metadescription %}Essays and stories on self-reliance, DIY, repair, tools, birding, walking, living well, and other ephemera.{% endblock %} +{% block extrahead %} +<style> +@media screen and (min-width: 736px) { + .square-image-wrapper{ + width: 140px; + height: 93px; + float: left; + border: 3px solid #666; + margin-top: 6px; + margin-right: 10px; + } +} +@media screen and (min-width: 1024px) { + .square-image-wrapper{ + margin-left: -160px; + } +} +</style> +{% endblock%} {% block breadcrumbs %}{% if breadcrumbs %}{% include "lib/breadcrumbs.html" with breadcrumbs=breadcrumbs %}{%endif%}{% endblock %} {% block primary %}<main class="archive-wrapper"> <div class="archive-intro"> @@ -11,6 +30,9 @@ </div> <ul class="archive-list">{% for object in object_list %} <li class="h-entry hentry archive-list-card archive-list-card-sm" itemscope itemType="http://schema.org/Article"> + <a href="{{object.get_absolute_url}}" title="{{object.title}}" class="square-image-wrapper"> + {% include "lib/img_archive.html" with image=object.featured_image %} + </a> <span class="date dt-published card-smcaps">{{object.pub_date|date:"F Y"}}</span> <a href="{{object.get_absolute_url}}"> <h2 class="card-hed">{{object.title|safe|smartypants|widont}}</h2> diff --git a/templates/base.html b/templates/base.html index 11c7d7b..86e3d67 100644 --- a/templates/base.html +++ b/templates/base.html @@ -29,6 +29,7 @@ </div> <nav> <a class="nav-item smcaps" href="{% url "jrnl:list" %}" title="Stories of life on the road.">Jrnl</a> + <a class="nav-item smcaps" href="/films/" title="Films">Films</a> <a class="nav-item smcaps" href="/essays/" title="Essays">Essays</a> <a class="nav-item smcaps" href="/friends/" title="Join the 'friends of a long year' newsletter">Friends</a> {%comment%}<a class="nav-item smcaps" href="/range/" title="Join the 'Range' newsletter">Range</a> {%endcomment%} |