1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00

Fix lingering import statement, add context processor to expose settings to templates.

This commit is contained in:
Chris Church 2013-05-09 14:31:08 -04:00
parent fdc9422409
commit e6377a1243
4 changed files with 8 additions and 2 deletions

View File

@ -30,7 +30,6 @@ from jsonfield import JSONField
from djcelery.models import TaskMeta
from rest_framework.authtoken.models import Token
import yaml
from lib.main.fields import *
# TODO: reporting model TBD

View File

@ -118,6 +118,7 @@ ALLOWED_HOSTS = []
TEMPLATE_CONTEXT_PROCESSORS += (
'django.core.context_processors.request',
'lib.ui.context_processors.settings',
)
MIDDLEWARE_CLASSES += (

View File

@ -0,0 +1,6 @@
from django.conf import settings as django_settings
def settings(request):
return {
'settings': django_settings,
}

View File

@ -13,7 +13,7 @@
<script src="{{ STATIC_URL }}lib/angular/angular.js"></script>
<script src="{{ STATIC_URL }}lib/angular/angular-resource.js"></script>
<script src="{{ STATIC_URL }}lib/angular/angular-cookies.js"></script>
{% if not debug %}
{% if not settings.DEBUG %}
<script src="{{ STATIC_URL }}js/ansible.min.js"></script> <!-- FIXME: Change to whatever we end up calling the minified file. -->
{% else %}
<script src="{{ STATIC_URL }}js/app.js"></script>