Merge lp:~cjohnston/qa-dashboard/fix-static-urls into lp:qa-dashboard

Proposed by Chris Johnston
Status: Superseded
Proposed branch: lp:~cjohnston/qa-dashboard/fix-static-urls
Merge into: lp:qa-dashboard
Prerequisite: lp:~cjohnston/qa-dashboard/staging-env-notice
Diff against target: 50 lines (+13/-6)
2 files modified
common/templates/layout.html (+8/-6)
qa_dashboard/settings.py (+5/-0)
To merge this branch: bzr merge lp:~cjohnston/qa-dashboard/fix-static-urls
Reviewer Review Type Date Requested Status
QA Dashboard Developers Pending
Review via email: mp+135275@code.launchpad.net
To post a comment you must log in.
148. By Chris Johnston

Removes hard coded URLs in favor of Django's {% url %} tag.

149. By Chris Johnston

Adds a staging notice to all pages in a non-production environment

150. By Chris Johnston

Fixes static urls by adding the correct load command

151. By Chris Johnston

Makes staticfiles work with runserver debug=False

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'common/templates/layout.html'
2--- common/templates/layout.html 2012-11-20 22:46:52 +0000
3+++ common/templates/layout.html 2012-11-21 02:38:18 +0000
4@@ -1,14 +1,16 @@
5 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6
7-{% load static instance %}
8+{% load static from staticfiles %}
9+{% load instance %}
10+
11 <html>
12 <head>
13- <link href='{% get_static_prefix %}css/grid.css' rel='stylesheet' type='text/css' />
14- <link href='{% get_static_prefix %}css/jquery.dataTables.css' rel='stylesheet' type='text/css' />
15- <link href='{% get_static_prefix %}css/style.css' rel='stylesheet' type='text/css' />
16+ <link href='{% static "css/grid.css" %}' rel='stylesheet' type='text/css' />
17+ <link href='{% static "css/jquery.dataTables.css" %}' rel='stylesheet' type='text/css' />
18+ <link href='{% static "css/style.css" %}' rel='stylesheet' type='text/css' />
19 <title>Dashboard for Automated Testing - Ubuntu</title>
20 <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
21- <script src='{% get_static_prefix %}js/jquery.dataTables.min.js'></script>
22+ <script src='{% static "js/jquery.dataTables.min.js" %}'></script>
23 {% block extra_headers %}
24 {% endblock extra_headers %}
25 </head>
26@@ -62,7 +64,7 @@
27 </ul>
28 </div>
29 <a href='{% url index %}' id='logo'>
30- <img alt='Ubuntu QA' src='{% get_static_prefix %}images/header_logo.png' />
31+ <img alt='Ubuntu QA' src='{% static "images/header_logo.png" %}' />
32 </a>
33 </div>
34 </div>
35
36=== modified file 'qa_dashboard/settings.py'
37--- qa_dashboard/settings.py 2012-11-21 02:24:55 +0000
38+++ qa_dashboard/settings.py 2012-11-21 02:38:18 +0000
39@@ -94,6 +94,11 @@
40 # 'django.template.loaders.eggs.Loader',
41 )
42
43+TEMPLATE_CONTEXT_PROCESSORS = (
44+ "django.core.context_processors.request",
45+ "django.core.context_processors.static",
46+)
47+
48 MIDDLEWARE_CLASSES = (
49 'django.middleware.common.CommonMiddleware',
50 'django.contrib.sessions.middleware.SessionMiddleware',

Subscribers

People subscribed via source and target branches