Compare commits
3 commits
ca7741f92c
...
940632369a
| Author | SHA1 | Date | |
|---|---|---|---|
| 940632369a | |||
| 1c0462393c | |||
| 40edf9dd4a |
6 changed files with 36 additions and 31 deletions
|
|
@ -9,7 +9,7 @@ def extract_fulltext(id):
|
||||||
|
|
||||||
|
|
||||||
@task(queue='default')
|
@task(queue='default')
|
||||||
def builk_edit(data, username):
|
def bulk_edit(data, username):
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
from . import models
|
from . import models
|
||||||
from item.models import Item
|
from item.models import Item
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ def editDocument(request, data):
|
||||||
if data['id']:
|
if data['id']:
|
||||||
if isinstance(data['id'], list):
|
if isinstance(data['id'], list):
|
||||||
add_changelog(request, data)
|
add_changelog(request, data)
|
||||||
t = tasks.builk_edit.delay(data, request.user.username)
|
t = tasks.bulk_edit.delay(data, request.user.username)
|
||||||
response['data']['taskId'] = t.task_id
|
response['data']['taskId'] = t.task_id
|
||||||
else:
|
else:
|
||||||
document = models.Document.get(data['id'])
|
document = models.Document.get(data['id'])
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ pandora.ui.addFilesDialog = function(options) {
|
||||||
});
|
});
|
||||||
|
|
||||||
var selectItems = [];
|
var selectItems = [];
|
||||||
if (!pandora.site.itemRequiresVideo && pandora.user.ui.item) {
|
if (pandora.user.ui.item && options.editable) {
|
||||||
selectItems.push({
|
selectItems.push({
|
||||||
id: 'add',
|
id: 'add',
|
||||||
title: Ox._(
|
title: Ox._(
|
||||||
|
|
@ -114,14 +114,7 @@ pandora.ui.addFilesDialog = function(options) {
|
||||||
[pandora.site.itemName.singular.toLowerCase()]
|
[pandora.site.itemName.singular.toLowerCase()]
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
selectItems.push({
|
}
|
||||||
id: 'one',
|
|
||||||
title: Ox._(
|
|
||||||
options.items.length > 1 ? 'Create new {0} with multiple parts' : 'Create new {0}',
|
|
||||||
[pandora.site.itemName.singular.toLowerCase()]
|
|
||||||
)
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
if (options.items.length > 1) {
|
if (options.items.length > 1) {
|
||||||
selectItems.push({
|
selectItems.push({
|
||||||
id: 'multiple',
|
id: 'multiple',
|
||||||
|
|
@ -134,11 +127,10 @@ pandora.ui.addFilesDialog = function(options) {
|
||||||
selectItems.push({
|
selectItems.push({
|
||||||
id: 'one',
|
id: 'one',
|
||||||
title: Ox._(
|
title: Ox._(
|
||||||
'Create one {0} with multiple parts',
|
options.items.length > 1 ? 'Create new {0} with multiple parts' : 'Create new {0}',
|
||||||
[pandora.site.itemName.singular.toLowerCase()]
|
[pandora.site.itemName.singular.toLowerCase()]
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
}
|
|
||||||
var $select = Ox.Select({
|
var $select = Ox.Select({
|
||||||
items: selectItems,
|
items: selectItems,
|
||||||
width: 256
|
width: 256
|
||||||
|
|
|
||||||
|
|
@ -270,10 +270,16 @@ pandora.ui.addItemDialog = function(options) {
|
||||||
} else {
|
} else {
|
||||||
$screen.stop();
|
$screen.stop();
|
||||||
that.close();
|
that.close();
|
||||||
|
(pandora.user.ui.item ? pandora.api.get : Ox.noop)({
|
||||||
|
id: pandora.user.ui.item,
|
||||||
|
keys: ['editable']
|
||||||
|
}, function(result) {
|
||||||
pandora.ui.addFilesDialog({
|
pandora.ui.addFilesDialog({
|
||||||
action: selected,
|
action: selected,
|
||||||
items: items
|
items: items,
|
||||||
|
editable: pandora.user.ui.item && result.data.editable
|
||||||
}).open();
|
}).open();
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ pandora.ui.collection = function() {
|
||||||
}), callback);
|
}), callback);
|
||||||
return Ox.clone(data, true);
|
return Ox.clone(data, true);
|
||||||
},
|
},
|
||||||
|
keys: keys,
|
||||||
scrollbarVisible: true,
|
scrollbarVisible: true,
|
||||||
selected: ui.collectionSelection,
|
selected: ui.collectionSelection,
|
||||||
sort: ui.collectionSort.concat([
|
sort: ui.collectionSort.concat([
|
||||||
|
|
|
||||||
|
|
@ -58,10 +58,16 @@ pandora.ui.mediaExistsDialog = function(options) {
|
||||||
return existing.indexOf(item.oshash) == -1;
|
return existing.indexOf(item.oshash) == -1;
|
||||||
});
|
});
|
||||||
that.close();
|
that.close();
|
||||||
|
(pandora.user.ui.item ? pandora.api.get : Ox.noop)({
|
||||||
|
id: pandora.user.ui.item,
|
||||||
|
keys: ['editable']
|
||||||
|
}, function(result) {
|
||||||
pandora.ui.addFilesDialog({
|
pandora.ui.addFilesDialog({
|
||||||
action: options.action,
|
action: options.action,
|
||||||
items: items
|
items: items,
|
||||||
|
editable: pandora.user.ui.item && result.data.editable
|
||||||
}).open();
|
}).open();
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue