Fixes #3506: active picture links.
authorRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Thu, 16 Oct 2014 12:06:19 +0000 (14:06 +0200)
committerRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Thu, 16 Oct 2014 12:06:19 +0000 (14:06 +0200)
apps/picture/templates/picture/picture_wide.html
apps/picture/templatetags/picture_tags.py

index cb05889..920a9c0 100644 (file)
@@ -6,8 +6,9 @@
 {% block box-class %}book-wide-box{% endblock %}
 
 {% block picture-view %}
 {% block box-class %}book-wide-box{% endblock %}
 
 {% block picture-view %}
+<a href="{{ main_link }}">
 {% thumbnail picture.image_file "535" upscale="false" as thumb %}
 {% thumbnail picture.image_file "535" upscale="false" as thumb %}
-<img class="cover" src="{{thumb.url}}"/>
+<img class="cover" src="{{thumb.url}}"/></a>
 {% endthumbnail %}
 {% endblock %}
 
 {% endthumbnail %}
 {% endblock %}
 
index 7e464fa..76ae1de 100644 (file)
@@ -3,6 +3,7 @@
 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
 #
 from django import template
 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
 #
 from django import template
+from django.core.urlresolvers import reverse
 from catalogue.utils import split_tags
 from ..engine import CustomCroppingEngine
 import sorl.thumbnail.default
 from catalogue.utils import split_tags
 from ..engine import CustomCroppingEngine
 import sorl.thumbnail.default
@@ -16,7 +17,7 @@ cropper = CustomCroppingEngine()
 def picture_wide(context, picture):
     context.update({
         'picture': picture,
 def picture_wide(context, picture):
     context.update({
         'picture': picture,
-        'main_link': picture.get_absolute_url(),
+        'main_link': reverse('picture_viewer', args=[picture.slug]),
         'request': context.get('request'),
         'tags': split_tags(picture.tags),
         })
         'request': context.get('request'),
         'tags': split_tags(picture.tags),
         })