forked from 0x2620/pandora
dont reset list position while setting private lists public
This commit is contained in:
parent
2d7d0414f9
commit
dac0738047
3 changed files with 16 additions and 14 deletions
|
@ -16,6 +16,7 @@
|
|||
// "canClickMap": {"friend": true, "staff": true, "admin": true},
|
||||
"canDeleteItems": {"admin": true},
|
||||
"canDownloadVideo": {"guest": 0, "member": 0, "friend": 4, "staff": 4, "admin": 4},
|
||||
"canEditFeaturedLists": {"staff": true, "admin": true},
|
||||
"canEditMetadata": {"staff": true, "admin": true},
|
||||
"canEditSitePages": {"staff": true, "admin": true},
|
||||
"canEditUsers": {"admin": true},
|
||||
|
|
|
@ -233,8 +233,8 @@ def addList(request):
|
|||
value = data['status']
|
||||
if value not in list._status:
|
||||
value = list._status[0]
|
||||
if not request.user.is_staff and value == 'featured':
|
||||
value = 'private'
|
||||
if value == 'featured' and request.user.get_profile().capability('canEditFeaturedLists'):
|
||||
value = list.status
|
||||
list.status = value
|
||||
if 'description' in data:
|
||||
list.description = data['description']
|
||||
|
@ -329,7 +329,7 @@ def editList(request):
|
|||
pos.position = qs.aggregate(Max('position'))['position__max'] + 1
|
||||
pos.save()
|
||||
models.Position.objects.filter(list=list).exclude(id=pos.id).delete()
|
||||
else:
|
||||
elif list.status == 'featured' and value == 'public':
|
||||
models.Position.objects.filter(list=list).delete()
|
||||
pos, created = models.Position.objects.get_or_create(list=list,
|
||||
user=list.user,section='personal')
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// vim: et:ts=4:sw=4:sts=4:ft=javascript
|
||||
'use strict';
|
||||
pandora.ui.folderList = function(id) {
|
||||
// FIXME: use canEditFeaturedLists capability, not 'admin'
|
||||
var i = Ox.getPositionById(pandora.site.sectionFolders[pandora.user.ui.section], id),
|
||||
that;
|
||||
if (pandora.user.ui.section == 'items') {
|
||||
|
|
Loading…
Reference in a new issue