diff --git a/django/contrib/admin/helpers.py b/django/contrib/admin/helpers.py index 57c74434f53..d713652ba44 100644 --- a/django/contrib/admin/helpers.py +++ b/django/contrib/admin/helpers.py @@ -74,7 +74,7 @@ class Fieldset(object): def _media(self): if 'collapse' in self.classes: extra = '' if settings.DEBUG else '.min' - js = ['jquery%s.js' % extra, + js = ['vendor/jquery/jquery%s.js' % extra, 'jquery.init.js', 'collapse%s.js' % extra] return forms.Media(js=[static('admin/js/%s' % url) for url in js]) diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index cc20872049a..9534fad6f47 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -566,7 +566,7 @@ class ModelAdmin(BaseModelAdmin): js = [ 'core.js', 'admin/RelatedObjectLookups.js', - 'jquery%s.js' % extra, + 'vendor/jquery/jquery%s.js' % extra, 'jquery.init.js', 'actions%s.js' % extra, 'urlify.js', @@ -1759,7 +1759,8 @@ class InlineModelAdmin(BaseModelAdmin): @property def media(self): extra = '' if settings.DEBUG else '.min' - js = ['jquery%s.js' % extra, 'jquery.init.js', 'inlines%s.js' % extra] + js = ['vendor/jquery/jquery%s.js' % extra, 'jquery.init.js', + 'inlines%s.js' % extra] if self.filter_vertical or self.filter_horizontal: js.extend(['SelectBox.js', 'SelectFilter2.js']) return forms.Media(js=[static('admin/js/%s' % url) for url in js]) diff --git a/django/contrib/admin/static/admin/js/LICENSE-JQUERY.txt b/django/contrib/admin/static/admin/js/vendor/jquery/LICENSE-JQUERY.txt similarity index 100% rename from django/contrib/admin/static/admin/js/LICENSE-JQUERY.txt rename to django/contrib/admin/static/admin/js/vendor/jquery/LICENSE-JQUERY.txt diff --git a/django/contrib/admin/static/admin/js/jquery.js b/django/contrib/admin/static/admin/js/vendor/jquery/jquery.js similarity index 100% rename from django/contrib/admin/static/admin/js/jquery.js rename to django/contrib/admin/static/admin/js/vendor/jquery/jquery.js diff --git a/django/contrib/admin/static/admin/js/jquery.min.js b/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js similarity index 100% rename from django/contrib/admin/static/admin/js/jquery.min.js rename to django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js diff --git a/docs/releases/1.9.txt b/docs/releases/1.9.txt index ffa17391ecd..a3fb56c6c0f 100644 --- a/docs/releases/1.9.txt +++ b/docs/releases/1.9.txt @@ -597,6 +597,9 @@ Miscellaneous * CSS and images in ``contrib.admin`` to support Internet Explorer 6 & 7 have been removed as these browsers have reached end-of-life. +* The jQuery static files in ``contrib.admin`` have been moved into a + ``vendor/jquery`` subdirectory. + * The text displayed for null columns in the admin changelist ``list_display`` cells has changed from ``(None)`` (or its translated equivalent) to ``-``. diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 825242c48c6..b0c74b31fa0 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -1104,8 +1104,8 @@ class AdminJavaScriptTest(TestCase): """ with override_settings(DEBUG=False): response = self.client.get(reverse('admin:admin_views_section_add')) - self.assertNotContains(response, 'jquery.js') - self.assertContains(response, 'jquery.min.js') + self.assertNotContains(response, 'vendor/jquery/jquery.js') + self.assertContains(response, 'vendor/jquery/jquery.min.js') self.assertNotContains(response, 'prepopulate.js') self.assertContains(response, 'prepopulate.min.js') self.assertNotContains(response, 'actions.js') @@ -1116,8 +1116,8 @@ class AdminJavaScriptTest(TestCase): self.assertContains(response, 'inlines.min.js') with override_settings(DEBUG=True): response = self.client.get(reverse('admin:admin_views_section_add')) - self.assertContains(response, 'jquery.js') - self.assertNotContains(response, 'jquery.min.js') + self.assertContains(response, 'vendor/jquery/jquery.js') + self.assertNotContains(response, 'vendor/jquery/jquery.min.js') self.assertContains(response, 'prepopulate.js') self.assertNotContains(response, 'prepopulate.min.js') self.assertContains(response, 'actions.js')