entities are not links

This commit is contained in:
j 2015-04-16 20:02:31 +00:00
parent c59fb1596f
commit e851dcabfb
3 changed files with 7 additions and 3 deletions

View file

@ -244,7 +244,7 @@ class Annotation(models.Model):
try: try:
entity = self.get_entity() entity = self.get_entity()
j['entity'] = entity.json(user=user) j['entity'] = entity.json(user=user)
j['value'] = entity.html_link() j['value'] = entity.annotation_value()
except: except:
j['entity'] = {} j['entity'] = {}
elif l['type'] == 'event': elif l['type'] == 'event':

View file

@ -159,8 +159,9 @@ class Entity(models.Model):
response[key] = self.data[key] response[key] = self.data[key]
return response return response
def html_link(self): def annotation_value(self):
return '<a href="/entities/%s">%s</a>' % (self.get_id(), ox.escape_html(self.name)) #return u'<a href="/entities/%s">%s</a>' % (self.get_id(), ox.escape_html(self.name))
return ox.escape_html(self.name)
def update_matches(self): def update_matches(self):
import annotation.models import annotation.models

View file

@ -306,6 +306,9 @@ pandora.ui.editor = function(data) {
select: function(data) { select: function(data) {
pandora.UI.set('videoPoints.' + ui.item + '.annotation', data.id.split('/')[1] || ''); pandora.UI.set('videoPoints.' + ui.item + '.annotation', data.id.split('/')[1] || '');
}, },
showentityinfo: function(data) {
pandora.URL.push('/entities/' + data.id)
},
subtitles: function(data) { subtitles: function(data) {
pandora.UI.set({videoSubtitles: data.subtitles}); pandora.UI.set({videoSubtitles: data.subtitles});
}, },