update mapview

This commit is contained in:
rolux 2011-10-02 21:50:38 +00:00
parent a333e6b1b0
commit 18810602fb
2 changed files with 8 additions and 4 deletions

View file

@ -32,7 +32,7 @@ class Clip(models.Model):
hue = models.FloatField(default=0, db_index=True) hue = models.FloatField(default=0, db_index=True)
saturation = models.FloatField(default=0, db_index=True) saturation = models.FloatField(default=0, db_index=True)
lightness = 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): def update_calculated_values(self):
self.duration = self.end - self.start self.duration = self.end - self.start

View file

@ -43,6 +43,7 @@ pandora.ui.mapView = function(videoRatio) {
var id = data.id || ''; var id = data.id || '';
updateToolbar(id ? data : null); updateToolbar(id ? data : null);
if (id && id[0] != '_') { if (id && id[0] != '_') {
$status.html('loading...');
$list.options({ $list.options({
items: function(data, callback) { items: function(data, callback) {
var itemQuery; var itemQuery;
@ -54,7 +55,7 @@ pandora.ui.mapView = function(videoRatio) {
operator: '&' operator: '&'
}; };
} }
return pandora.api.findClips(Ox.extend({ return pandora.api.findAnnotations(Ox.extend({
itemQuery: itemQuery, itemQuery: itemQuery,
query: { query: {
conditions: [{key: 'place', value: id, operator:'=='}], conditions: [{key: 'place', value: id, operator:'=='}],
@ -193,7 +194,10 @@ pandora.ui.mapView = function(videoRatio) {
} }
function updateStatusbar(items) { 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) { function updateToolbar(place) {
@ -221,4 +225,4 @@ pandora.ui.mapView = function(videoRatio) {
return that; return that;
}; };