diff options
Diffstat (limited to 'app/posts')
-rw-r--r-- | app/posts/admin.py | 3 | ||||
-rw-r--r-- | app/posts/migrations/0001_initial.py | 3 | ||||
-rw-r--r-- | app/posts/migrations/0003_auto_20190918_1230.py | 2 | ||||
-rw-r--r-- | app/posts/migrations/0004_auto_20190918_1241.py | 2 | ||||
-rw-r--r-- | app/posts/models.py | 4 | ||||
-rw-r--r-- | app/posts/templates/posts/jrnl_detail.html | 4 |
6 files changed, 6 insertions, 12 deletions
diff --git a/app/posts/admin.py b/app/posts/admin.py index 9031dd5..7819ac5 100644 --- a/app/posts/admin.py +++ b/app/posts/admin.py @@ -6,8 +6,7 @@ from django.contrib.contenttypes.admin import GenericStackedInline from utils.widgets import AdminImageWidget, LGEntryForm from .models import Post -from photos.forms import GalleryForm -from photos.models import LuxImage +from media.models import LuxImage from utils.util import get_latlon diff --git a/app/posts/migrations/0001_initial.py b/app/posts/migrations/0001_initial.py index 3c36ee9..1c878b7 100644 --- a/app/posts/migrations/0001_initial.py +++ b/app/posts/migrations/0001_initial.py @@ -15,7 +15,6 @@ class Migration(migrations.Migration): ('normalize', '__first__'), ('taxonomy', '0001_initial'), ('locations', '0018_auto_20190414_2124'), - ('photos', '0019_auto_20190704_0903'), ] operations = [ @@ -47,7 +46,7 @@ class Migration(migrations.Migration): ('originally_published_by_url', models.CharField(blank=True, max_length=400)), ('books', models.ManyToManyField(blank=True, to='books.Book')), ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='taxonomy.Category')), - ('featured_image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='photos.LuxImage')), + ('featured_image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='media.LuxImage')), ('field_notes', models.ManyToManyField(blank=True, to='fieldnotes.FieldNote')), ('jrnl', models.ManyToManyField(blank=True, to='jrnl.Entry')), ('location', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='locations.Location')), diff --git a/app/posts/migrations/0003_auto_20190918_1230.py b/app/posts/migrations/0003_auto_20190918_1230.py index d7c89a8..04fabb0 100644 --- a/app/posts/migrations/0003_auto_20190918_1230.py +++ b/app/posts/migrations/0003_auto_20190918_1230.py @@ -24,7 +24,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='post', name='featured_image', - field=models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to='photos.LuxImage'), + field=models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to='media.LuxImage'), ), migrations.AlterField( model_name='post', diff --git a/app/posts/migrations/0004_auto_20190918_1241.py b/app/posts/migrations/0004_auto_20190918_1241.py index da829ad..726446c 100644 --- a/app/posts/migrations/0004_auto_20190918_1241.py +++ b/app/posts/migrations/0004_auto_20190918_1241.py @@ -14,6 +14,6 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='post', name='featured_image', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='photos.LuxImage'), + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='media.LuxImage'), ), ] diff --git a/app/posts/models.py b/app/posts/models.py index 25dfe10..b64dc53 100644 --- a/app/posts/models.py +++ b/app/posts/models.py @@ -25,7 +25,7 @@ from django_comments.moderation import CommentModerator, moderator from taggit.managers import TaggableManager from normalize.models import RelatedPost -from photos.models import LuxImage, LuxImageSize +from media.models import LuxImage, LuxImageSize from locations.models import Location from books.models import Book #from fieldnotes.models import FieldNote @@ -119,7 +119,7 @@ class Post(models.Model): return self.enable_comments and datetime.datetime.today() - datetime.timedelta(30) <= self.pub_date def get_featured_image_thumb(self): - return self.featured_image.get_image_by_size("tn") + return self.featured_image.get_image_url_by_size("thumbnail") def get_content_type(self): return ContentType.objects.get(app_label="posts", model="post") diff --git a/app/posts/templates/posts/jrnl_detail.html b/app/posts/templates/posts/jrnl_detail.html index 8a75f25..9480732 100644 --- a/app/posts/templates/posts/jrnl_detail.html +++ b/app/posts/templates/posts/jrnl_detail.html @@ -126,10 +126,6 @@ class="detail {%if t == 1 or t == 3 or t == 5 %}double{%else%}single{%endif%}{%i <div class="post-image post-mini-image"> {% if object.featured_image %} {% include "lib/img_archive.html" with image=object.featured_image nolightbox=True %} - {% elif object.image %} - {% include "lib/img_archive.html" with image=object.image nolightbox=True %} - {% else %} - <img src="{{object.get_image_url}}" alt="{{ object.title }}" class="u-photo post-image" itemprop="image" />{%endif%} </div> <h4 class="p-name entry-title post-title" 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> |