changeset 255:2ba1a6d3b984

Close #104; downloads javascript has incorrect hard-coded path to star graphics. Also correct count fields in downloads category fixture.
author Brian Neal <bgneal@gmail.com>
date Tue, 21 Sep 2010 00:52:55 +0000
parents e43b1be24ccc
children 9c82c7984884
files gpp/downloads/fixtures/downloads_categories.json gpp/urls.py media/js/downloads/rating.js
diffstat 3 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- 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
+]
--- 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<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
+      (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
    )
--- 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 = $('<img />');
             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');