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