Moved comments inline in mix page

This commit is contained in:
=
2012-09-19 21:39:16 +01:00
parent b6bc118ba2
commit fbe14f7fa9
540 changed files with 112 additions and 79 deletions

0
LICENSE Executable file → Normal file
View File

0
README Executable file → Normal file
View File

0
_working/create Executable file → Normal file
View File

0
_working/event.sql Executable file → Normal file
View File

0
_working/label.sql Executable file → Normal file
View File

0
_working/mix.sql Executable file → Normal file
View File

0
_working/recurrence.sql Executable file → Normal file
View File

0
_working/release.sql Executable file → Normal file
View File

0
_working/release_audio.sql Executable file → Normal file
View File

0
_working/social.sql Executable file → Normal file
View File

0
_working/venue.sql Executable file → Normal file
View File

0
apache/django_live.wsgi Executable file → Normal file
View File

0
core/__init__.py Executable file → Normal file
View File

0
core/analytics/__init__.py Executable file → Normal file
View File

0
core/analytics/google.py Executable file → Normal file
View File

0
core/decorators.py Executable file → Normal file
View File

0
core/serialisers/__init__.py Executable file → Normal file
View File

0
core/serialisers/json.py Executable file → Normal file
View File

0
core/social/Facebook.py Executable file → Normal file
View File

0
core/social/_Social.py Executable file → Normal file
View File

0
core/social/__init__.py Executable file → Normal file
View File

0
core/tasks.py Executable file → Normal file
View File

0
core/tests/__init__.py Executable file → Normal file
View File

0
core/tests/mix.py Executable file → Normal file
View File

0
core/utils/__init__.py Executable file → Normal file
View File

0
core/utils/file.py Executable file → Normal file
View File

0
core/utils/html.py Executable file → Normal file
View File

0
core/utils/live.py Executable file → Normal file
View File

14
core/utils/string.py Normal file
View File

@@ -0,0 +1,14 @@
__author__ = 'fergalm'
import re
def lreplace(string, pattern, sub):
"""
Replaces 'pattern' in 'string' with 'sub' if 'pattern' starts 'string'.
"""
return re.sub('^%s' % pattern, sub, string)
def rreplace(string, pattern, sub):
"""
Replaces 'pattern' in 'string' with 'sub' if 'pattern' ends 'string'.
"""
return re.sub('%s$' % pattern, sub, string)

0
core/utils/waveform.py Executable file → Normal file
View File

0
core/widgets/__init__.py Executable file → Normal file
View File

0
core/widgets/upload.py Executable file → Normal file
View File

0
dss/__init__.py Executable file → Normal file
View File

0
dss/settings.py Executable file → Normal file
View File

0
dss/urls.py Executable file → Normal file
View File

0
dss/wsgi.py Executable file → Normal file
View File

0
initial_data.json Executable file → Normal file
View File

0
manage.py Executable file → Normal file
View File

0
requirements.txt Executable file → Normal file
View File

0
spa/__init__.py Executable file → Normal file
View File

0
spa/admin.py Executable file → Normal file
View File

0
spa/ajax.py Executable file → Normal file
View File

0
spa/api/__init__.py Executable file → Normal file
View File

0
spa/api/v1/BackboneCompatibleResource.py Executable file → Normal file
View File

0
spa/api/v1/CommentResource.py Executable file → Normal file
View File

0
spa/api/v1/EventResource.py Executable file → Normal file
View File

0
spa/api/v1/MixResource.py Executable file → Normal file
View File

0
spa/api/v1/ReleaseAudioResource.py Executable file → Normal file
View File

0
spa/api/v1/ReleaseResource.py Executable file → Normal file
View File

0
spa/api/v1/UserResource.py Executable file → Normal file
View File

0
spa/api/v1/__init__.py Executable file → Normal file
View File

0
spa/audio.py Executable file → Normal file
View File

0
spa/forms.py Executable file → Normal file
View File

0
spa/management/__init__.py Executable file → Normal file
View File

0
spa/management/commands/__init__.py Executable file → Normal file
View File

0
spa/management/commands/cleanup.py Executable file → Normal file
View File

0
spa/management/commands/drop.py Executable file → Normal file
View File

0
spa/management/commands/purchaselinks.py Executable file → Normal file
View File

0
spa/management/commands/tracklists.py Executable file → Normal file
View File

0
spa/management/commands/waveforms.py Executable file → Normal file
View File

0
spa/models/Comment.py Executable file → Normal file
View File

0
spa/models/Event.py Executable file → Normal file
View File

0
spa/models/Label.py Executable file → Normal file
View File

0
spa/models/Mix.py Executable file → Normal file
View File

0
spa/models/MixFavourite.py Executable file → Normal file
View File

0
spa/models/MixLike.py Executable file → Normal file
View File

0
spa/models/MixPlay.py Executable file → Normal file
View File

0
spa/models/PurchaseLink.py Executable file → Normal file
View File

0
spa/models/Recurrence.py Executable file → Normal file
View File

0
spa/models/Release.py Executable file → Normal file
View File

0
spa/models/Tracklist.py Executable file → Normal file
View File

0
spa/models/UserProfile.py Executable file → Normal file
View File

0
spa/models/Venue.py Executable file → Normal file
View File

0
spa/models/_Activity.py Executable file → Normal file
View File

0
spa/models/_BaseModel.py Executable file → Normal file
View File

0
spa/models/_Lookup.py Executable file → Normal file
View File

0
spa/models/__init__.py Executable file → Normal file
View File

27
spa/social.py Executable file → Normal file
View File

@@ -30,22 +30,26 @@ def _getPayload(request):
"site_image_url": '%s/img/dss-large.png' % settings.STATIC_URL,
}
def mix(request, mix_id):
def mix(request, args):
try:
mix = Mix.objects.get(pk=mix_id)
mix = Mix.objects.get(pk=args['mix_id'])
except Mix.DoesNotExist:
raise Http404
image = mix.get_image_url()
audio_url = mix.get_stream_path()
redirect_url = mix.get_absolute_url()
mix_url = mix.get_absolute_url()
default = _getPayload(request)
extras = {
"description" : mix.title,
"image_url" : image,
"audio_url" : 'http://%s:%s%s' % (Site.objects.get_current().domain, request.META['SERVER_PORT'], audio_url),
"mix_url" : 'http://%s:%s%s' % (Site.objects.get_current().domain, request.META['SERVER_PORT'], mix_url)
}
payload = dict(default.items() + extras.items())
response = render_to_response(
'inc/facebook/mix.html',
_getPayload(request) + {
"description" : mix.title,
"audio_url" : 'http://%s:%s%s' % (Site.objects.get_current().domain, request.META['SERVER_PORT'], audio_url),
"redirect" : 'http://%s:%s#%s' % (Site.objects.get_current().domain, request.META['SERVER_PORT'], redirect_url)
},
payload,
context_instance = RequestContext(request)
)
return response
@@ -59,8 +63,11 @@ def index(request):
def social_redirect(request):
try:
resolver = resolve('/social' + request.path.replace('#', ''))
resolver = resolve('/social' + request.path)
if resolver is not None:
return resolver.func(request)
return resolver.func(request, resolver.kwargs)
except Http404:
return index(request)
except Exception, ex:
return index(request)

0
spa/templates.py Executable file → Normal file
View File

0
spa/templatetags/__init__.py Executable file → Normal file
View File

0
spa/templatetags/spa_extras.py Executable file → Normal file
View File

0
spa/urls.py Executable file → Normal file
View File

8
spa/views.py Executable file → Normal file
View File

@@ -1,6 +1,7 @@
from django.shortcuts import render_to_response, redirect
from django.template.context import RequestContext
import re
from core.utils.string import lreplace, rreplace
from spa.social import social_redirect
def _app(request):
@@ -15,8 +16,11 @@ def app(request):
context_instance=RequestContext(request))
def default(request):
backbone_url = "http://%s/#%s" % (request.get_host(), re.sub('/$', '', request.path))
return redirect(backbone_url)
if request.META['HTTP_USER_AGENT'].startswith('facebookexternalhit'):
return social_redirect(request)
else:
backbone_url = "http://%s/#%s" % (request.get_host(), rreplace(lreplace(request.path, '/', ''), '/', ''))
return redirect(backbone_url)
def upload(request):
return render_to_response("inc/upload.html", context_instance=RequestContext(request))

0
static/bin/sm/soundmanager2.swf Executable file → Normal file
View File

0
static/bin/sm/soundmanager2_debug.swf Executable file → Normal file
View File

0
static/bin/sm/soundmanager2_flash9.swf Executable file → Normal file
View File

0
static/bin/sm/soundmanager2_flash9_debug.swf Executable file → Normal file
View File

0
static/bin/sm/soundmanager2_flash_xdomain.zip Executable file → Normal file
View File

0
static/css/bootstrap/bootstrap-datepicker.css vendored Executable file → Normal file
View File

0
static/css/bootstrap/bootstrap-responsive.css vendored Executable file → Normal file
View File

0
static/css/bootstrap/bootstrap-responsive.min.css vendored Executable file → Normal file
View File

0
static/css/bootstrap/bootstrap-timepicker.css vendored Executable file → Normal file
View File

0
static/css/bootstrap/bootstrap.css vendored Executable file → Normal file
View File

0
static/css/bootstrap/bootstrap.min.css vendored Executable file → Normal file
View File

0
static/css/colorbox.css Executable file → Normal file
View File

0
static/css/com.podnoms.player.css Executable file → Normal file
View File

0
static/css/deepsouthsounds.css Executable file → Normal file
View File

0
static/css/jasny/jasny-bootstrap-responsive.css Executable file → Normal file
View File

0
static/css/jasny/jasny-bootstrap-responsive.min.css vendored Executable file → Normal file
View File

0
static/css/jasny/jasny-bootstrap.css Executable file → Normal file
View File

Some files were not shown because too many files have changed in this diff Show More