From e851dcabfbb15461f996568c6e24ba8267cca893 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 16 Apr 2015 20:02:31 +0000 Subject: [PATCH] entities are not links --- pandora/annotation/models.py | 2 +- pandora/entity/models.py | 5 +++-- static/js/editor.js | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pandora/annotation/models.py b/pandora/annotation/models.py index f94788ecc..788cb1166 100644 --- a/pandora/annotation/models.py +++ b/pandora/annotation/models.py @@ -244,7 +244,7 @@ class Annotation(models.Model): try: entity = self.get_entity() j['entity'] = entity.json(user=user) - j['value'] = entity.html_link() + j['value'] = entity.annotation_value() except: j['entity'] = {} elif l['type'] == 'event': diff --git a/pandora/entity/models.py b/pandora/entity/models.py index 383b37d5a..3642561e4 100644 --- a/pandora/entity/models.py +++ b/pandora/entity/models.py @@ -159,8 +159,9 @@ class Entity(models.Model): response[key] = self.data[key] return response - def html_link(self): - return '%s' % (self.get_id(), ox.escape_html(self.name)) + def annotation_value(self): + #return u'%s' % (self.get_id(), ox.escape_html(self.name)) + return ox.escape_html(self.name) def update_matches(self): import annotation.models diff --git a/static/js/editor.js b/static/js/editor.js index 233d32e71..7e7ad8b5d 100644 --- a/static/js/editor.js +++ b/static/js/editor.js @@ -306,6 +306,9 @@ pandora.ui.editor = function(data) { select: function(data) { pandora.UI.set('videoPoints.' + ui.item + '.annotation', data.id.split('/')[1] || ''); }, + showentityinfo: function(data) { + pandora.URL.push('/entities/' + data.id) + }, subtitles: function(data) { pandora.UI.set({videoSubtitles: data.subtitles}); },