From b360d9d9154028304605372c9f36c0197d8f3062 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 8 Sep 2010 18:34:24 +0200 Subject: [PATCH 1/2] make icon view the default view --- pandora/static/js/pandora.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pandora/static/js/pandora.js b/pandora/static/js/pandora.js index 11398f198..2238ade98 100755 --- a/pandora/static/js/pandora.js +++ b/pandora/static/js/pandora.js @@ -3,10 +3,10 @@ ***/ var app = new Ox.App({ - config: '/pandora.json', + config: '/static/json/pandora.json', init: 'hello', - id: site.id, - name: site.name, + id: 'oxdb', + name: 'OxDB', requestURL: '/api/' }).launch(function(data) { Ox.print('data', data) @@ -490,8 +490,7 @@ app.constructInfo = function() { app.constructList = function(view) { var $list, - info = $.inArray(app.user.ui.sort[0].key, ['title', 'director']) > -1 ? 'year' : app.user.ui.sort[0].key, - keys = Ox.unique(['director', 'id', 'poster', 'title', info]); + keys = ['director', 'id', 'poster', 'title', 'year']; Ox.print('constructList', view); if (view == 'list' || view == 'calendar') { $list = new Ox.TextList({ @@ -519,14 +518,15 @@ app.constructList = function(view) { return { height: data.poster.height || 128, // fixme: remove later id: data['id'], - info: data[info], + info: data[['title', 'director'].indexOf(sort[0].key) > -1 ? 'year' : sort[0].key], title: data.title + (data.director ? ' (' + data.director + ')' : ''), - url: 'http://0xdb.org/' + data.id + '/poster.' + size + '.' + 'jpg', //url: data.poster.url.replace(/.jpg/, size + '.jpg'), + url: 'http://0xdb.org/' + data.id + '/poster.' + size + '.' + 'jpg', width: data.poster.width || 80 // fixme: remove later }; }, keys: keys, request: function(options) { + Ox.print('options, Query.toObject', options, app.Query.toObject()) app.request('find', $.extend(options, { query: app.Query.toObject() }), options.callback); @@ -907,12 +907,12 @@ app.constructMainMenu = function() { app.$ui.findSelect.selectItem(id); } else if (data.id == 'ordermovies') { var id = data.checked[0].id; - app.$ui.list.sort(user.ui.sort[0].key, id == 'ascending' ? '' : '-'); + app.$ui.list.sortList(user.ui.sort[0].key, id == 'ascending' ? '' : '-'); } else if (data.id == 'sortmovies') { var id = data.checked[0].id, operator = Ox.getObjectById(app.config.sortKeys, id).operator; app.$ui.mainMenu.checkItem('sortMenu_ordermovies_' + (operator === '' ? 'ascending' : 'descending')); - app.$ui.list.sort(id, operator); + app.$ui.list.sortList(id, operator); } }, click: function(event, data) { @@ -1941,4 +1941,4 @@ app.getGroupWidth = function(pos, panelWidth) { }); -*/ +*/ \ No newline at end of file From c516cfb121f67e5de5f9bc5e28a556969dadc64c Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 8 Sep 2010 18:35:03 +0200 Subject: [PATCH 2/2] add missing json config file --- pandora/static/json/pandora.json | 124 +++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 pandora/static/json/pandora.json diff --git a/pandora/static/json/pandora.json b/pandora/static/json/pandora.json new file mode 100644 index 000000000..820908b5b --- /dev/null +++ b/pandora/static/json/pandora.json @@ -0,0 +1,124 @@ +{ + "findKeys": [ + {"id": "all", "title": "All"}, + {"id": "title", "title": "Title", "autocomplete": true}, + {"id": "director", "title": "Director", "autocomplete": true}, + {"id": "country", "title": "Country", "autocomplete": true}, + {"id": "year", "title": "Year", "autocomplete": true}, + {"id": "language", "title": "Language", "autocomplete": true}, + {"id": "writer", "title": "Writer", "autocomplete": true}, + {"id": "producer", "title": "Producer", "autocomplete": true}, + {"id": "cinematographer", "title": "Cinematographer", "autocomplete": true}, + {"id": "editor", "title": "Editor", "autocomplete": true}, + {"id": "actor", "title": "Actor", "autocomplete": true}, + {"id": "character", "title": "Character", "autocomplete": true}, + {"id": "name", "title": "Name", "autocomplete": true}, + {"id": "genre", "title": "Genre", "autocomplete": true}, + {"id": "keyword", "title": "Keyword", "autocomplete": true}, + {"id": "summary", "title": "Summary"}, + {"id": "dialog", "title": "Dialog"} + ], + "groups": ["director", "country", "year", "language", "genre"], + "itemViews": [ + {"id": "info", "title": "Info"}, + {"id": "statistics", "title": "Statistics"}, + {"id": "clips", "title": "Clips"}, + {"id": "timeline", "title": "Timeline"}, + {"id": "map", "title": "Map"}, + {"id": "calendar", "title": "Calendar"}, + {"id": "files", "title": "Files", "admin": true} + ], + "listViews": [ + {"id": "list", "title": "as List"}, + {"id": "icons", "title": "as Icons"}, + {"id": "info", "title": "with Info"}, + {"id": "clips", "title": "with Clips"}, + {"id": "timelines", "title": "with Timelines"}, + {"id": "maps", "title": "with Maps"}, + {"id": "calendars", "title": "with Calendars"}, + {"id": "clip", "title": "as Clips"}, + {"id": "map", "title": "on Map"}, + {"id": "calendar", "title": "on Calendar"} + ], + "sections": [ + {"id": "history", "title": "History"}, + {"id": "lists", "title": "My Lists"}, + {"id": "public", "title": "Public Lists"}, + {"id": "featured", "title": "Featured Lists"} + ], + "sortKeys": [ + {"id": "title", "title": "Title", "operator": "", "align": "left", "width": 180, "removable": false}, + {"id": "director", "title": "Director", "operator": "", "align": "left", "width": 180, "removable": false}, + {"id": "country", "title": "Country", "operator": "", "align": "left", "width": 120}, + {"id": "year", "title": "Year", "operator": "-", "align": "right", "width": 60}, + {"id": "language", "title": "Language", "operator": "", "align": "left", "width": 120}, + {"id": "runtime", "title": "Runtime", "operator": "-", "align": "right", "width": 60}, + {"id": "writer", "title": "Writer", "operator": "", "align": "left", "width": 180}, + {"id": "producer", "title": "Producer", "operator": "", "align": "left", "width": 180}, + {"id": "cinematographer", "title": "Cinematographer", "operator": "", "align": "left", "width": 180}, + {"id": "editor", "title": "Editor", "operator": "", "align": "left", "width": 180}, + {"id": "actors", "title": "Number of Actors", "operator": "-", "align": "right", "width": 60}, + {"id": "genre", "title": "Genre", "operator": "", "align": "left", "width": 120}, + {"id": "keywords", "title": "Number of Keywords", "operator": "-", "align": "right", "width": 60}, + {"id": "summary", "title": "Words in Summary", "operator": "-", "align": "right", "width": 60}, + {"id": "trivia", "title": "Words in Trivia", "operator": "-", "align": "right", "width": 60}, + {"id": "releasedate", "title": "Release Date", "operator": "-", "align": "left", "width": 90}, + {"id": "budget", "title": "Budget", "operator": "-", "align": "right", "width": 90}, + {"id": "gross", "title": "Gross", "operator": "-", "align": "right", "width": 90}, + {"id": "profit", "title": "Profit", "operator": "-", "align": "right", "width": 90}, + {"id": "rating", "title": "Rating", "operator": "-", "align": "right", "width": 60}, + {"id": "votes", "title": "Votes", "operator": "-", "align": "right", "width": 90}, + {"id": "id", "title": "ID", "operator": "", "align": "left", "width": 90}, + {"id": "aspectratio", "title": "Aspect Ratio", "operator": "-", "align": "left", "width": 90}, + {"id": "duration", "title": "Duration", "operator": "-", "align": "right", "width": 90}, + {"id": "color", "title": "Color", "operator": "", "align": "left", "width": 90}, + {"id": "saturation", "title": "Saturation", "operator": "-", "align": "right", "width": 60}, + {"id": "brightness", "title": "Brightness", "operator": "-", "align": "right", "width": 60}, + {"id": "volume", "title": "Volume", "operator": "-", "align": "right", "width": 60}, + {"id": "clips", "title": "Clips", "operator": "-", "align": "right", "width": 60}, + {"id": "cuts", "title": "Cuts", "operator": "-", "align": "right", "width": 60}, + {"id": "cutsperminute", "title": "Cuts per Minute", "operator": "-", "align": "right", "width": 60}, + {"id": "words", "title": "Words", "operator": "-", "align": "right", "width": 60}, + {"id": "wordsperminute", "title": "Words per Minute", "operator": "-", "align": "right", "width": 60}, + {"id": "resolution", "title": "Resolution", "operator": "-", "align": "left", "width": 90}, + {"id": "pixels", "title": "Pixels", "operator": "-", "align": "right", "width": 90}, + {"id": "size", "title": "Size", "operator": "-", "align": "right", "width": 90}, + {"id": "bitrate", "title": "Bitrate", "operator": "-", "align": "right", "width": 90}, + {"id": "files", "title": "Files", "operator": "-", "align": "right", "width": 60}, + {"id": "filename", "title": "Filename", "operator": "", "align": "left", "width": 180}, + {"id": "published", "title": "Date Published", "operator": "-", "align": "left", "width": 90}, + {"id": "modified", "title": "Date Modified", "operator": "-", "align": "left", "width": 90} + ], + "totals": [ + {"id": "items"}, + {"id": "runtime"}, + {"id": "files", "admin": true}, + {"id": "duration", "admin": true}, + {"id": "size", "admin": true}, + {"id": "pixels"} + ], + "user": { + "group": "guest", + "preferences": {}, + "ui": { + "columns": ["id", "title", "director", "country", "year", "language", "genre"], + "findQuery": {"conditions": [{"key": "", "value": "", "operator": ""}], "operator": ""}, + "groupsQuery": {"conditions": [], "operator": "|"}, + "groupsSize": 128, + "itemView": "info", + "listQuery": {"conditions": [], "operator": ""}, + "listsSize": 192, + "listView": "icons", + "sections": ["history", "lists", "public", "featured"], + "showGroups": true, + "showInfo": true, + "showLists": true, + "showMovies": true, + "sort": [ + {"key": "director", "operator": ""} + ], + "theme": "classic" + }, + "username": "" + } +} \ No newline at end of file