aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Doan <andy.doan@linaro.org>2015-01-27 15:22:07 -0600
committerAndy Doan <andy.doan@linaro.org>2015-02-05 14:42:22 -0600
commit196b2812202b3fbfbbf2055fa68d5e705bf2cce7 (patch)
tree24bb18531b7ced03f875559155fbd25c3fae135a
parentc18c7b822a21e8553568bd0b5e35e1bee560b981 (diff)
allow customization of page styling
This is done in a way that our ansible deployment logic can override this for sites that require it. Change-Id: I1c44b7b51ae687fc6aa010451d9575ea1761dd29
-rw-r--r--license_protected_downloads/views.py3
-rw-r--r--settings.py2
-rw-r--r--settings_production.py5
-rw-r--r--templates/404.html2
-rw-r--r--templates/500.html2
-rw-r--r--templates/dir_template.html2
-rw-r--r--templates/group_auth_failure.html2
-rw-r--r--templates/openid_forbidden_template.html2
8 files changed, 15 insertions, 5 deletions
diff --git a/license_protected_downloads/views.py b/license_protected_downloads/views.py
index 0857c9a..74a1800 100644
--- a/license_protected_downloads/views.py
+++ b/license_protected_downloads/views.py
@@ -151,6 +151,7 @@ def show_license(request):
{'license': lic,
'url': request.GET['url'],
'revno': settings.VERSION,
+ 'base_page': settings.BASE_PAGE,
},
context_instance=RequestContext(request))
@@ -219,6 +220,7 @@ def group_auth_failed_response(request, auth_groups):
'authenticated': request.user.is_authenticated(),
'groups_string': groups_string,
'revno': settings.VERSION,
+ 'base_page': settings.BASE_PAGE,
})
response.status_code = 403
@@ -308,6 +310,7 @@ def file_server_get(request, path):
'up_dir': up_dir,
'dl': download,
'revno': settings.VERSION,
+ 'base_page': settings.BASE_PAGE,
'header_content': header_content,
'request': request,
'rendered_files': rendered_files
diff --git a/settings.py b/settings.py
index fbf74c8..a444e80 100644
--- a/settings.py
+++ b/settings.py
@@ -239,6 +239,8 @@ TAB_PRIORITY = ['Release Notes',
'RTSM',
'OpenJDK']
+BASE_PAGE = 'header.html'
+
MASTER_API_KEY = ""
# Try to import local_settings. If it doesn't exist, generate it. It contains
diff --git a/settings_production.py b/settings_production.py
index 36cb15a..4cd7821 100644
--- a/settings_production.py
+++ b/settings_production.py
@@ -23,3 +23,8 @@ FILE_UPLOAD_TEMP_DIR = '/mnt/django-uploads'
for p in SERVED_PATHS + [UPLOAD_PATH]:
if not os.path.exists(p):
os.mkdir(p)
+
+# allow local override of default page styling
+if os.path.exists(os.path.join(DEPLOYMENT_DIR, 'header_override.html')):
+ BASE_PAGE = 'header_override.html'
+ TEMPLATE_DIRS += (DEPLOYMENT_DIR,)
diff --git a/templates/404.html b/templates/404.html
index 11e82d6..4a03259 100644
--- a/templates/404.html
+++ b/templates/404.html
@@ -1,4 +1,4 @@
-{% extends "header.html" %}
+{% extends base_page %}
{% block content %}
Page not found: {{request_path}}
diff --git a/templates/500.html b/templates/500.html
index 425b5d4..6094529 100644
--- a/templates/500.html
+++ b/templates/500.html
@@ -1,4 +1,4 @@
-{% extends "header.html" %}
+{% extends base_page %}
{% block content %}
Server error.
diff --git a/templates/dir_template.html b/templates/dir_template.html
index b2717b4..efa16d3 100644
--- a/templates/dir_template.html
+++ b/templates/dir_template.html
@@ -1,4 +1,4 @@
-{% extends "header.html" %}
+{% extends base_page %}
{% block content %}
{{ header_content|safe }}
diff --git a/templates/group_auth_failure.html b/templates/group_auth_failure.html
index e078b4d..a577e02 100644
--- a/templates/group_auth_failure.html
+++ b/templates/group_auth_failure.html
@@ -1,4 +1,4 @@
-{% extends "header.html" %}
+{% extends base_page %}
{% block content %}
<h1>Group Authentication Error</h1>
diff --git a/templates/openid_forbidden_template.html b/templates/openid_forbidden_template.html
index d54d272..47027ab 100644
--- a/templates/openid_forbidden_template.html
+++ b/templates/openid_forbidden_template.html
@@ -1,4 +1,4 @@
-{% extends "header.html" %}
+{% extends base_page %}
{% block content %}
<h1>Forbidden</h1>