Skip to content

Commit

Permalink
Added a setting for the JAVASCRIPT_URL to make placement of the gener…
Browse files Browse the repository at this point in the history
…iccollections.js file easier
  • Loading branch information
Corey Oordt committed Aug 2, 2011
1 parent e922506 commit 7bdfb32
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions categories/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from editor.tree_editor import TreeEditor
from genericcollection import GenericCollectionTabularInline

from settings import ALLOW_SLUG_CHANGE, RELATION_MODELS
from settings import ALLOW_SLUG_CHANGE, RELATION_MODELS, JAVASCRIPT_URL
from categories import model_registry
from models import Category

Expand Down Expand Up @@ -97,7 +97,7 @@ class CategoryAdmin(TreeEditor, admin.ModelAdmin):
inlines = [InlineCategoryRelation,]

class Media:
js = (settings.STATIC_URL + 'js/genericcollections.js',)
js = (JAVASCRIPT_URL + 'genericcollections.js',)

admin.site.register(Category, CategoryAdmin)

Expand Down
1 change: 1 addition & 0 deletions categories/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'FK_REGISTRY': {},
'THUMBNAIL_UPLOAD_PATH': 'uploads/categories/thumbnails',
'THUMBNAIL_STORAGE': settings.DEFAULT_FILE_STORAGE,
'JAVASCRIPT_URL': getattr(settings, 'STATIC_URL', settings.MEDIA_URL) + 'js/',
}

DEFAULT_SETTINGS.update(getattr(settings, 'CATEGORIES_SETTINGS', {}))
Expand Down
9 changes: 8 additions & 1 deletion doc_src/reference/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,11 @@ THUMBNAIL_STORAGE

**Default:** ``settings.DEFAULT_FILE_STORAGE``

**Description:** How to store the thumbnails. Allows for external storage engines like S3.
**Description:** How to store the thumbnails. Allows for external storage engines like S3.

JAVASCRIPT_URL
==============

**Default:** ``STATIC_URL or MEDIA_URL + 'js/'``

**Description:** Allows for customization of javascript placement.

0 comments on commit 7bdfb32

Please sign in to comment.