added thumbnails for members

This commit is contained in:
2020-08-16 08:00:43 +00:00
parent 7fa09b1351
commit 9b150028d2
4 changed files with 14 additions and 4 deletions

View File

@@ -60,6 +60,7 @@ INSTALLED_APPS = [
'taggit',
'ckeditor',
'ckeditor_uploader',
'easy_thumbnails',
'rest_framework',
'django_filters',
'django_static_jquery_ui',
@@ -180,3 +181,9 @@ CKEDITOR_CONFIGS = {
],
}
}
THUMBNAIL_ALIASES = {
'': {
'avatar': {'size': (50, 50), 'crop': True},
'thumb': {'size': (150, 150), 'crop': True},
},
}

View File

@@ -4,4 +4,5 @@ django-ckeditor
Pillow
djangorestframework
django-static-jquery-ui
docutils
docutils
easy-thumbnails

View File

@@ -1,8 +1,8 @@
{# only thumb and name of member #}
{% load thumbnail %}
<a class="thumbnail member-thumb" style="width:150px;height:150px">
{% if member.image %}<img src="{{member.image.url}}" />{% endif %}
{% if member.image %}<img src="{{member.image | thumbnail_url:'thumb'}}" />{% endif %}
<div class="thumb-layer"><div><h1>{{member.nickname}}</h1> <p>{{member.firstname}} {{member.surname}}</p></div></div>
</a>

View File

@@ -1,9 +1,10 @@
{# This template shows one member and all the details (that are ment for public) including a list of current jobs #}
{% load thumbnail %}
<div class="media-object">
<div class="media-object-section">
<div class="thumbnail">
<img src= "{{member.image.url}}" style="width:150px;">
</div>
</div>
<div class="media-object-section main-section">
@@ -15,3 +16,4 @@ Beschreibung: {{member.description|safe}} </br>
</p>
</div>
</div>