Merge lp:~mhall119/ubuntu-community-webthemes/default-to-static into lp:ubuntu-community-webthemes/light-django-theme

Proposed by Michael Hall
Status: Merged
Merged at revision: 49
Proposed branch: lp:~mhall119/ubuntu-community-webthemes/default-to-static
Merge into: lp:ubuntu-community-webthemes/light-django-theme
Diff against target: 71 lines (+15/-15)
1 file modified
templates/website_base.html (+15/-15)
To merge this branch: bzr merge lp:~mhall119/ubuntu-community-webthemes/default-to-static
Reviewer Review Type Date Requested Status
Ubuntu Community Web Themes Developers Pending
Review via email: mp+125305@code.launchpad.net

Description of the change

Adds a symlink from ./media to ./static/ubuntu_website so that media files will be caught by collectstatic

Default ubuntu_website_media to use /static/ubuntu_website/ so that newer versions of Django which support collectstatic won't need to install a context processor

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'static'
2=== added symlink 'static/ubuntu_website'
3=== target is u'../media/'
4=== modified file 'templates/website_base.html'
5--- templates/website_base.html 2012-04-04 13:15:21 +0000
6+++ templates/website_base.html 2012-09-19 18:49:21 +0000
7@@ -7,22 +7,22 @@
8 {% block extrameta %}{% endblock %}
9 <title>{% block title %}Ubuntu Website{% endblock %}</title>
10
11- {% block defaultstyles %}<link rel="shortcut icon" href="{{ubuntu_website_media}}/images/favicon.ico" type="image/x-icon" />
12+ {% block defaultstyles %}<link rel="shortcut icon" href="{{ubuntu_website_media|default:'/static/ubuntu_website'}}/images/favicon.ico" type="image/x-icon" />
13 <link rel="stylesheet" type="text/css" media="all" href="//fonts.googleapis.com/css?family=Ubuntu" />
14- <link rel="stylesheet" type="text/css" href="{{ubuntu_website_media}}/css/core-reset.css" />
15- <link rel="stylesheet" type="text/css" href="{{ubuntu_website_media}}/css/core-grid.css" />
16- <link rel="stylesheet" type="text/css" href="{{ubuntu_website_media}}/css/core.css" />
17- <link rel="stylesheet" type="text/css" href="{{ubuntu_website_media}}/css/extra_styles.css" />{% endblock %}
18+ <link rel="stylesheet" type="text/css" href="{{ubuntu_website_media|default:'/static/ubuntu_website'}}/css/core-reset.css" />
19+ <link rel="stylesheet" type="text/css" href="{{ubuntu_website_media|default:'/static/ubuntu_website'}}/css/core-grid.css" />
20+ <link rel="stylesheet" type="text/css" href="{{ubuntu_website_media|default:'/static/ubuntu_website'}}/css/core.css" />
21+ <link rel="stylesheet" type="text/css" href="{{ubuntu_website_media|default:'/static/ubuntu_website'}}/css/extra_styles.css" />{% endblock %}
22 {%block extrastyles %}{% endblock %}
23
24- {% block defaultheadjs %}<script src="{{ubuntu_website_media}}/js/modernizr.min.js"></script>
25+ {% block defaultheadjs %}<script src="{{ubuntu_website_media|default:'/static/ubuntu_website'}}/js/modernizr.min.js"></script>
26 <script src="//code.jquery.com/jquery-1.7.2.min.js"></script>
27- <script>window.jQuery || document.write('<script src="{{ubuntu_website_media}}/js/jquery-1.7.2.min.js"><\/script>')</script>
28- <script>var website_assets="{{ubuntu_website_media}}";</script>{% endblock %}
29+ <script>window.jQuery || document.write('<script src="{{ubuntu_website_medi|default:'/static/ubuntu_website'}}/js/jquery-1.7.2.min.js"><\/script>')</script>
30+ <script>var website_assets="{{ubuntu_website_media|default:'/static/ubuntu_website'}}";</script>{% endblock %}
31 <!--block extraheadjs left out by design, add other JS files to the loader.js script for async loading,
32 this is done and by design, if you MUST add a <script> tag do so in the closure block and test to ensure
33- no breakage has been caused, also avoid inline CSS and JS when possible, use {{ubuntu_website_media}}/css/site.css
34- or {{ubuntu_website_media}}/js/site.js so it correct headers are sent and can be cached properly by broswers-->
35+ no breakage has been caused, also avoid inline CSS and JS when possible, use {{ubuntu_website_media|default:'/static/ubuntu_website'}}/css/site.css
36+ or {{ubuntu_website_media|default:'/static/ubuntu_website'}}/js/site.js so it correct headers are sent and can be cached properly by broswers-->
37 {% endblock %}{% block extrahead %}{% endblock %}
38 </head>
39 <body>
40@@ -60,7 +60,7 @@
41 {% endblock %}
42 </nav>
43 <a class="logo-ubuntu" href="{% block logo_href %}/{% endblock %}">
44- <img width="118" height="27" src="{{ubuntu_website_media}}/images/logo-header.png" alt="Ubuntu logo"/>
45+ <img width="118" height="27" src="{{ubuntu_website_media|default:'/static/ubuntu_website'}}/images/logo-header.png" alt="Ubuntu logo"/>
46 </a>
47 <h2 class="header-text"><a href="{% block logo_text_href %}/{% endblock %}">{% block logo_text %}Country Loco Team{% endblock %}</a></h2>
48 </header>
49@@ -103,7 +103,7 @@
50 <footer class="clear">
51 <div class="container">
52 <a class="logo-ubuntu" href="/">
53- <img width="118" height="27" src="{{ubuntu_website_media}}/images/logo-footer.png" alt="Ubuntu logo"/>
54+ <img width="118" height="27" src="{{ubuntu_website_media|default:'/static/ubuntu_website'}}/images/logo-footer.png" alt="Ubuntu logo"/>
55 </a>
56
57 {% block footer %}
58@@ -190,10 +190,10 @@
59 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
60 })();
61 </script>
62- <script src="{{ubuntu_website_media}}/js/loader.js"></script>
63+ <script src="{{ubuntu_website_media|default:'/static/ubuntu_website'}}/js/loader.js"></script>
64 <!--[if lt IE 9]>
65- <script src="{{ubuntu_website_media}}/js/polyfills/IE9/IE9.js">IE7_PNG_SUFFIX=".png";</script>
66- <script src="{{ubuntu_website_media}}/js/polyfills/IE9/squish.js"></script>
67+ <script src="{{ubuntu_website_media|default:'/static/ubuntu_website'}}/js/polyfills/IE9/IE9.js">IE7_PNG_SUFFIX=".png";</script>
68+ <script src="{{ubuntu_website_media|default:'/static/ubuntu_website'}}/js/polyfills/IE9/squish.js"></script>
69 <![endif]-->
70 {% block closure %}{% endblock %}
71 </div>

Subscribers

People subscribed via source and target branches