From 18810602fbab66f69cab93d6ee8151ed5e54ad7f Mon Sep 17 00:00:00 2001 From: rolux Date: Sun, 2 Oct 2011 21:50:38 +0000 Subject: [PATCH] update mapview --- pandora/clip/models.py | 2 +- static/js/pandora/ui/mapView.js | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pandora/clip/models.py b/pandora/clip/models.py index aec284af..99cbeb84 100644 --- a/pandora/clip/models.py +++ b/pandora/clip/models.py @@ -32,7 +32,7 @@ class Clip(models.Model): hue = models.FloatField(default=0, db_index=True) saturation = models.FloatField(default=0, db_index=True) lightness = models.FloatField(default=0, db_index=True) - volume = models.FloatField(default=0, db_index=True) + volume = models.FloatField(default=0, null=True, db_index=True) def update_calculated_values(self): self.duration = self.end - self.start diff --git a/static/js/pandora/ui/mapView.js b/static/js/pandora/ui/mapView.js index 323879dc..5d7aac95 100644 --- a/static/js/pandora/ui/mapView.js +++ b/static/js/pandora/ui/mapView.js @@ -43,6 +43,7 @@ pandora.ui.mapView = function(videoRatio) { var id = data.id || ''; updateToolbar(id ? data : null); if (id && id[0] != '_') { + $status.html('loading...'); $list.options({ items: function(data, callback) { var itemQuery; @@ -54,7 +55,7 @@ pandora.ui.mapView = function(videoRatio) { operator: '&' }; } - return pandora.api.findClips(Ox.extend({ + return pandora.api.findAnnotations(Ox.extend({ itemQuery: itemQuery, query: { conditions: [{key: 'place', value: id, operator:'=='}], @@ -193,7 +194,10 @@ pandora.ui.mapView = function(videoRatio) { } function updateStatusbar(items) { - $status.html((items || 'No') + ' clip' + (items == 1 ? '' : 's')); + $status.html( + (items ? Ox.formatNumber(items) : 'No') + + ' clip' + (items == 1 ? '' : 's') + ); } function updateToolbar(place) { @@ -221,4 +225,4 @@ pandora.ui.mapView = function(videoRatio) { return that; -}; +}; \ No newline at end of file