Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ include README.markdown
include LICENSE.markdown
recursive-include src/orderable/locale *
recursive-include src/orderable/templates *.html
recursive-include src/orderable/media *.js
recursive-include src/orderable/static *.js
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
'templates/orderable/change_list.html',
'templates/orderable/edit_inline/stacked.html',
'templates/orderable/edit_inline/tabular.html',
'media/orderable/orderable.js',
'static/orderable/orderable.js',
'locale/*/LC_MESSAGES/django.*',
]
},
Expand Down
6 changes: 3 additions & 3 deletions src/orderable/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django import forms
from django.contrib import admin

from orderable.settings import JQUERY_URL, JQUERYUI_URL, ORDERABLE_MEDIA_URL
from orderable.settings import JQUERY_URL, JQUERYUI_URL, ORDERABLE_STATIC_URL

class OrderableAdmin(admin.ModelAdmin):
exclude = ('order',)
Expand All @@ -13,7 +13,7 @@ class OrderableAdmin(admin.ModelAdmin):

class Media:
js = (JQUERY_URL, JQUERYUI_URL,
posixpath.join(ORDERABLE_MEDIA_URL, 'orderable/orderable.js'))
posixpath.join(ORDERABLE_STATIC_URL, 'orderable/orderable.js'))

def __init__(self, *args, **kwargs):
super(OrderableAdmin, self).__init__(*args, **kwargs)
Expand All @@ -28,7 +28,7 @@ class OrderableInline(object):

class Media:
js = (JQUERY_URL, JQUERYUI_URL,
posixpath.join(ORDERABLE_MEDIA_URL, 'orderable/orderable.js'))
posixpath.join(ORDERABLE_STATIC_URL, 'orderable/orderable.js'))

class OrderableStackedInline(OrderableInline, admin.StackedInline):
template = 'orderable/edit_inline/stacked.html'
Expand Down
8 changes: 4 additions & 4 deletions src/orderable/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ def is_valid(url):
'http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js')

if not is_valid(JQUERY_URL):
JQUERY_URL = posixpath.join(settings.MEDIA_URL, JQUERY_URL)
JQUERY_URL = posixpath.join(settings.STATIC_URL, JQUERY_URL)

JQUERYUI_URL = getattr(settings, 'JQUERYUI_URL',
'http://ajax.googleapis.com/ajax/libs/jqueryui/1.7/jquery-ui.min.js')

if not is_valid(JQUERYUI_URL):
JQUERYUI_URL = posixpath.join(settings.MEDIA_URL, JQUERYUI_URL)
JQUERYUI_URL = posixpath.join(settings.STATIC_URL, JQUERYUI_URL)

ORDERABLE_MEDIA_URL = getattr(settings, 'ORDERABLE_MEDIA_URL',
settings.MEDIA_URL)
ORDERABLE_STATIC_URL = getattr(settings, 'ORDERABLE_STATIC_URL',
settings.STATIC_URL)
4 changes: 2 additions & 2 deletions src/orderable/tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@

ROOT_URLCONF = 'orderable.tests.urls'

MEDIA_ROOT = os.path.join(ORDERABLE_ROOT, 'media')
MEDIA_URL = '/static/'
STATIC_ROOT = os.path.join(ORDERABLE_ROOT, 'static')
STATIC_URL = '/static/'
4 changes: 2 additions & 2 deletions src/orderable/tests/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
view = include(site.urls),
),
url(
regex = r'^%s(?P<path>.*)$' % settings.MEDIA_URL[1:],
regex = r'^%s(?P<path>.*)$' % settings.STATIC_URL[1:],
view = 'django.views.static.serve',
kwargs = {'document_root': settings.MEDIA_ROOT}
kwargs = {'document_root': settings.STATIC_URL}
),
)