From 24434a73eda06315041bedc7d9c3b43b91720ff2 Mon Sep 17 00:00:00 2001 From: rolux Date: Tue, 7 Sep 2010 01:44:56 +0200 Subject: [PATCH] adapt for icon view --- pandora/archive/migrations/0003_file_time.py | 9 ++++-- pandora/archive/migrations/0004_file_name.py | 2 +- pandora/backend/migrations/0006_poster.py | 2 +- pandora/static/js/pandora.js | 31 ++++++++++---------- pandora/templates/index.html | 1 - requirements.txt | 4 +-- 6 files changed, 26 insertions(+), 23 deletions(-) diff --git a/pandora/archive/migrations/0003_file_time.py b/pandora/archive/migrations/0003_file_time.py index c5d2847..9a446a7 100644 --- a/pandora/archive/migrations/0003_file_time.py +++ b/pandora/archive/migrations/0003_file_time.py @@ -9,13 +9,16 @@ class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'FileInstance.ctime' - db.alter_column('archive_fileinstance', 'ctime', self.gf('django.db.models.fields.IntegerField')()) + db.delete_column('archive_fileinstance', 'ctime') + db.add_column('archive_fileinstance', 'ctime', self.gf('django.db.models.fields.IntegerField')()) # Changing field 'FileInstance.mtime' - db.alter_column('archive_fileinstance', 'mtime', self.gf('django.db.models.fields.IntegerField')()) + db.delete_column('archive_fileinstance', 'mtime') + db.add_column('archive_fileinstance', 'mtime', self.gf('django.db.models.fields.IntegerField')()) # Changing field 'FileInstance.atime' - db.alter_column('archive_fileinstance', 'atime', self.gf('django.db.models.fields.IntegerField')()) + db.delete_column('archive_fileinstance', 'atime') + db.add_column('archive_fileinstance', 'atime', self.gf('django.db.models.fields.IntegerField')()) def backwards(self, orm): diff --git a/pandora/archive/migrations/0004_file_name.py b/pandora/archive/migrations/0004_file_name.py index ef783e4..9d78a33 100644 --- a/pandora/archive/migrations/0004_file_name.py +++ b/pandora/archive/migrations/0004_file_name.py @@ -15,7 +15,7 @@ class Migration(SchemaMigration): db.add_column('archive_fileinstance', 'name', self.gf('django.db.models.fields.CharField')(default='', max_length=2048), keep_default=False) # Removing unique constraint on 'FileInstance', fields ['volume', 'path', 'folder'] - db.delete_unique('archive_fileinstance', ['volume_id', 'path', 'folder']) + #db.delete_unique('archive_fileinstance', ['volume_id', 'path', 'folder']) # Adding unique constraint on 'FileInstance', fields ['volume', 'folder', 'name'] db.create_unique('archive_fileinstance', ['volume_id', 'folder', 'name']) diff --git a/pandora/backend/migrations/0006_poster.py b/pandora/backend/migrations/0006_poster.py index d6beef8..0fe7c48 100644 --- a/pandora/backend/migrations/0006_poster.py +++ b/pandora/backend/migrations/0006_poster.py @@ -9,7 +9,7 @@ class Migration(SchemaMigration): def forwards(self, orm): # Removing M2M table for field movies on 'list' - db.delete_table('backend_list_movies') + #db.delete_table('backend_list_movies') # Deleting field 'movie.stream_mid' db.delete_column('backend_movie', 'stream_mid') diff --git a/pandora/static/js/pandora.js b/pandora/static/js/pandora.js index f5c99c9..6158afc 100755 --- a/pandora/static/js/pandora.js +++ b/pandora/static/js/pandora.js @@ -38,13 +38,17 @@ var app = new Ox.App({ app.$ui.app = app.constructApp(); + ///* app.$body.css({ opacity: 0 }); + //*/ app.$ui.app.appendTo(app.$body); + ///* app.$body.animate({ opacity: 1 }, 2000); + //*/ Ox.Request.requests() && app.$ui.loadingIcon.start(); Ox.Event.bind('', 'requestStart', function() { @@ -55,7 +59,7 @@ var app = new Ox.App({ Ox.print('requestStop') app.$ui.loadingIcon.stop(); }); - $.each(app.afterLaunch, function(i, fn){ fn() }); + }); @@ -485,7 +489,9 @@ app.constructInfo = function() { } app.constructList = function(view) { - var $list; + 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]); Ox.print('constructList', view); if (view == 'list' || view == 'calendar') { $list = new Ox.TextList({ @@ -511,29 +517,24 @@ app.constructList = function(view) { id: 'list', item: function(data, sort, size) { return { - height: data.posterHeight, + height: data.poster.height || 128, // fixme: remove later id: data['id'], - info: data[$.inArray(sort[0].key, ['title', 'director']) > -1 ? 'year' : sort[0].key], + info: data[info], title: data.title + (data.director ? ' (' + data.director + ')' : ''), url: 'http://0xdb.org/' + data.id + '/poster.' + size + '.' + 'jpg', - width: data.posterWidth + width: data.poster.width || 80 // fixme: remove later }; }, - keys: ['director', 'id', 'posterHeight', 'posterWidth', 'posterURL', 'title'], + keys: keys, request: function(options) { app.request('find', $.extend(options, { query: app.Query.toObject() }), options.callback); }, size: 128, - sort: [ - { - key: 'director', - operator: '' - } - ], + sort: app.user.ui.sort, unique: 'id' - }).css('background', 'blue'); + }); } else { $list = new Ox.Element('
') .css({ @@ -1185,7 +1186,7 @@ app.constructMainMenu = function() { }, { element: app.$ui.map = new Ox.Map({ - places: ['Boston', 'Barcelona', 'Berlin', 'Beirut', 'Bombay', 'Bangalore', 'Beijing'] + places: ['Boston', 'Brussels', 'Barcelona', 'Berlin', 'Beirut', 'Bombay', 'Bangalore', 'Beijing'] }).css({ left: 0, top: 0, @@ -1940,4 +1941,4 @@ app.getGroupWidth = function(pos, panelWidth) { }); -*/ +*/ \ No newline at end of file diff --git a/pandora/templates/index.html b/pandora/templates/index.html index d491379..171ff3d 100644 --- a/pandora/templates/index.html +++ b/pandora/templates/index.html @@ -12,7 +12,6 @@ - diff --git a/requirements.txt b/requirements.txt index b062c2a..d43808c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,10 @@ --e svn+http://code.djangoproject.com/svn/django/branches/releases/1.2.X/#egg=django +-e svn+http://code.djangoproject.com/svn/django/branches/releases/1.2.X#egg=django South chardet -e bzr+http://code.0x2620.org/python-ox/#egg=python-ox -e bzr+http://code.0x2620.org/python-oxdjango/#egg=python-oxdjango simplejson --e hg+https://django-ajax-filtered-fields.googlecode.com/hg/#egg=django-ajax-filtered-fields +#-e hg+https://django-ajax-filtered-fields.googlecode.com/hg/#egg=django-ajax-filtered-fields #rabbitmq interface -e git+git://github.com/ask/celery.git#egg=celery django-celery