Thumbnail products
This commit is contained in:
1 parent
31cffdb24b
commit
6560d3e89b
3 files changed
+11
-2
No files matched your search
@@ -86,6 +86,7 @@ INSTALLED_APPS = (
|
||||
'bootstrapform',
|
||||
'django_extensions',
|
||||
'rest_framework',
|
||||
'easy_thumbnails',
|
||||
)
|
||||
LOCAL_APPS = (
|
||||
'main',
|
||||
@@ -100,6 +101,13 @@ SESSION_EXPIRE_AT_BROWSER_CLOSE = True
|
||||
BBS_SALDO_MAX = 600
|
||||
BBS_LIMIT_DEPOSITS = False
|
||||
|
||||
# Thumbnails
|
||||
THUMBNAIL_ALIASES = {
|
||||
'': {
|
||||
'product': {'size': (64, 64), 'crop': True},
|
||||
},
|
||||
}
|
||||
|
||||
try:
|
||||
from .local_settings import *
|
||||
except ImportError:
|
||||
|
||||
@@ -2,6 +2,7 @@ Django>=1.8,<1.9
|
||||
django-bootstrap-form==3.1
|
||||
django-extensions==1.5.9
|
||||
django-widget-tweaks==1.3
|
||||
easy-thumbnails==2.2.1
|
||||
facebook-sdk==0.4.0
|
||||
gunicorn==19.3.0
|
||||
mysqlclient==1.3.6
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{% extends "base.html" %}
|
||||
{% load staticfiles %}
|
||||
{% load staticfiles thumbnail %}
|
||||
{% block active_register %}active{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
@@ -78,7 +78,7 @@
|
||||
<input type="hidden" name="form-{{ forloop.counter0 }}-unit_price_ext" value="{{product.sale_price_ext }}" />
|
||||
<span class="qty">0</span>
|
||||
{% if product.image %}
|
||||
<img class="product" src="{{ product.image.url }}" /><br />
|
||||
<img class="product" src="{{ product.image|thumbnail_url:'product' }}" /><br />
|
||||
{% else %}
|
||||
<img class="product" src="{% static "dist/images/product.png" %}" /><br />
|
||||
{% endif %}
|
||||
|
||||
Reference in new issue
Block a user