keep friends from seeing extra item views, but allow them to see list sizes

This commit is contained in:
rolux 2012-03-21 09:36:11 +00:00
parent e2c0669860
commit 8f529d68d3
4 changed files with 12 additions and 4 deletions

View File

@ -35,9 +35,10 @@
"canPlayClips": {"guest": 2, "member": 2, "friend": 4, "staff": 4, "admin": 4},
"canPlayVideo": {"guest": 1, "member": 1, "friend": 4, "staff": 4, "admin": 4},
"canSeeDebugMenu": {"staff": true, "admin": true},
"canSeeExtraItemViews": {"staff": true, "admin": true},
"canSeeFiles": {"staff": true, "admin": true},
"canSeeItem": {"guest": 3, "member": 3, "friend": 4, "staff": 4, "admin": 4},
"canSeeExtraItemViews": {"friend": true, "staff": true, "admin": true},
"canSeeListSize": {"friend": true, "staff": true, "admin": true},
"canSendMail": {"staff": true, "admin": true},
"canUploadVideo": {"guest": false, "member": false, "staff": true, "admin": true}
},

View File

@ -33,9 +33,10 @@
"canPlayClips": {"guest": 1, "member": 1, "staff": 4, "admin": 4},
"canPlayVideo": {"guest": 1, "member": 1, "staff": 4, "admin": 4},
"canSeeDebugMenu": {"staff": true, "admin": true},
"canSeeExtraItemViews": {"staff": true, "admin": true},
"canSeeFiles": {"staff": true, "admin": true},
"canSeeItem": {"guest": 1, "member": 1, "staff": 4, "admin": 4},
"canSeeExtraItemViews": {"friend": true, "staff": true, "admin": true},
"canSeeListSize": {"friend": true, "staff": true, "admin": true},
"canSendMail": {"staff": true, "admin": true},
"canUploadVideo": {"guest": false, "member": true, "staff": true, "admin": true}
},

View File

@ -31,6 +31,8 @@ pandora.ui.statusbar = function() {
function getText(data) {
var ui = pandora.user.ui,
canSeeFiles = pandora.site.capabilities.canSeeFiles[pandora.user.level],
canSeeListSize = pandora.site.capabilities.canSeeListSize[pandora.user.level],
itemName = ui.listView == 'clip'
? (data.items == 1 ? 'Clip' : 'Clips')
: (pandora.site.itemName[data.items == 1 ? 'singular' : 'plural']),
@ -41,10 +43,14 @@ pandora.ui.statusbar = function() {
} else if (data.duration) {
parts.push(Ox.formatDuration(data.duration, 'short'));
}
if (pandora.site.capabilities.canSeeFiles[pandora.user.level]) {
if (canSeeFiles) {
data.files && parts.push(data.files + ' file' + (data.files == 1 ? '' : 's'));
data.duration && parts.push(Ox.formatDuration(data.duration));
}
if (canSeeListSize) {
data.size && parts.push(Ox.formatValue(data.size, 'B'));
}
if (canSeeFiles) {
data.pixels && parts.push(Ox.formatValue(data.pixels, 'px'));
}
return parts.join(', ');

View File

@ -130,7 +130,7 @@ pandora.ui.usersDialog = function() {
align: 'center',
format: function(value, data) {
var userLevel = data.useragent.indexOf('Googlebot') > -1
? 'Robot' : value;
? 'Robot' : Ox.toTitleCase(value);
return Ox.Theme.formatColorLevel(
userLevels.indexOf(userLevel),
userLevels,