X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/f3e8dfa015744bd72796fdd8eff0d81f863cdc46..a3b153ea6e30da275edf3e34b8d2f8ca1bb436cc:/src/picture/templatetags/picture_tags.py diff --git a/src/picture/templatetags/picture_tags.py b/src/picture/templatetags/picture_tags.py index 0542fa33c..28660b1f9 100644 --- a/src/picture/templatetags/picture_tags.py +++ b/src/picture/templatetags/picture_tags.py @@ -17,17 +17,6 @@ register = template.Library() cropper = CustomCroppingEngine() -@register.inclusion_tag('picture/picture_wide.html', takes_context=True) -def picture_wide(context, picture): - context.update({ - 'picture': picture, - 'main_link': reverse('picture_viewer', args=[picture.slug]), - 'request': context.get('request'), - 'tags': split_tags(picture.tags), - }) - return context - - @register.simple_tag() def area_thumbnail_url(area, geometry): def to_square(coords): @@ -46,7 +35,7 @@ def area_thumbnail_url(area, geometry): # what to do about this? _engine = sorl.thumbnail.default.engine sorl.thumbnail.default.engine = cropper - coords = to_square(area.area) + coords = to_square(area.get_area_json()) try: th = sorl.thumbnail.default.backend.get_thumbnail( @@ -65,9 +54,7 @@ def area_thumbnail_url(area, geometry): @register.simple_tag -def picture_random_picture(exclude_ids, unless=None): - if unless: - return None +def picture_random_picture(exclude_ids): queryset = Picture.objects.exclude(pk__in=exclude_ids).exclude(image_file='') count = queryset.count() if count: