diff options
author | luxagraf <sng@luxagraf.net> | 2019-03-03 15:35:50 -0600 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2019-03-03 15:35:50 -0600 |
commit | 742820a0f6ad0c8e05d127d48b3724ebef1b702a (patch) | |
tree | 5eeab9df03afea7569463e5f7e465412e19a5d06 | |
parent | a7d51bb569ce2c3ff0830e4cd2a1369dd75dd05f (diff) |
migrated essays to new field_notes
-rw-r--r-- | app/essays/migrations/0006_auto_20190303_1625.py | 18 | ||||
-rw-r--r-- | app/essays/models.py | 4 | ||||
-rw-r--r-- | design/templates/fieldnotes/fieldnote_detail.html | 4 |
3 files changed, 22 insertions, 4 deletions
diff --git a/app/essays/migrations/0006_auto_20190303_1625.py b/app/essays/migrations/0006_auto_20190303_1625.py new file mode 100644 index 0000000..dde70fd --- /dev/null +++ b/app/essays/migrations/0006_auto_20190303_1625.py @@ -0,0 +1,18 @@ +# Generated by Django 2.1.7 on 2019-03-03 16:25 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('essays', '0005_auto_20190208_0946'), + ] + + operations = [ + migrations.AlterField( + model_name='essay', + name='field_notes', + field=models.ManyToManyField(blank=True, to='fieldnotes.FieldNote'), + ), + ] diff --git a/app/essays/models.py b/app/essays/models.py index 32ed053..5a29667 100644 --- a/app/essays/models.py +++ b/app/essays/models.py @@ -8,7 +8,7 @@ from taggit.managers import TaggableManager from taxonomy.models import TaggedItems from utils.util import render_images, markdown_to_html -from sketches.models import Sketch +from fieldnotes.models import FieldNote from books.models import Book from photos.models import LuxImage @@ -43,7 +43,7 @@ class Essay(models.Model): originally_published_by_url = models.CharField(max_length=400, blank=True) featured_image = models.ForeignKey(LuxImage, on_delete=models.CASCADE, null=True, blank=True) has_video = models.BooleanField(blank=True, default=False) - field_notes = models.ManyToManyField(Sketch, blank=True) + field_notes = models.ManyToManyField(FieldNote, blank=True) books = models.ManyToManyField(Book, blank=True) afterword = models.TextField(blank=True) afterword_html = models.TextField(blank=True) diff --git a/design/templates/fieldnotes/fieldnote_detail.html b/design/templates/fieldnotes/fieldnote_detail.html index fb5e9e4..e858277 100644 --- a/design/templates/fieldnotes/fieldnote_detail.html +++ b/design/templates/fieldnotes/fieldnote_detail.html @@ -27,8 +27,8 @@ <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> {% if object.subtitle %}<h2 class="post-subtitle">{{object.subtitle|smartypants|safe}}</h2>{%endif%} <aside class="p-location h-adr adr post-location" itemprop="contentLocation" itemscope itemtype="http://schema.org/Place"> - <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.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> - {% with object.get_template_name_display as t %}{%if t == "single" or t == "single-dark" %} – <a href="" onclick="showMap({{object.latitude}}, {{object.longitude}}, { type:'point', lat:'{{object.latitude}}', lon:'{{object.longitude}}'}); return false;" title="see a map">Map</a>{%endif%}{%endwith%} + <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> + – <a href="" onclick="showMap({{object.latitude}}, {{object.longitude}}, { type:'point', lat:'{{object.latitude}}', lon:'{{object.longitude}}'}); return false;" title="see a map">Map</a> </aside> <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> |