From 6eeb867f80cf7a1c8e4aea5c3e36e7a79cb11462 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 16 Jan 2014 13:11:19 +0000 Subject: [PATCH] non-js item content --- pandora/item/views.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pandora/item/views.py b/pandora/item/views.py index 9958d7117..f7701be9f 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -1262,22 +1262,33 @@ def item(request, id): clip = {'in': 0, 'annotations': []} #logged in users should have javascript. not adding annotations makes load faster if not settings.USE_IMDB and request.user.is_anonymous(): - for a in item.annotations.filter( - layer__in=models.Annotation.public_layers()).order_by('start', 'end', 'sortvalue'): + for a in item.annotations.exclude( + layer='subtitles' + ).exclude( + value='' + ).filter( + layer__in=models.Annotation.public_layers() + ).order_by('start', 'end', 'sortvalue'): if clip['in'] < a.start: if clip['annotations']: clip['annotations'] = '
\n'.join(clip['annotations']) clips.append(clip) clip = {'in': a.start, 'annotations': []} clip['annotations'].append(a.value) + if clip['annotations']: + clip['annotations'] = '
\n'.join(clip['annotations']) + clips.append(clip) head_title = u'%s – %s' % (settings.SITENAME, item.get('title', '')) + title = item.get('title', '') if item.get('director'): head_title += u' (%s)' % u', '.join(item.get('director', [])) if item.get('year'): head_title += u' %s' % item.get('year') + title += u' (%s)' % item.get('year') if view: head_title += u' – %s' % view head_title = ox.decode_html(head_title) + title = ox.decode_html(title) ctx = { 'current_url': request.build_absolute_uri(request.get_full_path()), 'base_url': request.build_absolute_uri('/'), @@ -1287,9 +1298,10 @@ def item(request, id): 'data': data, 'clips': clips, 'icon': settings.CONFIG['user']['ui']['icons'] == 'frames' and 'icon' or 'poster', - 'title': ox.decode_html(item.get('title', '')), + 'title': title, 'head_title': head_title, - 'description': item.get_item_description() + 'description': item.get_item_description(), + 'description_html': item.get_item_description_html() } if not settings.USE_IMDB: value = item.get('topic' in keys and 'topic' or 'keywords')