include more metadata in non-js page, fixes #1876

This commit is contained in:
j 2014-01-11 09:51:03 +00:00
parent 303662fb27
commit d4ff2b60ef
2 changed files with 29 additions and 5 deletions

View file

@ -1221,16 +1221,40 @@ def item(request, id):
keys = [
'year',
'director',
'writer',
'producer',
'cinematographer',
'editor',
'actor',
'topic',
]
if not settings.USE_IMDB:
keys += [
'summary'
]
keys += [
'duration'
'aspectratio'
'hue',
'saturation',
'lightness',
'volume',
'numberofcuts',
]
data = []
for key in keys:
value = item.get(key)
for id in keys:
value = item.get(id)
key = utils.get_by_id(settings.CONFIG['itemKeys'], id)
if value:
title = key['title'] if key else id.capitalize()
if isinstance(value, list):
value = value = u', '.join([unicode(v) for v in value])
data.append({'key': key.capitalize(), 'value': value})
elif key and key.get('type') == 'float':
value = '%0.3f' % value
elif key and key.get('type') == 'time':
value = ox.format_duration(value * 1000)
data.append({'key': id, 'title': title, 'value': value})
clips = []
clip = {'in': 0, 'annotations': []}
#logged in users should have javascript. not adding annotations makes load faster

View file

@ -37,7 +37,7 @@
<div style="padding: 16px 0 8px 0; font-weight: bold; font-size: 13px">{{title}}</div>
{% for i in data %}
<div style="text-align: justify">
<b>{{i.key}}</b>: {{i.value|safe}}
<b>{{i.title}}</b>: {{i.value|safe}}
</div>
{% endfor %}
{% for c in clips %}