padma info view

This commit is contained in:
j 2011-12-29 13:42:19 +01:00
parent bf73eeabb5
commit 937b8c6b50
2 changed files with 60 additions and 44 deletions

View file

@ -25,7 +25,8 @@
"canSeeDebugMenu": {"staff": true, "admin": true}, "canSeeDebugMenu": {"staff": true, "admin": true},
"canSeeFiles": {"staff": true, "admin": true}, "canSeeFiles": {"staff": true, "admin": true},
"canSeeItem": {"guest": 1, "member": 1, "staff": 4, "admin": 4}, "canSeeItem": {"guest": 1, "member": 1, "staff": 4, "admin": 4},
"canSeeExtraItemViews": {"friend": true, "staff": true, "admin": true} "canSeeExtraItemViews": {"friend": true, "staff": true, "admin": true},
"canSendMail": {"staff": true, "admin": true}
}, },
/* /*
clipKeys are the properties that clips can by sorted by. clipKeys are the properties that clips can by sorted by.
@ -45,6 +46,7 @@
{"id": "collection", "title": "Collection", "type": "string"}, {"id": "collection", "title": "Collection", "type": "string"},
{"id": "source", "title": "Source", "type": "string"}, {"id": "source", "title": "Source", "type": "string"},
{"id": "director", "title": "Director", "type": "string"}, {"id": "director", "title": "Director", "type": "string"},
{"id": "cinematographer", "title": "Cinematographer", "type": "string"},
{"id": "places", "title": "Places", "type": "string"}, {"id": "places", "title": "Places", "type": "string"},
{"id": "year", "title": "Year", "type": "integer"}, {"id": "year", "title": "Year", "type": "integer"},
{"id": "language", "title": "Language", "type": "string"}, {"id": "language", "title": "Language", "type": "string"},
@ -101,6 +103,16 @@
"find": true, "find": true,
"sort": "person" "sort": "person"
}, },
{
"id": "cinematographer",
"title": "Cinematographer",
"type": ["string"],
"autocomplete": true,
"columnWidth": 180,
"filter": true,
"find": true,
"sort": "person"
},
{ {
"id": "name", "id": "name",
"title": "Name", "title": "Name",
@ -491,7 +503,7 @@
"listColumns": ["title", "director", "location", "collection", "language", "duration", "source"], "listColumns": ["title", "director", "location", "collection", "language", "duration", "source"],
"listColumnWidth": {}, "listColumnWidth": {},
"listSelection": [], "listSelection": [],
"listSort": [{"key": "director", "operator": "+"}], "listSort": [{"key": "title", "operator": "+"}],
"listView": "grid", "listView": "grid",
"lists": {}, "lists": {},
"mapFind": "", "mapFind": "",

View file

@ -169,7 +169,7 @@ pandora.ui.infoView = function(data) {
.appendTo($text); .appendTo($text);
// Director ---------------------------------------------------------------- // Director ----------------------------------------------------------------
/*
if (data.director || isEditable) { if (data.director || isEditable) {
$('<div>') $('<div>')
.css({ .css({
@ -202,6 +202,7 @@ pandora.ui.infoView = function(data) {
) )
.appendTo($text); .appendTo($text);
} }
*/
// Country, Year, Language, Runtime ---------------------------------------- // Country, Year, Language, Runtime ----------------------------------------
/* /*
@ -249,48 +250,7 @@ pandora.ui.infoView = function(data) {
$('<div>').css(css).html(html.join('; ')).appendTo($text); $('<div>').css(css).html(html.join('; ')).appendTo($text);
} }
*/ */
$('<div>').html('<br>').appendTo($text);
[
'language',
'source',
'collection',
'category',
'user',
'location',
'date',
].forEach(function(key) {
var $div = $('<div>')
.appendTo($text);
$('<div>') $('<div>')
.html(
formatKey({
categorty: 'categories',
user: 'contributor'
}[key] || key).replace('</span>', '&nbsp;</span>')
)
.appendTo($div);
Ox.Editable({
clickLink: pandora.clickLink,
format: function(value) {
return ['language', 'category'].indexOf(key) >= 0
? formatValue(value.split(', '), key)
: value;
},
placeholder: formatLight('unknown'),
tooltip: 'Doubleclick to edit',
value: ['language', 'category'].indexOf(key) >= 0
? (data[key] || []).join(', ')
: data[key] || ''
})
.bindEvent({
submit: function(event) {
editMetadata(key, event.value);
}
})
.appendTo($div);
});
$('<div>')
.append(formatKey('description'))
.append( .append(
Ox.Editable({ Ox.Editable({
clickLink: pandora.clickLink, clickLink: pandora.clickLink,
@ -307,6 +267,50 @@ pandora.ui.infoView = function(data) {
) )
.appendTo($text); .appendTo($text);
var list_keys = ['language', 'category', 'director', 'cinematographer'];
$('<div>').html('<br>').appendTo($text);
[
'date',
'location',
'director',
'cinematographer',
'language',
'source',
'collection',
'category',
'user',
].forEach(function(key) {
var $div = $('<div>')
.appendTo($text);
$('<div>')
.html(
formatKey({
categorty: 'categories',
user: 'contributor'
}[key] || key).replace('</span>', '&nbsp;</span>')
)
.appendTo($div);
Ox.Editable({
clickLink: pandora.clickLink,
format: function(value) {
return list_keys.indexOf(key) >= 0
? formatValue(value.split(', '), key)
: value;
},
placeholder: formatLight('unknown'),
tooltip: 'Doubleclick to edit',
value: list_keys.indexOf(key) >= 0
? (data[key] || []).join(', ')
: data[key] || ''
})
.bindEvent({
submit: function(event) {
editMetadata(key, event.value);
}
})
.appendTo($div);
});
$('<div>').css({height: '16px'}).appendTo($text); $('<div>').css({height: '16px'}).appendTo($text);
[ [
'created', 'created',