Compare commits
3 commits
e2ea4e3aab
...
9730b046ce
| Author | SHA1 | Date | |
|---|---|---|---|
| 9730b046ce | |||
| 708a5b1b33 | |||
| 55b86bdac8 |
4 changed files with 25 additions and 22 deletions
|
|
@ -270,10 +270,7 @@ class Annotation(models.Model):
|
|||
from translation.models import Translation
|
||||
layer = self.get_layer()
|
||||
if layer.get('translate'):
|
||||
t, created = Translation.objects.get_or_create(lang=lang, key=self.value)
|
||||
if created:
|
||||
t.type = Translation.CONTENT
|
||||
t.save()
|
||||
Translation.objects.get_or_create(lang=lang, key=self.value, defaults={'type': Translation.CONTENT})
|
||||
|
||||
def delete(self, *args, **kwargs):
|
||||
with transaction.atomic():
|
||||
|
|
|
|||
|
|
@ -118,10 +118,7 @@ def getPage(request, data):
|
|||
name = data
|
||||
else:
|
||||
name = data['name']
|
||||
page, created = models.Page.objects.get_or_create(name=name)
|
||||
if created:
|
||||
page.text = ''
|
||||
page.save()
|
||||
page, created = models.Page.objects.get_or_create(name=name, defaults={'text': ''})
|
||||
response = json_response({'name': page.name, 'text': page.text})
|
||||
return render_to_json_response(response)
|
||||
actions.register(getPage)
|
||||
|
|
|
|||
|
|
@ -235,6 +235,8 @@ class Document(models.Model):
|
|||
value = self.get_value(source, u'')
|
||||
if isinstance(value, list):
|
||||
value = u','.join(value)
|
||||
if not isinstance(value, str):
|
||||
value = str(value)
|
||||
value = utils.sort_string(value)[:955]
|
||||
set_value(s, name, value)
|
||||
elif sort_type == 'words':
|
||||
|
|
|
|||
|
|
@ -137,8 +137,10 @@ pandora.ui.collection = function() {
|
|||
|
||||
that.bindEvent({
|
||||
closepreview: function(data) {
|
||||
pandora.$ui.previewDialog.close();
|
||||
delete pandora.$ui.previewDialog;
|
||||
if (pandora.$ui.documentDialog) {
|
||||
pandora.$ui.documentDialog.close();
|
||||
delete pandora.$ui.documentDialog;
|
||||
}
|
||||
},
|
||||
copy: function(data) {
|
||||
pandora.clipboard.copy(data.ids, 'document');
|
||||
|
|
@ -227,20 +229,25 @@ pandora.ui.collection = function() {
|
|||
pandora.UI.set(set);
|
||||
},
|
||||
openpreview: function(data) {
|
||||
/*
|
||||
if (!pandora.$ui.previewDialog) {
|
||||
pandora.$ui.previewDialog = pandora.ui.previewDialog()
|
||||
.open()
|
||||
.bindEvent({
|
||||
close: function() {
|
||||
that.closePreview();
|
||||
delete pandora.$ui.previewDialog;
|
||||
}
|
||||
});
|
||||
if (!pandora.$ui.documentDialog) {
|
||||
pandora.$ui.documentDialog = pandora.openDocumentDialog({
|
||||
documents: that.options('selected').map(function(id) {
|
||||
return that.value(id);
|
||||
})
|
||||
}).bindEvent({
|
||||
close: function() {
|
||||
that.closePreview();
|
||||
delete pandora.$ui.documentDialog;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
pandora.$ui.previewDialog.update();
|
||||
pandora.$ui.documentDialog.update({
|
||||
index: 0,
|
||||
items: that.options('selected').map(function(id) {
|
||||
return that.value(id);
|
||||
})
|
||||
});
|
||||
}
|
||||
*/
|
||||
},
|
||||
paste: function(data) {
|
||||
var items = pandora.clipboard.paste();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue