forked from 0x2620/pandora
allow language attributes in text and annotations
This commit is contained in:
parent
6e49032602
commit
ad7c36881c
3 changed files with 4 additions and 4 deletions
|
@ -5,7 +5,7 @@ import ox
|
||||||
def cleanup_value(value, layer_type):
|
def cleanup_value(value, layer_type):
|
||||||
#FIXME: what about other types? location etc
|
#FIXME: what about other types? location etc
|
||||||
if layer_type == 'text':
|
if layer_type == 'text':
|
||||||
value = ox.sanitize_html(value)
|
value = ox.sanitize_html(value, global_attributes=['lang'])
|
||||||
else:
|
else:
|
||||||
value = ox.escape_html(value)
|
value = ox.escape_html(value)
|
||||||
return value
|
return value
|
||||||
|
|
|
@ -128,9 +128,9 @@ class Text(models.Model):
|
||||||
name = data['name'] + ' [%d]' % num
|
name = data['name'] + ' [%d]' % num
|
||||||
self.name = name
|
self.name = name
|
||||||
elif key == 'description':
|
elif key == 'description':
|
||||||
self.description = ox.sanitize_html(data['description'])
|
self.description = ox.sanitize_html(data['description'], global_attributes=['lang'])
|
||||||
elif key == 'text':
|
elif key == 'text':
|
||||||
self.text = ox.sanitize_html(data['text'], global_attributes=['data-name'])
|
self.text = ox.sanitize_html(data['text'], global_attributes=['data-name', 'lang'])
|
||||||
elif key == 'rightslevel':
|
elif key == 'rightslevel':
|
||||||
self.rightslevel = int(data['rightslevel'])
|
self.rightslevel = int(data['rightslevel'])
|
||||||
|
|
||||||
|
|
|
@ -312,7 +312,7 @@ pandora.ui.textHTML = function(text) {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
globalAttributes: ['data-name'],
|
globalAttributes: ['data-name', 'lang'],
|
||||||
placeholder: text.editable ? Ox._('Doubleclick to edit text') : '',
|
placeholder: text.editable ? Ox._('Doubleclick to edit text') : '',
|
||||||
tooltip: text.editable ? pandora.getEditTooltip('text') : '',
|
tooltip: text.editable ? pandora.getEditTooltip('text') : '',
|
||||||
type: 'textarea',
|
type: 'textarea',
|
||||||
|
|
Loading…
Reference in a new issue