parent
aff3476088
commit
89182f3c20
|
@ -76,7 +76,7 @@ a:hover > .small_icon {
|
||||||
|
|
||||||
/** page **/
|
/** page **/
|
||||||
.page > nav {
|
.page > nav {
|
||||||
width: 16em;
|
width: 20em;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,3 +215,10 @@ main.detail {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** section: playlist **/
|
||||||
|
.playlist .title {
|
||||||
|
font-style: italic;
|
||||||
|
color: #616161;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,6 @@ Sound.prototype = {
|
||||||
}, false
|
}, false
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
item.addEventListener('click', function(event) {
|
item.addEventListener('click', function(event) {
|
||||||
if(event.target.className.indexOf('action') != -1)
|
if(event.target.className.indexOf('action') != -1)
|
||||||
return;
|
return;
|
||||||
|
@ -119,7 +118,7 @@ Playlist.prototype = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
add: function(sound, container) {
|
add: function(sound, container, position) {
|
||||||
var sound_ = this.find(sound.streams);
|
var sound_ = this.find(sound.streams);
|
||||||
if(sound_)
|
if(sound_)
|
||||||
return sound_;
|
return sound_;
|
||||||
|
@ -128,9 +127,16 @@ Playlist.prototype = {
|
||||||
this.on_air = sound;
|
this.on_air = sound;
|
||||||
|
|
||||||
sound.make_item(this, this.item_);
|
sound.make_item(this, this.item_);
|
||||||
(container || this.playlist).appendChild(sound.item);
|
|
||||||
|
|
||||||
this.sounds.push(sound);
|
container = container || this.playlist;
|
||||||
|
if(position != undefined) {
|
||||||
|
container.insertBefore(sound.item, container.children[position]);
|
||||||
|
this.sounds.insert(position, 0, sound.item);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
container.appendChild(sound.item);
|
||||||
|
this.sounds.push(sound);
|
||||||
|
}
|
||||||
this.save();
|
this.save();
|
||||||
return sound;
|
return sound;
|
||||||
},
|
},
|
||||||
|
|
|
@ -15,7 +15,7 @@ var sound = player.playlist.add(
|
||||||
streams=[ {% for stream in streams %}'{{ stream }}',{% endfor %} ],
|
streams=[ {% for stream in streams %}'{{ stream }}',{% endfor %} ],
|
||||||
cover = undefined,
|
cover = undefined,
|
||||||
on_air = true
|
on_air = true
|
||||||
)
|
), undefined, 0
|
||||||
);
|
);
|
||||||
sound.item.className += ' live';
|
sound.item.className += ' live';
|
||||||
player.playlist.select(sound, false);
|
player.playlist.select(sound, false);
|
||||||
|
|
|
@ -1,2 +1,33 @@
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
|
import django.views.generic as generic
|
||||||
|
|
||||||
|
import foxcms.views as Views
|
||||||
|
|
||||||
|
import aircox.sections as sections
|
||||||
|
|
||||||
|
class DynamicListView(Views.View, generic.list.ListView):
|
||||||
|
list_info = None
|
||||||
|
|
||||||
|
def get_queryset(self):
|
||||||
|
self.list_info = {}
|
||||||
|
return sections.ListBase.from_request(request, context = self.list_info)
|
||||||
|
|
||||||
|
#def get_ordering(self):
|
||||||
|
# order = self.request.GET.get('order_by')
|
||||||
|
# if order:
|
||||||
|
# field = order[1:] if order['-'] else order
|
||||||
|
# else:
|
||||||
|
# field = 'pk'
|
||||||
|
# if field not in self.model.ordering_fields:
|
||||||
|
# return super().get_ordering()
|
||||||
|
# TODO replace 'asc' in ListBase into sorting field
|
||||||
|
|
||||||
|
def get_context_data(self, *args, **kwargs
|
||||||
|
context = super().get_context_data(*args, **kwargs)
|
||||||
|
if self.list_info:
|
||||||
|
context.update(self.list_info)
|
||||||
|
return context
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
1
notes.md
1
notes.md
|
@ -1,5 +1,6 @@
|
||||||
This file is used as a reminder, can be used as crappy documentation too.
|
This file is used as a reminder, can be used as crappy documentation too.
|
||||||
|
|
||||||
|
|
||||||
# conventions
|
# conventions
|
||||||
## coding style
|
## coding style
|
||||||
* name of classes relative to a class:
|
* name of classes relative to a class:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user