Thumbnail products

This commit is contained in:
nikolark committed 2015-11-29 17:00:43 +01:00
1 parent 31cffdb24b
commit 6560d3e89b
3 files changed
+12 -3

No files matched your search

+8
View File
@@ -86,6 +86,7 @@ INSTALLED_APPS = (
'bootstrapform', 'bootstrapform',
'django_extensions', 'django_extensions',
'rest_framework', 'rest_framework',
'easy_thumbnails',
) )
LOCAL_APPS = ( LOCAL_APPS = (
'main', 'main',
@@ -100,6 +101,13 @@ SESSION_EXPIRE_AT_BROWSER_CLOSE = True
BBS_SALDO_MAX = 600 BBS_SALDO_MAX = 600
BBS_LIMIT_DEPOSITS = False BBS_LIMIT_DEPOSITS = False
# Thumbnails
THUMBNAIL_ALIASES = {
'': {
'product': {'size': (64, 64), 'crop': True},
},
}
try: try:
from .local_settings import * from .local_settings import *
except ImportError: except ImportError:
+2 -1
View File
@@ -2,8 +2,9 @@ Django>=1.8,<1.9
django-bootstrap-form==3.1 django-bootstrap-form==3.1
django-extensions==1.5.9 django-extensions==1.5.9
django-widget-tweaks==1.3 django-widget-tweaks==1.3
easy-thumbnails==2.2.1
facebook-sdk==0.4.0 facebook-sdk==0.4.0
gunicorn==19.3.0 gunicorn==19.3.0
mysqlclient==1.3.6 mysqlclient==1.3.6
djangorestframework==3.3.1 djangorestframework==3.3.1
Pillow==3.0.0 Pillow==3.0.0
+2 -2
View File
@@ -1,5 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load staticfiles %} {% load staticfiles thumbnail %}
{% block active_register %}active{% endblock %} {% block active_register %}active{% endblock %}
{% block content %} {% block content %}
@@ -78,7 +78,7 @@
<input type="hidden" name="form-{{ forloop.counter0 }}-unit_price_ext" value="{{product.sale_price_ext }}" /> <input type="hidden" name="form-{{ forloop.counter0 }}-unit_price_ext" value="{{product.sale_price_ext }}" />
<span class="qty">0</span> <span class="qty">0</span>
{% if product.image %} {% if product.image %}
<img class="product" src="{{ product.image.url }}" /><br /> <img class="product" src="{{ product.image|thumbnail_url:'product' }}" /><br />
{% else %} {% else %}
<img class="product" src="{% static "dist/images/product.png" %}" /><br /> <img class="product" src="{% static "dist/images/product.png" %}" /><br />
{% endif %} {% endif %}