cleanup menu

This commit is contained in:
j 2011-08-16 19:03:14 +02:00
parent 861360b9e1
commit 4d321f1376
4 changed files with 10 additions and 38 deletions

View file

@ -246,17 +246,18 @@ def moveFiles(request):
i = get_item(data) i = get_item(data)
else: else:
i = get_item({'imdbId': data['itemId']}) i = get_item({'imdbId': data['itemId']})
changed = [] changed = [i.itemId]
for f in models.File.objects.filter(oshash__in=data['ids']): for f in models.File.objects.filter(oshash__in=data['ids']):
if f.item.id != i.itemId and f.editable(request.user): if f.item.id != i.itemId and f.editable(request.user):
if f.item.itemId not in changed: if f.item.itemId not in changed:
changed.append(f.item.itemId) changed.append(f.item.itemId)
if i.itemId not in changed:
changed.append(i.itemId)
f.item = i f.item = i
f.save() f.save()
for itemId in changed: for itemId in changed:
c = models.Item.objects.get(itemId=itemId) c = models.Item.objects.get(itemId=itemId)
if c.files.count() == 0:
c.delete()
else:
c.rendered = False c.rendered = False
c.save() c.save()
item.tasks.update_streams.delay(itemId) item.tasks.update_streams.delay(itemId)

View file

@ -306,7 +306,6 @@
{"id": "timeline", "title": "Timeline"}, {"id": "timeline", "title": "Timeline"},
{"id": "map", "title": "Map"}, {"id": "map", "title": "Map"},
{"id": "calendar", "title": "Calendar"}, {"id": "calendar", "title": "Calendar"},
{"id": "files", "title": "Files", "admin": true}
], ],
"layers": [ "layers": [
{ {

View file

@ -78,12 +78,6 @@ Ox.load('Geo', function() {
pandora.site.itemViews.push( pandora.site.itemViews.push(
{id: 'files', title: 'Files', admin: 'true'} {id: 'files', title: 'Files', admin: 'true'}
); );
pandora.site.media.importPosterFrames && pandora.site.itemViews.push(
{id: 'frames', title: 'Frames', admin: 'true'}
);
pandora.site.media.importMoviePosters && pandora.site.itemViews.push(
{id: 'posters', title: 'Posters', admin: 'true'}
);
$.extend(pandora.user, { $.extend(pandora.user, {
infoRatio: 16 / 9, infoRatio: 16 / 9,
sectionElement: 'buttons', sectionElement: 'buttons',

View file

@ -18,19 +18,15 @@ pandora.ui.mainMenu = function() {
{ id: 'tour', title: 'Take a Tour' }, { id: 'tour', title: 'Take a Tour' },
{ id: 'faq', title: 'Frequently Asked Questions' }, { id: 'faq', title: 'Frequently Asked Questions' },
{ id: 'terms', title: 'Terms of Service' }, { id: 'terms', title: 'Terms of Service' },
{ id: 'contact', title: 'Contact ' + pandora.site.site.name },
{}, {},
{ id: 'software', title: 'Software', items: [ { id: 'software', title: 'Software' }
{ id: 'about', title: 'About' },
{ id: 'download', title: 'Download' },
{ id: 'report', title: 'Report a Bug' }
] },
{},
{ id: 'contact', title: 'Contact ' + pandora.site.site.name }
] }, ] },
{ id: 'userMenu', title: 'User', items: [ { id: 'userMenu', title: 'User', items: [
{ id: 'username', title: 'User: ' + (isGuest ? 'not logged in' : pandora.user.username), disabled: true }, { id: 'username', title: 'User: ' + (isGuest ? 'not logged in' : pandora.user.username), disabled: true },
{}, {},
{ id: 'preferences', title: 'Preferences...', disabled: isGuest, keyboard: 'control ,' }, { id: 'preferences', title: 'Preferences...', disabled: isGuest, keyboard: 'control ,' },
{ id: 'archives', title: 'Archives...', disabled: isGuest },
{}, {},
{ id: 'register', title: 'Register...', disabled: !isGuest }, { id: 'register', title: 'Register...', disabled: !isGuest },
{ id: 'loginlogout', title: isGuest ? 'Login...' : 'Logout...' } { id: 'loginlogout', title: isGuest ? 'Login...' : 'Logout...' }
@ -82,10 +78,6 @@ pandora.ui.mainMenu = function() {
return {id: icons, title: Ox.toTitleCase(icons), checked: pandora.user.ui.icons == icons}; return {id: icons, title: Ox.toTitleCase(icons), checked: pandora.user.ui.icons == icons};
}) } }) }
] }, ] },
{ id: 'info', title: 'Info', items: [
{ id: 'poster', title: 'Poster' },
{ id: 'video', title: 'Video' }
] },
{}, {},
{ id: 'openmovie', title: ['Open ' + pandora.site.itemName.singular, 'Open ' + pandora.site.itemName.plural], disabled: true, items: [ { id: 'openmovie', title: ['Open ' + pandora.site.itemName.singular, 'Open ' + pandora.site.itemName.plural], disabled: true, items: [
{ group: 'movieview', min: 1, max: 1, items: $.map(pandora.site.itemViews, function(view, i) { { group: 'movieview', min: 1, max: 1, items: $.map(pandora.site.itemViews, function(view, i) {
@ -134,20 +126,12 @@ pandora.ui.mainMenu = function() {
{ id: 'titles', title: 'Manage Titles...' }, { id: 'titles', title: 'Manage Titles...' },
{ id: 'names', title: 'Manage Names...' }, { id: 'names', title: 'Manage Names...' },
{}, {},
{ id: 'stills', title: 'Manage Stills...' },
{ id: 'posters', title: 'Manage Posters...' },
{},
{ id: 'places', title: 'Manage Places...' }, { id: 'places', title: 'Manage Places...' },
{ id: 'events', title: 'Manage Events...' }, { id: 'events', title: 'Manage Events...' },
{}, {},
{ id: 'users', title: 'Manage Users...' }, { id: 'users', title: 'Manage Users...' },
{ id: 'lists', title: 'Manage Lists...' }, { id: 'lists', title: 'Manage Lists...' },
] }, ] },
{ id: 'codeMenu', title: 'Code', items: [
{ id: 'download', title: 'Download' },
{ id: 'contribute', title: 'Contribute' },
{ id: 'report', title: 'Report a Bug' },
] },
{ id: 'helpMenu', title: 'Help', items: [ { id: 'helpMenu', title: 'Help', items: [
{ id: 'help', title: pandora.site.site.name + ' Help', keyboard: 'shift ?' } { id: 'help', title: pandora.site.site.name + ' Help', keyboard: 'shift ?' }
] }, ] },
@ -155,12 +139,6 @@ pandora.ui.mainMenu = function() {
{ id: 'query', title: 'Show pandora.Query' }, { id: 'query', title: 'Show pandora.Query' },
{ id: 'resetui', title: 'Reset UI Settings'}, { id: 'resetui', title: 'Reset UI Settings'},
{ id: 'clearcache', title: 'Clear cache'} { id: 'clearcache', title: 'Clear cache'}
] },
{ id: 'testMenu', title: 'Test', items: [
{ group: 'foogroup', items: [
{ id: 'item1', title: 'Item 1' },
{ id: 'item2', title: 'Item 2' }
] }
] } ] }
] ]
}) })