'telemeta',
'jsonrpc',
'south',
+ 'sorl.thumbnail',
)
TEMPLATE_CONTEXT_PROCESSORS = (
TELEMETA_DESCRIPTION = "Telemeta TEST sandbox"
TELEMETA_GMAP_KEY = 'ABQIAAAArg7eSfnfTkBRma8glnGrlxRVbMrhnNNvToCbZQtWdaMbZTA_3RRGObu5PDoiBImgalVnnLU2yN4RMA'
TELEMETA_CACHE_DIR = MEDIA_ROOT + 'cache'
-TELEMETA_EXPORT_CACHE_DIR = TELEMETA_CACHE_DIR + "/export"
+TELEMETA_EXPORT_CACHE_DIR = MEDIA_ROOT + 'export'
TELEMETA_DATA_CACHE_DIR = TELEMETA_CACHE_DIR + "/data"
TELEMETA_DOWNLOAD_ENABLED = True
'django-pagination',
'django-postman',
'django-socialregistration',
+ 'sorl-thumbnail',
],
platforms=['OS Independent'],
license='CeCILL v2',
{% load i18n %}
{% load telemeta_utils %}
+{% load thumbnail %}
<div>
<h4><a href="#">{% trans "Related media" %}</a></h4>
<td style="padding-bottom: 1em;">
{% if media.is_image %}
- {% if media.url %}
- <a href="{{ media.url }}">
- <img src="{{ media.url }}" style="max-width: 420px; max-height: 200px;" /></a>
+ {% if media.file %}
+ <a href="{% url telemeta-resource-related type resource.code media.id %}">
+ {% thumbnail media.file "420" as im %}
+ <img src="{{ im.url }}" style="max-width: 420px; max-height: 200px;" />
+ {% endthumbnail %}
+ </a>
{% else %}
- <a href="{% url telemeta-resource-related type resource.code media.id %}">
- <img src="{% url telemeta-resource-related type resource.code media.id %}" style="max-width: 420px; max-height: 200px;" /></a>
- {% endif %}
+ <a href="{{ media.url }}">
+ {% thumbnail media.url "420" as im %}
+ <img src="{{ im.url }}" style="max-width: 420px; max-height: 200px;" />
+ {% endthumbnail %}
+ </a>
+ {% endif %}
{% else %}
{% if media.url %}
{% if "youtu" in media.url %}
<dt>{% trans "Email" %}</dt><dd>{{ usr.email }}</dd>
<dt>{% trans "Institution" %}</dt><dd>{% if profile %}{{ profile.institution }}{% endif %}</dd>
+ <dt>{% trans "Department" %}</dt><dd>{% if profile %}{{ profile.department }}{% endif %}</dd>
<dt>{% trans "Function" %}</dt><dd>{% if profile %}{{ profile.function }}{% endif %}</dd>
<dt>{% trans "Attachment" %}</dt><dd>{% if profile %}{{ profile.attachment }}{% endif %}</dd>
<dt>{% trans "Address" %}</dt><dd>{% if profile %}{{ profile.address }}{% endif %}</dd>
# Guillaume Pellerin <yomguy@parisson.com>
from django.conf.urls.defaults import *
+from django.conf import settings
from django.views.generic.simple import redirect_to
from telemeta.models import MediaItem, MediaCollection, MediaItemMarker, MediaCorpus, MediaFonds
from telemeta.views.base import GeneralView, AdminView, CollectionView, ItemView, \
# RSS feeds
url(r'^rss/$', LastestRevisionsFeed(), name="telemeta-rss"),
+ # Static media
+ # FIXME:need to move export dir from the cache
+ url(r'^media/cache/(?P<path>.*)$', 'django.views.static.serve', {
+ 'document_root': settings.TELEMETA_CACHE_DIR,}),
)