# HG changeset patch # User Brian Neal # Date 1285030375 0 # Node ID 2ba1a6d3b98408b6e046159d597924a7cc43aabb # Parent e43b1be24ccc7a2beafef2a9e465dadc251e32e6 Close #104; downloads javascript has incorrect hard-coded path to star graphics. Also correct count fields in downloads category fixture. diff -r e43b1be24ccc -r 2ba1a6d3b984 gpp/downloads/fixtures/downloads_categories.json --- a/gpp/downloads/fixtures/downloads_categories.json Tue Sep 21 00:26:38 2010 +0000 +++ b/gpp/downloads/fixtures/downloads_categories.json Tue Sep 21 00:52:55 2010 +0000 @@ -43,7 +43,7 @@ "pk": 3, "model": "downloads.category", "fields": { - "count": 2, + "count": 0, "description": "Anything else.", "slug": "misc", "title": "Misc" @@ -79,4 +79,4 @@ "title": "Tablature" } } -] \ No newline at end of file +] diff -r e43b1be24ccc -r 2ba1a6d3b984 gpp/urls.py --- a/gpp/urls.py Tue Sep 21 00:26:38 2010 +0000 +++ b/gpp/urls.py Tue Sep 21 00:52:55 2010 +0000 @@ -56,5 +56,5 @@ if settings.DEBUG: urlpatterns += patterns('', - (r'^static/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), + (r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) diff -r e43b1be24ccc -r 2ba1a6d3b984 media/js/downloads/rating.js --- a/media/js/downloads/rating.js Tue Sep 21 00:26:38 2010 +0000 +++ b/media/js/downloads/rating.js Tue Sep 21 00:52:55 2010 +0000 @@ -5,7 +5,7 @@ for (var i = 0; i <= event.data; ++i) { var star = $(stars[i]); - star.attr('src', '/static/downloads/stars/rating_over.gif'); + star.attr('src', '/media/downloads/stars/rating_over.gif'); } } @@ -16,7 +16,7 @@ for (var i = 0; i <= event.data; ++i) { var star = $(stars[i]); - star.attr('src', '/static/downloads/stars/rating_' + star.attr('class') + '.gif'); + star.attr('src', '/media/downloads/stars/rating_' + star.attr('class') + '.gif'); } } @@ -48,19 +48,19 @@ s.removeClass(s.attr('class')); if (rating >= 1.0) { - s.attr('src', '/static/downloads/stars/rating_on.gif'); + s.attr('src', '/media/downloads/stars/rating_on.gif'); s.addClass('on') rating -= 1.0; } else if (rating >= 0.5) { - s.attr('src', '/static/downloads/stars/rating_half.gif'); + s.attr('src', '/media/downloads/stars/rating_half.gif'); s.addClass('half') rating = 0; } else { - s.attr('src', '/static/downloads/stars/rating_off.gif'); + s.attr('src', '/media/downloads/stars/rating_off.gif'); s.addClass('off') } } @@ -89,19 +89,19 @@ var star = $(''); if (rating >= 1) { - star.attr('src', '/static/downloads/stars/rating_on.gif'); + star.attr('src', '/media/downloads/stars/rating_on.gif'); star.addClass('on') --rating; } else if (rating >= 0.5) { - star.attr('src', '/static/downloads/stars/rating_half.gif'); + star.attr('src', '/media/downloads/stars/rating_half.gif'); star.addClass('half') rating = 0; } else { - star.attr('src', '/static/downloads/stars/rating_off.gif'); + star.attr('src', '/media/downloads/stars/rating_off.gif'); star.addClass('off') } star.attr('alt', 'star');