Skip to content

Commit

Permalink
allow to not include jquery
Browse files Browse the repository at this point in the history
  • Loading branch information
ouhouhsami committed Sep 10, 2013
1 parent 03be327 commit 2378842
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -53,6 +53,12 @@ Requirements :
(r'^progressbarupload/', include('progressbarupload.urls')),
```

5. In your settings file, if you don't want to include jquery with {% progress_bar_media %}, then set:

``` python
PROGRESSBARUPLOAD_INCLUDE_JQUERY = False
```

Usage
-----

Expand Down
13 changes: 9 additions & 4 deletions progressbarupload/templatetags/progress_bar.py
@@ -1,8 +1,11 @@
import uuid
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse

from django import template
from django.forms.widgets import Media
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse

from progressbarupload.settings import PROGRESSBARUPLOAD_INCLUDE_JQUERY

register = template.Library()

Expand Down Expand Up @@ -31,6 +34,8 @@ def progress_bar_media():
return rendered script tag for javascript used by progress_bar
"""
m = Media(js=["http://code.jquery.com/jquery-1.8.3.min.js",
"js/progress_bar.js"])
js = ["js/progress_bar.js",]
if PROGRESSBARUPLOAD_INCLUDE_JQUERY:
js.append("http://code.jquery.com/jquery-1.8.3.min.js")
m = Media(js=js)
return m.render()
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -9,7 +9,7 @@

setup(
name = 'django-progressbarupload',
version = '0.1.5',
version = '0.1.6',
packages = find_packages(),
include_package_data = True,
license = 'BSD License',
Expand Down

0 comments on commit 2378842

Please sign in to comment.