item/user groups

This commit is contained in:
j 2012-01-13 15:17:18 +05:30
commit 4e6c2250c9
6 changed files with 52 additions and 14 deletions

View file

@ -264,7 +264,7 @@ pandora.ui.infoView = function(data) {
)
.appendTo($text);
var list_keys = ['language', 'topic', 'director', 'cinematographer', 'features'];
var list_keys = ['language', 'topic', 'director', 'cinematographer', 'features', 'groups'];
$('<div>').html('<br>').appendTo($text);
[
'date',
@ -284,7 +284,6 @@ pandora.ui.infoView = function(data) {
.html(
formatKey({
categorty: 'categories',
user: 'contributor'
}[key] || key).replace('</span>', '&nbsp;</span>')
)
.appendTo($div);
@ -352,6 +351,22 @@ pandora.ui.infoView = function(data) {
// Notes -------------------------------------------------------------------
if (canEdit) {
$('<div>')
.css({marginBottom: '4px'})
.append(formatKey('Groups', true))
.append(
Ox.Editable({
placeholder: formatLight('No Groups'),
tooltip: 'Doubleclick to edit',
value: data.groups.join(', '),
})
.bindEvent({
submit: function(event) {
editMetadata('groups', event.value);
}
})
)
.appendTo($statistics);
$('<div>')
.css({marginBottom: '4px'})
@ -367,12 +382,7 @@ pandora.ui.infoView = function(data) {
})
.bindEvent({
submit: function(event) {
pandora.api.edit({
id: data.id,
notes: event.value
}, function(result) {
// ...
});
editMetadata('notes', event.value);
}
})
)

View file

@ -240,7 +240,7 @@ pandora.ui.usersDialog = function() {
columnsRemovable: true,
columnsVisible: true,
items: pandora.api.findUsers,
keys: ['notes'],
keys: ['notes', 'groups'],
max: -1,
scrollbarVisible: true,
sort: [{key: 'lastseen', operator: '-'}]
@ -490,6 +490,18 @@ 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({
@ -542,6 +554,8 @@ pandora.ui.usersDialog = function() {
data.level = event.data.value;
} else if (event.id == 'newsletter') {
data.newsletter = event.data.value;
} else if (event.id == 'groups') {
data.groups = event.data.value.split(', ');
} else {
data[event.id] = event.data.value;
}