everyone can have a license; groups admin
This commit is contained in:
parent
f4fab78812
commit
10a1239df7
5 changed files with 52 additions and 25 deletions
|
@ -59,7 +59,8 @@
|
|||
//{"id": "year", "title": "Years", "type": "integer"},
|
||||
{"id": "features", "title": "Features", "type": "string"},
|
||||
{"id": "director", "title": "Directors", "type": "string"},
|
||||
{"id": "cinematographer", "title": "Cinematographers", "type": "string"}
|
||||
{"id": "cinematographer", "title": "Cinematographers", "type": "string"},
|
||||
{"id": "license", "title": "License", "type": "string"}
|
||||
],
|
||||
/*
|
||||
An itemKey must have the following properties:
|
||||
|
@ -386,6 +387,14 @@
|
|||
"type": "integer",
|
||||
"columnWidth": 60
|
||||
},
|
||||
{
|
||||
"id": "license",
|
||||
"title": "License",
|
||||
"type": ["string"],
|
||||
"columnWidth": 120,
|
||||
"autocomplete": true,
|
||||
"filter": true
|
||||
},
|
||||
{
|
||||
"id": "rightslevel",
|
||||
"title": "Rights Level",
|
||||
|
|
|
@ -38,6 +38,8 @@ class SessionData(models.Model):
|
|||
|
||||
objects = managers.SessionDataManager()
|
||||
|
||||
groupssort = models.CharField(default=None,blank=True,null=True, max_length=255)
|
||||
|
||||
def __unicode__(self):
|
||||
return u"%s" % self.session_key
|
||||
|
||||
|
@ -92,8 +94,10 @@ class SessionData(models.Model):
|
|||
self.username = self.user.username
|
||||
self.level = self.user.get_profile().level
|
||||
self.firstseen = self.user.date_joined
|
||||
self.groupssort = ''.join([g.name for g in self.user.groups.all()])
|
||||
else:
|
||||
self.level = 0
|
||||
self.groupssort = None
|
||||
self.parse_data()
|
||||
super(SessionData, self).save(*args, **kwargs)
|
||||
|
||||
|
|
|
@ -427,6 +427,7 @@ def order_query(qs, sort):
|
|||
'browser': 'browser',
|
||||
'email': 'user__email',
|
||||
'firstseen': 'firstseen',
|
||||
'groups': 'groupssort',
|
||||
'ip': 'ip',
|
||||
'lastseen': 'lastseen',
|
||||
'level': 'level',
|
||||
|
|
|
@ -168,21 +168,25 @@ pandora.ui.infoView = function(data) {
|
|||
Ox.Editable({
|
||||
clickLink: pandora.clickLink,
|
||||
editable: isEditable,
|
||||
placeholder: formatLight('unknown'),
|
||||
maxHeight: Infinity,
|
||||
placeholder: formatLight('No description'),
|
||||
tooltip: isEditable ? 'Doubleclick to edit' : '',
|
||||
type: 'textarea',
|
||||
value: data.description || ''
|
||||
value: data.description || '',
|
||||
//width: 300
|
||||
})
|
||||
.bindEvent({
|
||||
submit: function(event) {
|
||||
editMetadata('description', event.value);
|
||||
}
|
||||
})
|
||||
.css(css)
|
||||
)
|
||||
.appendTo($text);
|
||||
}
|
||||
|
||||
var list_keys = ['language', 'topic', 'director', 'cinematographer', 'features', 'groups'];
|
||||
var listKeys = ['language', 'topic', 'director', 'cinematographer', 'features', 'groups',
|
||||
'license'];
|
||||
$('<div>').html('<br>').appendTo($text);
|
||||
[
|
||||
'source',
|
||||
|
@ -195,15 +199,15 @@ pandora.ui.infoView = function(data) {
|
|||
'features',
|
||||
'language',
|
||||
'topic',
|
||||
'license',
|
||||
'user',
|
||||
].forEach(function(key) {
|
||||
|
||||
var $div = $('<div>')
|
||||
.appendTo($text),
|
||||
value = list_keys.indexOf(key) >= 0
|
||||
var $div = $('<div>').appendTo($text),
|
||||
value = listKeys.indexOf(key) >= 0
|
||||
? (data[key] || []).join(', ')
|
||||
: data[key] || '';
|
||||
if(isEditable || value) {
|
||||
if (isEditable || value) {
|
||||
$('<div>')
|
||||
.html(
|
||||
formatKey({
|
||||
|
@ -214,7 +218,7 @@ pandora.ui.infoView = function(data) {
|
|||
Ox.Editable({
|
||||
clickLink: pandora.clickLink,
|
||||
format: function(value) {
|
||||
return list_keys.indexOf(key) >= 0
|
||||
return listKeys.indexOf(key) >= 0
|
||||
? formatValue(value.split(', '), {
|
||||
'director': 'name',
|
||||
'cinematographer': 'name',
|
||||
|
@ -225,7 +229,7 @@ pandora.ui.infoView = function(data) {
|
|||
placeholder: formatLight('unknown'),
|
||||
editable: isEditable,
|
||||
tooltip: isEditable ? 'Doubleclick to edit' : '',
|
||||
value: list_keys.indexOf(key) >= 0
|
||||
value: listKeys.indexOf(key) >= 0
|
||||
? (data[key] || []).join(', ')
|
||||
: data[key] || ''
|
||||
})
|
||||
|
@ -234,6 +238,7 @@ pandora.ui.infoView = function(data) {
|
|||
editMetadata(key, event.value);
|
||||
}
|
||||
})
|
||||
.css(css)
|
||||
.appendTo($div);
|
||||
if(pandora.site.itemKeys.filter(function(item) {
|
||||
if (item.id == key)
|
||||
|
@ -244,7 +249,7 @@ pandora.ui.infoView = function(data) {
|
|||
.append(
|
||||
descriptions[key] = Ox.Editable({
|
||||
clickLink: pandora.clickLink,
|
||||
placeholder: formatLight(Ox.toTitleCase(key) + ' Description'),
|
||||
placeholder: formatLight('No ' + Ox.toTitleCase(key) + ' Description'),
|
||||
editable: isEditable,
|
||||
tooltip: isEditable ? 'Doubleclick to edit' : '',
|
||||
type: 'textarea',
|
||||
|
@ -255,6 +260,7 @@ pandora.ui.infoView = function(data) {
|
|||
editMetadata(key + 'description', event.value);
|
||||
}
|
||||
})
|
||||
.css(css)
|
||||
).css({
|
||||
'padding-top': '4px',
|
||||
'padding-bottom': '4px'
|
||||
|
@ -354,7 +360,7 @@ pandora.ui.infoView = function(data) {
|
|||
var edit = {id: data.id};
|
||||
if (key == 'title') {
|
||||
edit[key] = value;
|
||||
} else if(list_keys.indexOf(key) > -1) {
|
||||
} else if(listKeys.indexOf(key) > -1) {
|
||||
edit[key] = value ? value.split(', ') : [];
|
||||
} else {
|
||||
edit[key] = value;
|
||||
|
|
|
@ -125,6 +125,13 @@ pandora.ui.usersDialog = function() {
|
|||
visible: true,
|
||||
width: 60
|
||||
},
|
||||
{
|
||||
id: 'groups',
|
||||
operator: '+',
|
||||
title: 'Groups',
|
||||
visible: true,
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
format: function(value) {
|
||||
return $('<img>')
|
||||
|
@ -490,18 +497,6 @@ pandora.ui.usersDialog = function() {
|
|||
.bindEvent({
|
||||
submit: function(data) {
|
||||
|
||||
}
|
||||
}),
|
||||
Ox.Input({
|
||||
id: 'groups',
|
||||
label: 'Groups',
|
||||
labelWidth: 80,
|
||||
value: user.groups.join(', '),
|
||||
width: formWidth - 16
|
||||
})
|
||||
.bindEvent({
|
||||
submit: function(data) {
|
||||
|
||||
}
|
||||
}),
|
||||
Ox.Select({
|
||||
|
@ -517,6 +512,18 @@ pandora.ui.usersDialog = function() {
|
|||
value: user.level,
|
||||
width: formWidth - 16
|
||||
}),
|
||||
Ox.Input({
|
||||
id: 'groups',
|
||||
label: 'Groups',
|
||||
labelWidth: 80,
|
||||
value: user.groups.join(', '),
|
||||
width: formWidth - 16
|
||||
})
|
||||
.bindEvent({
|
||||
submit: function(data) {
|
||||
|
||||
}
|
||||
}),
|
||||
Ox.Checkbox({
|
||||
id: 'newsletter',
|
||||
label: 'Newsletter',
|
||||
|
@ -534,7 +541,7 @@ pandora.ui.usersDialog = function() {
|
|||
}
|
||||
}),
|
||||
Ox.Input({
|
||||
height: dialogHeight - 160,
|
||||
height: dialogHeight - 184,
|
||||
id: 'notes',
|
||||
placeholder: 'Notes',
|
||||
type: 'textarea',
|
||||
|
|
Loading…
Reference in a new issue