Compare commits

..

No commits in common. "940632369a2a9ffbded282b22162a68d62019213" and "ca7741f92c65a98db1aff54e01f66555215efc2e" have entirely different histories.

6 changed files with 31 additions and 36 deletions

View file

@ -9,7 +9,7 @@ def extract_fulltext(id):
@task(queue='default')
def bulk_edit(data, username):
def builk_edit(data, username):
from django.db import transaction
from . import models
from item.models import Item

View file

@ -133,7 +133,7 @@ def editDocument(request, data):
if data['id']:
if isinstance(data['id'], list):
add_changelog(request, data)
t = tasks.bulk_edit.delay(data, request.user.username)
t = tasks.builk_edit.delay(data, request.user.username)
response['data']['taskId'] = t.task_id
else:
document = models.Document.get(data['id'])

View file

@ -106,7 +106,7 @@ pandora.ui.addFilesDialog = function(options) {
});
var selectItems = [];
if (pandora.user.ui.item && options.editable) {
if (!pandora.site.itemRequiresVideo && pandora.user.ui.item) {
selectItems.push({
id: 'add',
title: Ox._(
@ -114,23 +114,31 @@ pandora.ui.addFilesDialog = function(options) {
[pandora.site.itemName.singular.toLowerCase()]
)
});
}
if (options.items.length > 1) {
selectItems.push({
id: 'multiple',
id: 'one',
title: Ox._(
'Create multiple {0}',
[pandora.site.itemName.plural.toLowerCase()]
options.items.length > 1 ? 'Create new {0} with multiple parts' : 'Create new {0}',
[pandora.site.itemName.singular.toLowerCase()]
)
});
} else {
if (options.items.length > 1) {
selectItems.push({
id: 'multiple',
title: Ox._(
'Create multiple {0}',
[pandora.site.itemName.plural.toLowerCase()]
)
});
}
selectItems.push({
id: 'one',
title: Ox._(
'Create one {0} with multiple parts',
[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()]
)
});
var $select = Ox.Select({
items: selectItems,
width: 256

View file

@ -270,16 +270,10 @@ pandora.ui.addItemDialog = function(options) {
} else {
$screen.stop();
that.close();
(pandora.user.ui.item ? pandora.api.get : Ox.noop)({
id: pandora.user.ui.item,
keys: ['editable']
}, function(result) {
pandora.ui.addFilesDialog({
action: selected,
items: items,
editable: pandora.user.ui.item && result.data.editable
}).open();
})
pandora.ui.addFilesDialog({
action: selected,
items: items
}).open();
}
})
}

View file

@ -51,7 +51,6 @@ pandora.ui.collection = function() {
}), callback);
return Ox.clone(data, true);
},
keys: keys,
scrollbarVisible: true,
selected: ui.collectionSelection,
sort: ui.collectionSort.concat([

View file

@ -58,16 +58,10 @@ pandora.ui.mediaExistsDialog = function(options) {
return existing.indexOf(item.oshash) == -1;
});
that.close();
(pandora.user.ui.item ? pandora.api.get : Ox.noop)({
id: pandora.user.ui.item,
keys: ['editable']
}, function(result) {
pandora.ui.addFilesDialog({
action: options.action,
items: items,
editable: pandora.user.ui.item && result.data.editable
}).open();
})
pandora.ui.addFilesDialog({
action: options.action,
items: items
}).open();
}
})
];