Commit f4731c8b authored by gijs's avatar gijs

Moving filer image to main image

parent c2b7ff0c
......@@ -138,14 +138,14 @@ class EventTypeAdmin(admin.ModelAdmin):
class ImageAdmin(admin.ModelAdmin):
fieldsets = (
(None, {
'fields': ('image', 'filerImage')
'fields': ('image', )
}),
('Dutch', {
'fields': ('title_nl', 'tagline_nl', 'credit_nl')
}),
('English', {
'fields': ('title_en', 'tagline_en', 'credit_en')
})
}),
)
# inlines = (ImageCreditInline,)
......
# Generated by Django 2.1.1 on 2019-03-24 07:44
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import filer.fields.image
class Migration(migrations.Migration):
dependencies = [
('contour', '0048_image_filerimage'),
]
operations = [
migrations.RemoveField(
model_name='image',
name='image',
),
migrations.AddField(
model_name='image',
name='oldImage',
field=models.ImageField(blank=True, null=True, upload_to='images'),
),
migrations.AlterField(
model_name='image',
name='filerImage',
field=filer.fields.image.FilerImageField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.FILER_IMAGE_MODEL),
),
]
# Generated by Django 2.1.1 on 2019-03-24 07:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('contour', '0049_auto_20190324_0744'),
]
operations = [
migrations.RenameField(
model_name='image',
old_name='filerImage',
new_name='image',
),
]
......@@ -40,8 +40,8 @@ class Venue(models.Model):
class Image(models.Model):
published = models.BooleanField(default=False)
image = models.ImageField(upload_to="images")
filerImage = FilerImageField(null=True, blank=True, on_delete=models.CASCADE)
oldImage = models.ImageField(upload_to="images", null=True, blank=True)
image = FilerImageField(null=True, blank=True, on_delete=models.PROTECT)
title_nl = models.CharField(max_length=255)
tagline_nl = models.CharField(max_length=255, null=True, blank=True)
title_en = models.CharField(max_length=255, verbose_name="Title (English)", null=True, blank=True)
......
......@@ -145,7 +145,7 @@
<dd>
{% for key, image in images %}
<figure class="documentation-image-thumbnail" data-image-index="{{ key }}" {% if forloop.first %}data-active="true"{% endif %} data-target-panel="image-{{ key }}">
<img src="{% thumbnail image.image 100x50 crop %}">
<img src="{% thumbnail image.image 100x50 crop crop upscale subject_location=image.image.subject_location %}">
</figure>
{% endfor %}
</dd>
......@@ -173,7 +173,7 @@
<dd>
{% for key, image in documentation_images %}
<figure class="documentation-image-thumbnail" data-target-panel="image-{{ key }}" data-image-index="{{ key }}">
<img src="{% thumbnail image.image 100x50 crop %}" />
<img src="{% thumbnail image.image 100x50 crop upscale subject_location=image.image.subject_location %}" />
</figure>
{% endfor %}
</dd>
......
......@@ -100,7 +100,7 @@
{% if images %}
{% for key, image in images %}
<figure class="image-thumbnail" data-target-panel="image-{{ key }}" data-image-index="{{ key }}">
<img src="{% thumbnail image.image 200x50 %}" />
<img src="{% thumbnail image.image 200x50 crop upscale subject_location=image.image.subject_location %}" />
</figure>
{% endfor %}
{% endif %}
......
......@@ -12,7 +12,7 @@
{% with event.project|cover_image as image %}
<figure class="preview">
<a href="{% url 'contour:event' event.pk %}">
<img src="{% thumbnail image.image 500x250 crop %}">
<img src="{% thumbnail image.image 500x250 crop upscale subject_location=image.image.subject_location %}">
</a>
</figure>
{% endwith %}
......
......@@ -64,7 +64,7 @@
{% with event.project|cover_image as image %}
<figure class="preview">
<a href="{% url 'contour:event' event.pk %}">
<img src="{% thumbnail image.image 500x250 crop %}">
<img src="{% thumbnail image.image 500x250 crop upscale subject_location=image.image.subject_location %}">
</a>
</figure>
{% endwith %}
......
......@@ -173,4 +173,12 @@ LOCALE_PATHS = [
os.path.join(BASE_DIR, 'contour/locale')
]
THUMBNAIL_HIGH_RESOLUTION = True
\ No newline at end of file
THUMBNAIL_HIGH_RESOLUTION = True
THUMBNAIL_PROCESSORS = (
'easy_thumbnails.processors.colorspace',
'easy_thumbnails.processors.autocrop',
#'easy_thumbnails.processors.scale_and_crop',
'filer.thumbnail_processors.scale_and_crop_with_subject_location',
'easy_thumbnails.processors.filters',
)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment