diff gpp/core/widgets.py @ 6:b6263ac72052

Use DRY principle to manage third party javascript libraries. Created script_tags template tags to generate the correct link and script tags for 3rd party libraries. The settings.py file is the only place where the full path name is specified.
author Brian Neal <bgneal@gmail.com>
date Sat, 11 Apr 2009 22:50:56 +0000
parents dbd703f7d63a
children cc8eb028def1
line wrap: on
line diff
--- a/gpp/core/widgets.py	Sat Apr 11 19:45:17 2009 +0000
+++ b/gpp/core/widgets.py	Sat Apr 11 22:50:56 2009 +0000
@@ -5,19 +5,15 @@
 from django import forms
 from django.utils.safestring import mark_safe
 from django.core.urlresolvers import reverse
+from django.conf import settings
 
 
 class AutoCompleteUserInput(forms.TextInput):
     class Media:
         css = {
-            'all': ('js/jquery-autocomplete/jquery.autocomplete.css',)
+            'all': settings.GPP_THIRD_PARTY_CSS['jquery-autocomplete'],
         }
-        js = (
-            'js/jquery-autocomplete/lib/jquery.js',
-            'js/jquery-autocomplete/lib/jquery.bgiframe.min.js',
-            'js/jquery-autocomplete/lib/jquery.ajaxQueue.js',
-            'js/jquery-autocomplete/jquery.autocomplete.js'
-        )
+        js = settings.GPP_THIRD_PARTY_JS['jquery-autocomplete']
 
     def render(self, name, value, attrs=None):
         url = reverse('messages-ajax_users')