mirror of
https://github.com/fergalmoran/dss.git
synced 2025-12-26 11:37:33 +00:00
Added favourites to mix screen
This commit is contained in:
0
_working/create
Executable file → Normal file
0
_working/create
Executable file → Normal file
@@ -109,6 +109,7 @@ MIDDLEWARE_CLASSES = (
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
'django.middleware.gzip.GZipMiddleware',
|
||||
'debug_toolbar.middleware.DebugToolbarMiddleware',
|
||||
#'pipeline.middleware.MinifyHTMLMiddleware'
|
||||
)
|
||||
|
||||
@@ -127,6 +128,7 @@ INSTALLED_APPS = (
|
||||
'django.contrib.admindocs',
|
||||
'django_facebook',
|
||||
'djcelery',
|
||||
'debug_toolbar',
|
||||
'crispy_forms',
|
||||
'sorl.thumbnail',
|
||||
#'pipeline',
|
||||
|
||||
@@ -22,7 +22,7 @@ class MixResource(BackboneCompatibleResource):
|
||||
if 'sort' in request.GET and request.GET['sort']:
|
||||
sort = request.GET['sort']
|
||||
|
||||
return Mix.get_listing(sort)
|
||||
return Mix.get_listing(sort, request.user)
|
||||
|
||||
def dehydrate_mix_image(self, bundle):
|
||||
return bundle.obj.get_image()
|
||||
|
||||
@@ -61,7 +61,7 @@ class Mix(_BaseModel):
|
||||
return settings.MEDIA_URL + self.local_file.name
|
||||
|
||||
@classmethod
|
||||
def get_listing(cls, listing_type):
|
||||
def get_listing(cls, listing_type, user=None):
|
||||
queryset = None
|
||||
if listing_type == 'latest':
|
||||
queryset = Mix.objects.all().order_by( 'id')
|
||||
@@ -79,7 +79,9 @@ class Mix(_BaseModel):
|
||||
.order_by('-karma')
|
||||
elif listing_type == 'recommended':
|
||||
queryset = Mix.objects.all().order_by( '-id')
|
||||
|
||||
elif listing_type == 'favourites':
|
||||
queryset = Mix.objects.filter(favourites__user=user).order_by('favourites__date')
|
||||
debug = queryset.query
|
||||
return queryset
|
||||
|
||||
@classmethod
|
||||
|
||||
0
static/bin/sm/soundmanager2.swf
Executable file → Normal file
0
static/bin/sm/soundmanager2.swf
Executable file → Normal file
0
static/bin/sm/soundmanager2_debug.swf
Executable file → Normal file
0
static/bin/sm/soundmanager2_debug.swf
Executable file → Normal file
0
static/bin/sm/soundmanager2_flash9.swf
Executable file → Normal file
0
static/bin/sm/soundmanager2_flash9.swf
Executable file → Normal file
0
static/bin/sm/soundmanager2_flash9_debug.swf
Executable file → Normal file
0
static/bin/sm/soundmanager2_flash9_debug.swf
Executable file → Normal file
0
static/bin/sm/soundmanager2_flash_xdomain.zip
Executable file → Normal file
0
static/bin/sm/soundmanager2_flash_xdomain.zip
Executable file → Normal file
@@ -9,7 +9,6 @@
|
||||
<meta property="og:title" content="{{ description }}" />
|
||||
<meta property="og:image" content="{{ image_url }}" />
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
window.location = '{{ redirect }}'
|
||||
</script>
|
||||
|
||||
@@ -4,5 +4,8 @@
|
||||
<li><a href="#/mixes/mostplayed" id='mostplayed'>Most Played</a></li>
|
||||
<li><a href="#/mixes/mostactive" id='mostactive'>Most Active</a></li>
|
||||
<li><a href="#/mixes/recommended" id='recommended'>Recommended</a></li>
|
||||
{% if user.is_authenticated %}
|
||||
<li><a href="#/mixes/favourites" id='favourites'>Favourites</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
<div id="mix-list-container"></div>
|
||||
Reference in New Issue
Block a user