mirror of
https://github.com/jazzband/django-categories.git
synced 2026-03-16 22:30:24 +00:00
Added a setting for the JAVASCRIPT_URL to make placement of the genericcollections.js file easier
This commit is contained in:
parent
e922506fd9
commit
7bdfb32474
3 changed files with 11 additions and 3 deletions
|
|
@ -7,7 +7,7 @@ from mptt.forms import TreeNodeChoiceField
|
|||
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
|
||||
|
||||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ DEFAULT_SETTINGS = {
|
|||
'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', {}))
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
Loading…
Reference in a new issue