Fixed #16050 -- BACKWARDS-INCOMPATIBLE CHANGE: Moved static files of the admin to conventional file system location.

This also removes the need for ADMIN_MEDIA_PREFIX and replaces it with the convention to find admin's static files at STATIC_URL + 'admin/'.

Thanks to Jacob for the review and general help.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16487 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel 2011-06-30 09:06:19 +00:00
parent 89e0e8b6bc
commit 38a2444277
118 changed files with 485 additions and 418 deletions

View File

@ -68,8 +68,11 @@ class BaseSettings(object):
"""
def __setattr__(self, name, value):
if name in ("MEDIA_URL", "STATIC_URL") and value and not value.endswith('/'):
warnings.warn('If set, %s must end with a slash' % name,
warnings.warn("If set, %s must end with a slash" % name,
DeprecationWarning)
elif name == "ADMIN_MEDIA_PREFIX":
warnings.warn("The ADMIN_MEDIA_PREFIX setting has been removed; "
"use STATIC_URL instead.", DeprecationWarning)
object.__setattr__(self, name, value)

View File

@ -593,8 +593,3 @@ STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
# URL prefix for admin media -- CSS, JavaScript and images.
# Make sure to use a trailing slash.
# Examples: "http://foo.com/static/admin/", "/static/admin/".
ADMIN_MEDIA_PREFIX = '/static/admin/'

View File

@ -62,11 +62,6 @@ STATIC_ROOT = ''
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'
# URL prefix for admin static files -- CSS, JavaScript and images.
# Make sure to use a trailing slash.
# Examples: "http://foo.com/static/admin/", "/static/admin/".
ADMIN_MEDIA_PREFIX = '/static/admin/'
# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".

View File

@ -1,5 +1,4 @@
from django import forms
from django.conf import settings
from django.contrib.admin.util import (flatten_fieldsets, lookup_field,
display_for_field, label_for_field, help_text_for_field)
from django.contrib.contenttypes.models import ContentType
@ -75,8 +74,8 @@ class Fieldset(object):
def _media(self):
if 'collapse' in self.classes:
js = ['js/jquery.min.js', 'js/jquery.init.js', 'js/collapse.min.js']
return forms.Media(js=['%s%s' % (settings.ADMIN_MEDIA_PREFIX, url) for url in js])
js = ['jquery.min.js', 'jquery.init.js', 'collapse.min.js']
return forms.Media(js=['admin/js/%s' % url for url in js])
return forms.Media()
media = property(_media)

View File

@ -349,19 +349,19 @@ class ModelAdmin(BaseModelAdmin):
urls = property(urls)
def _media(self):
from django.conf import settings
js = ['js/core.js', 'js/admin/RelatedObjectLookups.js',
'js/jquery.min.js', 'js/jquery.init.js']
js = [
'core.js',
'admin/RelatedObjectLookups.js',
'jquery.min.js',
'jquery.init.js'
]
if self.actions is not None:
js.extend(['js/actions.min.js'])
js.append('actions.min.js')
if self.prepopulated_fields:
js.append('js/urlify.js')
js.append('js/prepopulate.min.js')
js.extend(['urlify.js', 'prepopulate.min.js'])
if self.opts.get_ordered_objects():
js.extend(['js/getElementsBySelector.js', 'js/dom-drag.js' , 'js/admin/ordering.js'])
return forms.Media(js=['%s%s' % (settings.ADMIN_MEDIA_PREFIX, url) for url in js])
js.extend(['getElementsBySelector.js', 'dom-drag.js' , 'admin/ordering.js'])
return forms.Media(js=['admin/js/%s' % url for url in js])
media = property(_media)
def has_add_permission(self, request):
@ -1321,14 +1321,12 @@ class InlineModelAdmin(BaseModelAdmin):
self.verbose_name_plural = self.model._meta.verbose_name_plural
def _media(self):
from django.conf import settings
js = ['js/jquery.min.js', 'js/jquery.init.js', 'js/inlines.min.js']
js = ['jquery.min.js', 'jquery.init.js', 'inlines.min.js']
if self.prepopulated_fields:
js.append('js/urlify.js')
js.append('js/prepopulate.min.js')
js.extend(['urlify.js, prepopulate.min.js'])
if self.filter_vertical or self.filter_horizontal:
js.extend(['js/SelectBox.js' , 'js/SelectFilter2.js'])
return forms.Media(js=['%s%s' % (settings.ADMIN_MEDIA_PREFIX, url) for url in js])
js.extend(['SelectBox.js', 'SelectFilter2.js'])
return forms.Media(js=['admin/js/%s' % url for url in js])
media = property(_media)
def get_formset(self, request, obj=None, **kwargs):

View File

@ -259,7 +259,7 @@ tfoot td {
color: #666;
padding: 2px 5px;
font-size: 11px;
background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x;
background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x;
border-left: 1px solid #ddd;
border-bottom: 1px solid #ddd;
}
@ -311,7 +311,7 @@ thead th a:link, thead th a:visited {
}
thead th.sorted {
background: #c5c5c5 url(../img/admin/nav-bg-selected.gif) top left repeat-x;
background: #c5c5c5 url(../img/nav-bg-selected.gif) top left repeat-x;
}
table thead th.sorted a {
@ -319,11 +319,11 @@ table thead th.sorted a {
}
table thead th.ascending a {
background: url(../img/admin/arrow-up.gif) right .4em no-repeat;
background: url(../img/arrow-up.gif) right .4em no-repeat;
}
table thead th.descending a {
background: url(../img/admin/arrow-down.gif) right .4em no-repeat;
background: url(../img/arrow-down.gif) right .4em no-repeat;
}
table thead th.sorted a span.text {
@ -368,7 +368,7 @@ table thead th.sorted a span.clear {
#sorting-popup-div .cancel {
font-size: 10px;
background: #e1e1e1 url(../img/admin/nav-bg.gif) 0 50% repeat-x;
background: #e1e1e1 url(../img/nav-bg.gif) 0 50% repeat-x;
border-top: 1px solid #ddd;
text-align: center;
}
@ -386,7 +386,7 @@ table.orderable tbody tr td:hover {
table.orderable tbody tr td:first-child {
padding-left: 14px;
background-image: url(../img/admin/nav-bg-grabber.gif);
background-image: url(../img/nav-bg-grabber.gif);
background-repeat: repeat-y;
}
@ -416,7 +416,7 @@ input[type=text], input[type=password], textarea, select, .vTextField {
/* FORM BUTTONS */
.button, input[type=submit], input[type=button], .submit-row input {
background: white url(../img/admin/nav-bg.gif) bottom repeat-x;
background: white url(../img/nav-bg.gif) bottom repeat-x;
padding: 3px 5px;
color: black;
border: 1px solid #bbb;
@ -424,31 +424,31 @@ input[type=text], input[type=password], textarea, select, .vTextField {
}
.button:active, input[type=submit]:active, input[type=button]:active {
background-image: url(../img/admin/nav-bg-reverse.gif);
background-image: url(../img/nav-bg-reverse.gif);
background-position: top;
}
.button[disabled], input[type=submit][disabled], input[type=button][disabled] {
background-image: url(../img/admin/nav-bg.gif);
background-image: url(../img/nav-bg.gif);
background-position: bottom;
opacity: 0.4;
}
.button.default, input[type=submit].default, .submit-row input.default {
border: 2px solid #5b80b2;
background: #7CA0C7 url(../img/admin/default-bg.gif) bottom repeat-x;
background: #7CA0C7 url(../img/default-bg.gif) bottom repeat-x;
font-weight: bold;
color: white;
float: right;
}
.button.default:active, input[type=submit].default:active {
background-image: url(../img/admin/default-bg-reverse.gif);
background-image: url(../img/default-bg-reverse.gif);
background-position: top;
}
.button[disabled].default, input[type=submit][disabled].default, input[type=button][disabled].default {
background-image: url(../img/admin/default-bg.gif);
background-image: url(../img/default-bg.gif);
background-position: bottom;
opacity: 0.4;
}
@ -485,7 +485,7 @@ input[type=text], input[type=password], textarea, select, .vTextField {
font-size: 11px;
text-align: left;
font-weight: bold;
background: #7CA0C7 url(../img/admin/default-bg.gif) top left repeat-x;
background: #7CA0C7 url(../img/default-bg.gif) top left repeat-x;
color: white;
}
@ -507,15 +507,15 @@ ul.messagelist li {
margin: 0 0 3px 0;
border-bottom: 1px solid #ddd;
color: #666;
background: #ffc url(../img/admin/icon_success.gif) 5px .3em no-repeat;
background: #ffc url(../img/icon_success.gif) 5px .3em no-repeat;
}
ul.messagelist li.warning{
background-image: url(../img/admin/icon_alert.gif);
background-image: url(../img/icon_alert.gif);
}
ul.messagelist li.error{
background-image: url(../img/admin/icon_error.gif);
background-image: url(../img/icon_error.gif);
}
.errornote {
@ -525,7 +525,7 @@ ul.messagelist li.error{
margin: 0 0 3px 0;
border: 1px solid red;
color: red;
background: #ffc url(../img/admin/icon_error.gif) 5px .3em no-repeat;
background: #ffc url(../img/icon_error.gif) 5px .3em no-repeat;
}
ul.errorlist {
@ -540,7 +540,7 @@ ul.errorlist {
margin: 0 0 3px 0;
border: 1px solid red;
color: white;
background: red url(../img/admin/icon_alert.gif) 5px .3em no-repeat;
background: red url(../img/icon_alert.gif) 5px .3em no-repeat;
}
.errorlist li a {
@ -576,7 +576,7 @@ div.system-message p.system-message-title {
padding: 4px 5px 4px 25px;
margin: 0;
color: red;
background: #ffc url(../img/admin/icon_error.gif) 5px .3em no-repeat;
background: #ffc url(../img/icon_error.gif) 5px .3em no-repeat;
}
.description {
@ -587,7 +587,7 @@ div.system-message p.system-message-title {
/* BREADCRUMBS */
div.breadcrumbs {
background: white url(../img/admin/nav-bg-reverse.gif) 0 -10px repeat-x;
background: white url(../img/nav-bg-reverse.gif) 0 -10px repeat-x;
padding: 2px 8px 3px 8px;
font-size: 11px;
color: #999;
@ -600,17 +600,17 @@ div.breadcrumbs {
.addlink {
padding-left: 12px;
background: url(../img/admin/icon_addlink.gif) 0 .2em no-repeat;
background: url(../img/icon_addlink.gif) 0 .2em no-repeat;
}
.changelink {
padding-left: 12px;
background: url(../img/admin/icon_changelink.gif) 0 .2em no-repeat;
background: url(../img/icon_changelink.gif) 0 .2em no-repeat;
}
.deletelink {
padding-left: 12px;
background: url(../img/admin/icon_deletelink.gif) 0 .25em no-repeat;
background: url(../img/icon_deletelink.gif) 0 .25em no-repeat;
}
a.deletelink:link, a.deletelink:visited {
@ -645,14 +645,14 @@ a.deletelink:hover {
.object-tools li {
display: block;
float: left;
background: url(../img/admin/tool-left.gif) 0 0 no-repeat;
background: url(../img/tool-left.gif) 0 0 no-repeat;
padding: 0 0 0 8px;
margin-left: 2px;
height: 16px;
}
.object-tools li:hover {
background: url(../img/admin/tool-left_over.gif) 0 0 no-repeat;
background: url(../img/tool-left_over.gif) 0 0 no-repeat;
}
.object-tools a:link, .object-tools a:visited {
@ -661,29 +661,29 @@ a.deletelink:hover {
color: white;
padding: .1em 14px .1em 8px;
height: 14px;
background: #999 url(../img/admin/tool-right.gif) 100% 0 no-repeat;
background: #999 url(../img/tool-right.gif) 100% 0 no-repeat;
}
.object-tools a:hover, .object-tools li:hover a {
background: #5b80b2 url(../img/admin/tool-right_over.gif) 100% 0 no-repeat;
background: #5b80b2 url(../img/tool-right_over.gif) 100% 0 no-repeat;
}
.object-tools a.viewsitelink, .object-tools a.golink {
background: #999 url(../img/admin/tooltag-arrowright.gif) top right no-repeat;
background: #999 url(../img/tooltag-arrowright.gif) top right no-repeat;
padding-right: 28px;
}
.object-tools a.viewsitelink:hover, .object-tools a.golink:hover {
background: #5b80b2 url(../img/admin/tooltag-arrowright_over.gif) top right no-repeat;
background: #5b80b2 url(../img/tooltag-arrowright_over.gif) top right no-repeat;
}
.object-tools a.addlink {
background: #999 url(../img/admin/tooltag-add.gif) top right no-repeat;
background: #999 url(../img/tooltag-add.gif) top right no-repeat;
padding-right: 28px;
}
.object-tools a.addlink:hover {
background: #5b80b2 url(../img/admin/tooltag-add_over.gif) top right no-repeat;
background: #5b80b2 url(../img/tooltag-add_over.gif) top right no-repeat;
}
/* OBJECT HISTORY */
@ -818,7 +818,7 @@ table#change-history tbody th {
}
#content-related .module h2 {
background: #eee url(../img/admin/nav-bg.gif) bottom left repeat-x;
background: #eee url(../img/nav-bg.gif) bottom left repeat-x;
color: #666;
}

View File

@ -20,7 +20,7 @@
}
.change-list .filtered {
background: white url(../img/admin/changelist-bg.gif) top right repeat-y !important;
background: white url(../img/changelist-bg.gif) top right repeat-y !important;
}
.change-list .filtered .results, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull {
@ -40,7 +40,7 @@
color: #666;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
background: white url(../img/admin/nav-bg.gif) 0 180% repeat-x;
background: white url(../img/nav-bg.gif) 0 180% repeat-x;
overflow: hidden;
}
@ -82,7 +82,7 @@
#changelist #toolbar {
padding: 3px;
border-bottom: 1px solid #ddd;
background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x;
background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x;
color: #666;
}
@ -156,7 +156,7 @@
.change-list ul.toplinks {
display: block;
background: white url(../img/admin/nav-bg-reverse.gif) 0 -10px repeat-x;
background: white url(../img/nav-bg-reverse.gif) 0 -10px repeat-x;
border-top: 1px solid white;
float: left;
padding: 0 !important;
@ -246,7 +246,7 @@
padding: 3px;
border-top: 1px solid #fff;
border-bottom: 1px solid #ddd;
background: white url(../img/admin/nav-bg-reverse.gif) 0 -10px repeat-x;
background: white url(../img/nav-bg-reverse.gif) 0 -10px repeat-x;
}
#changelist .actions.selected {

View File

@ -140,7 +140,7 @@ fieldset.collapsed h2, fieldset.collapsed {
}
fieldset.collapsed h2 {
background-image: url(../img/admin/nav-bg.gif);
background-image: url(../img/nav-bg.gif);
background-position: bottom left;
color: #999;
}
@ -161,7 +161,7 @@ fieldset.monospace textarea {
.submit-row {
padding: 5px 7px;
text-align: right;
background: white url(../img/admin/nav-bg.gif) 0 100% repeat-x;
background: white url(../img/nav-bg.gif) 0 100% repeat-x;
border: 1px solid #ccc;
margin: 5px 0;
overflow: hidden;
@ -184,7 +184,7 @@ body.popup .submit-row {
}
.submit-row .deletelink {
background: url(../img/admin/icon_deletelink.gif) 0 50% no-repeat;
background: url(../img/icon_deletelink.gif) 0 50% no-repeat;
padding-left: 14px;
}
@ -251,7 +251,7 @@ body.popup .submit-row {
color: #666;
padding: 3px 5px;
font-size: 11px;
background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x;
background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x;
border-bottom: 1px solid #ddd;
}
@ -336,7 +336,7 @@ body.popup .submit-row {
color: #666;
padding: 3px 5px;
border-bottom: 1px solid #ddd;
background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x;
background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x;
}
.inline-group .tabular tr.add-row td {
@ -347,7 +347,7 @@ body.popup .submit-row {
.inline-group ul.tools a.add,
.inline-group div.add-row a,
.inline-group .tabular tr.add-row td a {
background: url(../img/admin/icon_addlink.gif) 0 50% no-repeat;
background: url(../img/icon_addlink.gif) 0 50% no-repeat;
padding-left: 14px;
font-size: 11px;
outline: 0; /* Remove dotted border around link */

View File

@ -53,5 +53,5 @@
/* IE doesn't know alpha transparency in PNGs */
.inline-deletelink {
background: transparent url(../img/admin/inline-delete-8bit.png) no-repeat;
background: transparent url(../img/inline-delete-8bit.png) no-repeat;
}

View File

@ -113,7 +113,7 @@ table thead th.sorted a span.sortpos {
}
.change-list .filtered {
background: white url(../img/admin/changelist-bg_rtl.gif) top left repeat-y !important;
background: white url(../img/changelist-bg_rtl.gif) top left repeat-y !important;
}
.change-list .filtered table {
@ -170,7 +170,7 @@ table thead th.sorted a span.sortpos {
}
.submit-row .deletelink {
background: url(../img/admin/icon_deletelink.gif) 0 50% no-repeat;
background: url(../img/icon_deletelink.gif) 0 50% no-repeat;
padding-right: 14px;
}

View File

@ -22,7 +22,7 @@
}
.selector .selector-available h2 {
background: white url(../img/admin/nav-bg.gif) bottom left repeat-x;
background: white url(../img/nav-bg.gif) bottom left repeat-x;
color: #666;
}
@ -49,7 +49,7 @@
float: left;
width: 22px;
height: 50px;
background: url(../img/admin/chooser-bg.gif) top center no-repeat;
background: url(../img/chooser-bg.gif) top center no-repeat;
margin: 8em 3px 0 3px;
padding: 0;
}
@ -74,12 +74,12 @@
}
.selector-add {
background: url(../img/admin/selector-add.gif) top center no-repeat;
background: url(../img/selector-add.gif) top center no-repeat;
margin-bottom: 2px;
}
.selector-remove {
background: url(../img/admin/selector-remove.gif) top center no-repeat;
background: url(../img/selector-remove.gif) top center no-repeat;
}
a.selector-chooseall, a.selector-clearall {
@ -99,11 +99,11 @@ a.selector-chooseall:hover, a.selector-clearall:hover {
a.selector-chooseall {
width: 7em;
background: url(../img/admin/selector-addall.gif) left center no-repeat;
background: url(../img/selector-addall.gif) left center no-repeat;
}
a.selector-clearall {
background: url(../img/admin/selector-removeall.gif) left center no-repeat;
background: url(../img/selector-removeall.gif) left center no-repeat;
}
@ -135,7 +135,7 @@ a.selector-clearall {
height: 22px;
width: 50px;
margin: 0 0 3px 40%;
background: url(../img/admin/chooser_stacked-bg.gif) top center no-repeat;
background: url(../img/chooser_stacked-bg.gif) top center no-repeat;
}
.stacked .selector-chooser li {
@ -148,11 +148,11 @@ a.selector-clearall {
}
.stacked .selector-add {
background-image: url(../img/admin/selector_stacked-add.gif);
background-image: url(../img/selector_stacked-add.gif);
}
.stacked .selector-remove {
background-image: url(../img/admin/selector_stacked-remove.gif);
background-image: url(../img/selector_stacked-remove.gif);
}
@ -246,7 +246,7 @@ span.clearable-file-input label {
color: #666;
padding: 2px 3px;
text-align: center;
background: #e1e1e1 url(../img/admin/nav-bg.gif) 0 50% repeat-x;
background: #e1e1e1 url(../img/nav-bg.gif) 0 50% repeat-x;
border-bottom: 1px solid #ddd;
}
@ -314,7 +314,7 @@ span.clearable-file-input label {
position: absolute;
font-weight: bold;
font-size: 12px;
background: #C9DBED url(../img/admin/default-bg.gif) bottom left repeat-x;
background: #C9DBED url(../img/default-bg.gif) bottom left repeat-x;
padding: 1px 4px 2px 4px;
color: white;
}
@ -337,7 +337,7 @@ span.clearable-file-input label {
margin: 0 !important;
padding: 0;
font-size: 10px;
background: #e1e1e1 url(../img/admin/nav-bg.gif) 0 50% repeat-x;
background: #e1e1e1 url(../img/nav-bg.gif) 0 50% repeat-x;
border-top: 1px solid #ddd;
}
@ -374,7 +374,7 @@ ul.orderer li {
border-width: 0 1px 1px 0;
white-space: nowrap;
overflow: hidden;
background: #e2e2e2 url(../img/admin/nav-bg-grabber.gif) repeat-y;
background: #e2e2e2 url(../img/nav-bg-grabber.gif) repeat-y;
}
ul.orderer li:hover {
@ -406,7 +406,7 @@ ul.orderer li.selected {
}
ul.orderer li.deleted {
background: #bbb url(../img/admin/deleted-overlay.gif);
background: #bbb url(../img/deleted-overlay.gif);
}
ul.orderer li.deleted a:link, ul.orderer li.deleted a:visited {
@ -414,7 +414,7 @@ ul.orderer li.deleted a:link, ul.orderer li.deleted a:visited {
}
ul.orderer li.deleted .inline-deletelink {
background-image: url(../img/admin/inline-restore.png);
background-image: url(../img/inline-restore.png);
}
ul.orderer li.deleted:hover, ul.orderer li.deleted a.selector:hover {
@ -426,7 +426,7 @@ ul.orderer li.deleted:hover, ul.orderer li.deleted a.selector:hover {
.inline-deletelink {
float: right;
text-indent: -9999px;
background: transparent url(../img/admin/inline-delete.png) no-repeat;
background: transparent url(../img/inline-delete.png) no-repeat;
width: 15px;
height: 15px;
border: 0px none;
@ -465,11 +465,11 @@ ul.orderer li.deleted:hover, ul.orderer li.deleted a.selector:hover {
}
.editinline tr.deleted {
background: #ddd url(../img/admin/deleted-overlay.gif);
background: #ddd url(../img/deleted-overlay.gif);
}
.editinline tr.deleted .inline-deletelink {
background-image: url(../img/admin/inline-restore.png);
background-image: url(../img/inline-restore.png);
}
.editinline tr.deleted td:hover {
@ -500,13 +500,13 @@ ul.orderer li.deleted:hover, ul.orderer li.deleted a.selector:hover {
.editinline-stacked .inline-splitter {
float: left;
width: 9px;
background: #f8f8f8 url(../img/admin/inline-splitter-bg.gif) 50% 50% no-repeat;
background: #f8f8f8 url(../img/inline-splitter-bg.gif) 50% 50% no-repeat;
border-right: 1px solid #ccc;
}
.editinline-stacked .controls {
clear: both;
background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x;
background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x;
padding: 3px 4px;
font-size: 11px;
border-top: 1px solid #ddd;

View File

Before

Width:  |  Height:  |  Size: 80 B

After

Width:  |  Height:  |  Size: 80 B

View File

Before

Width:  |  Height:  |  Size: 838 B

After

Width:  |  Height:  |  Size: 838 B

View File

Before

Width:  |  Height:  |  Size: 58 B

After

Width:  |  Height:  |  Size: 58 B

View File

Before

Width:  |  Height:  |  Size: 75 B

After

Width:  |  Height:  |  Size: 75 B

View File

Before

Width:  |  Height:  |  Size: 199 B

After

Width:  |  Height:  |  Size: 199 B

View File

Before

Width:  |  Height:  |  Size: 212 B

After

Width:  |  Height:  |  Size: 212 B

View File

Before

Width:  |  Height:  |  Size: 843 B

After

Width:  |  Height:  |  Size: 843 B

View File

Before

Width:  |  Height:  |  Size: 844 B

After

Width:  |  Height:  |  Size: 844 B

View File

Before

Width:  |  Height:  |  Size: 45 B

After

Width:  |  Height:  |  Size: 45 B

View File

Before

Width:  |  Height:  |  Size: 711 B

After

Width:  |  Height:  |  Size: 711 B

View File

Before

Width:  |  Height:  |  Size: 506 B

After

Width:  |  Height:  |  Size: 506 B

View File

Before

Width:  |  Height:  |  Size: 176 B

After

Width:  |  Height:  |  Size: 176 B

View File

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 130 B

View File

Before

Width:  |  Height:  |  Size: 299 B

After

Width:  |  Height:  |  Size: 299 B

View File

Before

Width:  |  Height:  |  Size: 119 B

After

Width:  |  Height:  |  Size: 119 B

View File

Before

Width:  |  Height:  |  Size: 145 B

After

Width:  |  Height:  |  Size: 145 B

View File

Before

Width:  |  Height:  |  Size: 192 B

After

Width:  |  Height:  |  Size: 192 B

View File

Before

Width:  |  Height:  |  Size: 119 B

After

Width:  |  Height:  |  Size: 119 B

View File

Before

Width:  |  Height:  |  Size: 390 B

After

Width:  |  Height:  |  Size: 390 B

View File

Before

Width:  |  Height:  |  Size: 537 B

After

Width:  |  Height:  |  Size: 537 B

View File

Before

Width:  |  Height:  |  Size: 181 B

After

Width:  |  Height:  |  Size: 181 B

View File

Before

Width:  |  Height:  |  Size: 319 B

After

Width:  |  Height:  |  Size: 319 B

View File

Before

Width:  |  Height:  |  Size: 667 B

After

Width:  |  Height:  |  Size: 667 B

View File

Before

Width:  |  Height:  |  Size: 341 B

After

Width:  |  Height:  |  Size: 341 B

View File

Before

Width:  |  Height:  |  Size: 477 B

After

Width:  |  Height:  |  Size: 477 B

View File

Before

Width:  |  Height:  |  Size: 781 B

After

Width:  |  Height:  |  Size: 781 B

View File

Before

Width:  |  Height:  |  Size: 447 B

After

Width:  |  Height:  |  Size: 447 B

View File

Before

Width:  |  Height:  |  Size: 623 B

After

Width:  |  Height:  |  Size: 623 B

View File

Before

Width:  |  Height:  |  Size: 102 B

After

Width:  |  Height:  |  Size: 102 B

View File

Before

Width:  |  Height:  |  Size: 116 B

After

Width:  |  Height:  |  Size: 116 B

View File

Before

Width:  |  Height:  |  Size: 186 B

After

Width:  |  Height:  |  Size: 186 B

View File

Before

Width:  |  Height:  |  Size: 265 B

After

Width:  |  Height:  |  Size: 265 B

View File

Before

Width:  |  Height:  |  Size: 273 B

After

Width:  |  Height:  |  Size: 273 B

View File

Before

Width:  |  Height:  |  Size: 606 B

After

Width:  |  Height:  |  Size: 606 B

View File

Before

Width:  |  Height:  |  Size: 358 B

After

Width:  |  Height:  |  Size: 358 B

View File

Before

Width:  |  Height:  |  Size: 398 B

After

Width:  |  Height:  |  Size: 398 B

View File

Before

Width:  |  Height:  |  Size: 355 B

After

Width:  |  Height:  |  Size: 355 B

View File

Before

Width:  |  Height:  |  Size: 552 B

After

Width:  |  Height:  |  Size: 552 B

View File

Before

Width:  |  Height:  |  Size: 612 B

After

Width:  |  Height:  |  Size: 612 B

View File

Before

Width:  |  Height:  |  Size: 401 B

After

Width:  |  Height:  |  Size: 401 B

View File

Before

Width:  |  Height:  |  Size: 197 B

After

Width:  |  Height:  |  Size: 197 B

View File

Before

Width:  |  Height:  |  Size: 203 B

After

Width:  |  Height:  |  Size: 203 B

View File

Before

Width:  |  Height:  |  Size: 198 B

After

Width:  |  Height:  |  Size: 198 B

View File

Before

Width:  |  Height:  |  Size: 200 B

After

Width:  |  Height:  |  Size: 200 B

View File

Before

Width:  |  Height:  |  Size: 932 B

After

Width:  |  Height:  |  Size: 932 B

View File

Before

Width:  |  Height:  |  Size: 336 B

After

Width:  |  Height:  |  Size: 336 B

View File

Before

Width:  |  Height:  |  Size: 351 B

After

Width:  |  Height:  |  Size: 351 B

View File

Before

Width:  |  Height:  |  Size: 354 B

After

Width:  |  Height:  |  Size: 354 B

View File

@ -50,7 +50,7 @@ var SelectFilter = {
var search_filter_label = quickElement('label', filter_p, '', 'for', field_id + "_input", 'style', 'width:16px;padding:2px');
var search_selector_img = quickElement('img', search_filter_label, '', 'src', admin_media_prefix + 'img/admin/selector-search.gif');
var search_selector_img = quickElement('img', search_filter_label, '', 'src', admin_media_prefix + 'img/selector-search.gif');
search_selector_img.alt = gettext("Filter");
filter_p.appendChild(document.createTextNode(' '));
@ -75,7 +75,7 @@ var SelectFilter = {
quickElement('h2', selector_chosen, interpolate(gettext('Chosen %s'), [field_name]));
var selector_filter = quickElement('p', selector_chosen, gettext('Select your choice(s) and click '));
selector_filter.className = 'selector-filter';
quickElement('img', selector_filter, '', 'src', admin_media_prefix + (is_stacked ? 'img/admin/selector_stacked-add.gif':'img/admin/selector-add.gif'), 'alt', 'Add');
quickElement('img', selector_filter, '', 'src', admin_media_prefix + (is_stacked ? 'img/selector_stacked-add.gif':'img/selector-add.gif'), 'alt', 'Add');
var to_box = quickElement('select', selector_chosen, '', 'id', field_id + '_to', 'multiple', 'multiple', 'size', from_box.size, 'name', from_box.getAttribute('name'));
to_box.className = 'filtered';
var clear_all = quickElement('a', selector_chosen, gettext('Clear all'), 'href', 'javascript: (function() { SelectBox.move_all("' + field_id + '_to", "' + field_id + '_from");})()');

View File

@ -50,7 +50,7 @@ var DateTimeShortcuts = {
var clock_link = document.createElement('a');
clock_link.setAttribute('href', 'javascript:DateTimeShortcuts.openClock(' + num + ');');
clock_link.id = DateTimeShortcuts.clockLinkName + num;
quickElement('img', clock_link, '', 'src', DateTimeShortcuts.admin_media_prefix + 'img/admin/icon_clock.gif', 'alt', gettext('Clock'));
quickElement('img', clock_link, '', 'src', DateTimeShortcuts.admin_media_prefix + 'img/icon_clock.gif', 'alt', gettext('Clock'));
shortcuts_span.appendChild(document.createTextNode('\240'));
shortcuts_span.appendChild(now_link);
shortcuts_span.appendChild(document.createTextNode('\240|\240'));
@ -138,7 +138,7 @@ var DateTimeShortcuts = {
var cal_link = document.createElement('a');
cal_link.setAttribute('href', 'javascript:DateTimeShortcuts.openCalendar(' + num + ');');
cal_link.id = DateTimeShortcuts.calendarLinkName + num;
quickElement('img', cal_link, '', 'src', DateTimeShortcuts.admin_media_prefix + 'img/admin/icon_calendar.gif', 'alt', gettext('Calendar'));
quickElement('img', cal_link, '', 'src', DateTimeShortcuts.admin_media_prefix + 'img/icon_calendar.gif', 'alt', gettext('Calendar'));
shortcuts_span.appendChild(document.createTextNode('\240'));
shortcuts_span.appendChild(today_link);
shortcuts_span.appendChild(document.createTextNode('\240|\240'));

View File

@ -1,11 +1,11 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_modify adminmedia %}
{% load i18n static admin_modify %}
{% load url from future %}
{% block extrahead %}{{ block.super }}
{% url 'admin:jsi18n' as jsi18nurl %}
<script type="text/javascript" src="{{ jsi18nurl|default:"../../../../jsi18n/" }}"></script>
{% endblock %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/forms.css" />{% endblock %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %}
{% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %}
{% block breadcrumbs %}{% if not is_popup %}
<div class="breadcrumbs">

View File

@ -1,12 +1,12 @@
{% load url from future %}<!DOCTYPE html>
{% load static %}{% load url from future %}<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head>
<title>{% block title %}{% endblock %}</title>
<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/base.css{% endblock %}" />
<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% static "admin/css/base.css" %}{% endblock %}" />
{% block extrastyle %}{% endblock %}
<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{% block stylesheet_ie %}{% load adminmedia %}{% admin_media_prefix %}css/ie.css{% endblock %}" /><![endif]-->
{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% admin_media_prefix %}css/rtl.css{% endblock %}" />{% endif %}
<script type="text/javascript">window.__admin_media_prefix__ = "{% filter escapejs %}{% admin_media_prefix %}{% endfilter %}";</script>
<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{% block stylesheet_ie %}{% static "admin/css/ie.css" %}{% endblock %}" /><![endif]-->
{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}" />{% endif %}
<script type="text/javascript">window.__admin_media_prefix__ = "{% filter escapejs %}{% static "admin/" %}{% endfilter %}";</script>
{% block extrahead %}{% endblock %}
{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
</head>

View File

@ -1,5 +1,5 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_modify adminmedia %}
{% load i18n static admin_modify %}
{% load url from future %}
{% block extrahead %}{{ block.super }}
@ -8,7 +8,7 @@
{{ media }}
{% endblock %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/forms.css" />{% endblock %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %}
{% block coltype %}{% if ordered_objects %}colMS{% else %}colM{% endif %}{% endblock %}

View File

@ -1,11 +1,11 @@
{% extends "admin/base_site.html" %}
{% load adminmedia admin_list i18n %}
{% load i18n static admin_list %}
{% load url from future %}
{% block extrastyle %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/changelists.css" />
<link rel="stylesheet" type="text/css" href="{% static "admin/css/changelists.css" %}" />
{% if cl.formset %}
<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/forms.css" />
<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />
{% endif %}
{% if cl.formset or action_form %}
{% url 'admin:jsi18n' as jsi18nurl %}

View File

@ -1,5 +1,4 @@
{% load adminmedia %}
{% load i18n %}
{% load i18n static %}
{% if result_hidden_fields %}
<div class="hiddenfields">{# DIV for HTML validation #}
{% for item in result_hidden_fields %}{{ item }}{% endfor %}
@ -16,7 +15,7 @@
<span class="text">{{ header.text|capfirst }}</span>
{% if header.sortable %}
{% if header.sort_pos > 0 %}<span class="sortpos">
{% if header.sort_pos == 1 %}<img id="primary-sort-icon" src="{% admin_media_prefix %}img/admin/icon_cog.gif" alt="" />&nbsp;{% endif %}
{% if header.sort_pos == 1 %}<img id="primary-sort-icon" src="{% static "admin/img/icon_cog.gif" %}" alt="" />&nbsp;{% endif %}
{{ header.sort_pos }}</span>
{% endif %}
<span class="clear"></span></a>

View File

@ -1,4 +1,4 @@
{% load i18n adminmedia %}
{% load i18n static %}
<div class="inline-group" id="{{ inline_admin_formset.formset.prefix }}-group">
<h2>{{ inline_admin_formset.opts.verbose_name_plural|title }}</h2>
{{ inline_admin_formset.formset.management_form }}
@ -40,11 +40,11 @@
if (typeof SelectFilter != "undefined"){
$(".selectfilter").each(function(index, value){
var namearr = value.name.split('-');
SelectFilter.init(value.id, namearr[namearr.length-1], false, "{% admin_media_prefix %}");
SelectFilter.init(value.id, namearr[namearr.length-1], false, "{% static "admin/" %}");
});
$(".selectfilterstacked").each(function(index, value){
var namearr = value.name.split('-');
SelectFilter.init(value.id, namearr[namearr.length-1], true, "{% admin_media_prefix %}");
SelectFilter.init(value.id, namearr[namearr.length-1], true, "{% static "admin/" %}");
});
}
}

View File

@ -1,4 +1,4 @@
{% load i18n adminmedia admin_modify %}
{% load i18n static admin_modify %}
<div class="inline-group" id="{{ inline_admin_formset.formset.prefix }}-group">
<div class="tabular inline-related {% if forloop.last %}last-related{% endif %}">
{{ inline_admin_formset.formset.management_form }}
@ -86,11 +86,11 @@
if (typeof SelectFilter != "undefined"){
$(".selectfilter").each(function(index, value){
var namearr = value.name.split('-');
SelectFilter.init(value.id, namearr[namearr.length-1], false, "{% admin_media_prefix %}");
SelectFilter.init(value.id, namearr[namearr.length-1], false, "{% static "admin/" %}");
});
$(".selectfilterstacked").each(function(index, value){
var namearr = value.name.split('-');
SelectFilter.init(value.id, namearr[namearr.length-1], true, "{% admin_media_prefix %}");
SelectFilter.init(value.id, namearr[namearr.length-1], true, "{% static "admin/" %}");
});
}
}

View File

@ -1,7 +1,7 @@
{% extends "admin/base_site.html" %}
{% load i18n %}
{% load i18n static %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% load adminmedia %}{% admin_media_prefix %}css/dashboard.css" />{% endblock %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" />{% endblock %}
{% block coltype %}colMS{% endblock %}

View File

@ -1,7 +1,7 @@
{% extends "admin/base_site.html" %}
{% load i18n %}
{% load i18n static %}
{% block extrastyle %}{% load adminmedia %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/login.css" />{% endblock %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/login.css" %}" />{% endblock %}
{% block bodyclass %}login{% endblock %}

View File

@ -1,9 +1,8 @@
{% load adminmedia %}
{% load i18n %}
{% load i18n static %}
{% if cl.search_fields %}
<div id="toolbar"><form id="changelist-search" action="" method="get">
<div><!-- DIV needed for valid HTML -->
<label for="searchbar"><img src="{% admin_media_prefix %}img/admin/icon_searchbox.png" alt="Search" /></label>
<label for="searchbar"><img src="{% static "admin/img/icon_searchbox.png" %}" alt="Search" /></label>
<input type="text" size="40" name="{{ search_var }}" value="{{ cl.query }}" id="searchbar" />
<input type="submit" value="{% trans 'Search' %}" />
{% if show_result_count %}

View File

@ -1,7 +1,7 @@
{% extends "admin/base_site.html" %}
{% load i18n adminmedia %}
{% load i18n static %}
{% load url from future %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/forms.css" />{% endblock %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %}
{% block userlinks %}{% url 'django-admindocs-docroot' as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %} {% trans 'Change password' %} / <a href="../logout/">{% trans 'Log out' %}</a>{% endblock %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password change' %}</div>{% endblock %}

View File

@ -6,6 +6,7 @@ from django.contrib.admin.views.main import (ALL_VAR, EMPTY_CHANGELIST_VALUE,
ORDER_VAR, ORDER_TYPE_VAR, PAGE_VAR, SEARCH_VAR)
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.templatetags.static import static
from django.utils import formats
from django.utils.datastructures import SortedDict
from django.utils.html import escape, conditional_escape
@ -154,9 +155,9 @@ def result_headers(cl):
}
def _boolean_icon(field_val):
BOOLEAN_MAPPING = {True: 'yes', False: 'no', None: 'unknown'}
return mark_safe(u'<img src="%simg/admin/icon-%s.gif" alt="%s" />' %
(settings.ADMIN_MEDIA_PREFIX, BOOLEAN_MAPPING[field_val], field_val))
icon_url = static('admin/img/icon-%s.gif' %
{True: 'yes', False: 'no', None: 'unknown'}[field_val])
return mark_safe(u'<img src="%s" alt="%s" />' % (icon_url, field_val))
def items_for_result(cl, result, form):
"""

View File

@ -1,3 +1,4 @@
import warnings
from django.template import Library
from django.templatetags.static import PrefixNode
@ -8,4 +9,7 @@ def admin_media_prefix():
"""
Returns the string contained in the setting ADMIN_MEDIA_PREFIX.
"""
warnings.warn(
"The admin_media_prefix template tag is deprecated. "
"Use the static template tag instead.", PendingDeprecationWarning)
return PrefixNode.handle_simple("ADMIN_MEDIA_PREFIX")

View File

@ -4,15 +4,16 @@ Form Widget classes specific to the Django admin site.
import copy
from django import forms
from django.conf import settings
from django.core.urlresolvers import reverse, NoReverseMatch
from django.forms.widgets import RadioFieldRenderer
from django.forms.util import flatatt
from django.templatetags.static import static
from django.utils.html import escape
from django.utils.text import truncate_words
from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django.utils.encoding import force_unicode
from django.conf import settings
from django.core.urlresolvers import reverse, NoReverseMatch
class FilteredSelectMultiple(forms.SelectMultiple):
"""
@ -22,9 +23,8 @@ class FilteredSelectMultiple(forms.SelectMultiple):
catalog has been loaded in the page
"""
class Media:
js = (settings.ADMIN_MEDIA_PREFIX + "js/core.js",
settings.ADMIN_MEDIA_PREFIX + "js/SelectBox.js",
settings.ADMIN_MEDIA_PREFIX + "js/SelectFilter2.js")
js = ["admin/js/%s" % path
for path in ["core.js", "SelectBox.js", "SelectFilter2.js"]]
def __init__(self, verbose_name, is_stacked, attrs=None, choices=()):
self.verbose_name = verbose_name
@ -39,22 +39,20 @@ class FilteredSelectMultiple(forms.SelectMultiple):
output.append(u'<script type="text/javascript">addEvent(window, "load", function(e) {')
# TODO: "id_" is hard-coded here. This should instead use the correct
# API to determine the ID dynamically.
output.append(u'SelectFilter.init("id_%s", "%s", %s, "%s"); });</script>\n' % \
(name, self.verbose_name.replace('"', '\\"'), int(self.is_stacked), settings.ADMIN_MEDIA_PREFIX))
output.append(u'SelectFilter.init("id_%s", "%s", %s, "%s"); });</script>\n'
% (name, self.verbose_name.replace('"', '\\"'), int(self.is_stacked), static('admin/')))
return mark_safe(u''.join(output))
class AdminDateWidget(forms.DateInput):
class Media:
js = (settings.ADMIN_MEDIA_PREFIX + "js/calendar.js",
settings.ADMIN_MEDIA_PREFIX + "js/admin/DateTimeShortcuts.js")
js = ["admin/js/calendar.js", "admin/js/admin/DateTimeShortcuts.js"]
def __init__(self, attrs={}, format=None):
super(AdminDateWidget, self).__init__(attrs={'class': 'vDateField', 'size': '10'}, format=format)
class AdminTimeWidget(forms.TimeInput):
class Media:
js = (settings.ADMIN_MEDIA_PREFIX + "js/calendar.js",
settings.ADMIN_MEDIA_PREFIX + "js/admin/DateTimeShortcuts.js")
js = ["admin/js/calendar.js", "admin/js/admin/DateTimeShortcuts.js"]
def __init__(self, attrs={}, format=None):
super(AdminTimeWidget, self).__init__(attrs={'class': 'vTimeField', 'size': '8'}, format=format)
@ -134,9 +132,10 @@ class ForeignKeyRawIdWidget(forms.TextInput):
output = [super(ForeignKeyRawIdWidget, self).render(name, value, attrs)]
# TODO: "id_" is hard-coded here. This should instead use the correct
# API to determine the ID dynamically.
output.append(u'<a href="%s%s" class="related-lookup" id="lookup_id_%s" onclick="return showRelatedObjectLookupPopup(this);"> ' % \
(related_url, url, name))
output.append(u'<img src="%simg/admin/selector-search.gif" width="16" height="16" alt="%s" /></a>' % (settings.ADMIN_MEDIA_PREFIX, _('Lookup')))
output.append(u'<a href="%s%s" class="related-lookup" id="lookup_id_%s" onclick="return showRelatedObjectLookupPopup(this);"> '
% (related_url, url, name))
output.append(u'<img src="%s" width="16" height="16" alt="%s" /></a>'
% (static('admin/img/selector-search.gif'), _('Lookup')))
if value:
output.append(self.label_for_value(value))
return mark_safe(u''.join(output))
@ -240,9 +239,10 @@ class RelatedFieldWidgetWrapper(forms.Widget):
if self.can_add_related:
# TODO: "id_" is hard-coded here. This should instead use the correct
# API to determine the ID dynamically.
output.append(u'<a href="%s" class="add-another" id="add_id_%s" onclick="return showAddAnotherPopup(this);"> ' % \
(related_url, name))
output.append(u'<img src="%simg/admin/icon_addlink.gif" width="10" height="10" alt="%s"/></a>' % (settings.ADMIN_MEDIA_PREFIX, _('Add Another')))
output.append(u'<a href="%s" class="add-another" id="add_id_%s" onclick="return showAddAnotherPopup(this);"> '
% (related_url, name))
output.append(u'<img src="%s" width="10" height="10" alt="%s"/></a>'
% (static('admin/img/icon_addlink.gif'), _('Add Another')))
return mark_safe(u''.join(output))
def build_attrs(self, extra_attrs=None, **kwargs):

View File

@ -1,15 +1,16 @@
from django.conf import settings
from django.contrib.gis.gdal import OGRException
from django.contrib.gis.geos import GEOSGeometry, GEOSException
from django.forms.widgets import Textarea
from django.template import loader, Context
from django.templatetags.static import static
from django.utils import translation
from django.contrib.gis.gdal import OGRException
from django.contrib.gis.geos import GEOSGeometry, GEOSException
# Creating a template context that contains Django settings
# values needed by admin map templates.
geo_context = Context({'ADMIN_MEDIA_PREFIX' : settings.ADMIN_MEDIA_PREFIX,
'LANGUAGE_BIDI' : translation.get_language_bidi(),
})
geo_context = Context({'ADMIN_MEDIA_PREFIX' : static('admin/'),
'LANGUAGE_BIDI' : translation.get_language_bidi()})
class OpenLayersWidget(Textarea):
"""

View File

@ -1,15 +1,16 @@
{% block extrastyle %}
{% load static %}
<style type="text/css">
#{{ id }}_map { width: {{ map_width }}px; height: {{ map_height }}px; }
#{{ id }}_map .aligned label { float:inherit; }
#{{ id }}_admin_map { position: relative; vertical-align: top; float: {{ LANGUAGE_BIDI|yesno:"right,left" }}; }
{% if not display_wkt %}#{{ id }} { display: none; }{% endif %}
.olControlEditingToolbar .olControlModifyFeatureItemActive {
background-image: url("{{ ADMIN_MEDIA_PREFIX }}img/gis/move_vertex_on.png");
background-image: url("{% static "admin/img/gis/move_vertex_on.png" %}");
background-repeat: no-repeat;
}
.olControlEditingToolbar .olControlModifyFeatureItemInactive {
background-image: url("{{ ADMIN_MEDIA_PREFIX }}img/gis/move_vertex_off.png");
background-image: url("{% static "admin/img/gis/move_vertex_off.png" %}");
background-repeat: no-repeat;
}
</style>

Some files were not shown because too many files have changed in this diff Show More