Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

give everything a build id

  • Loading branch information...
commit c865421e0936c470e98748f4e57a1763b66da468 1 parent 822f7d7
Jeff Balogh authored

Showing 22 changed files with 60 additions and 47 deletions. Show diff stats Hide diff stats

  1. +3 3 apps/addons/templates/addons/collections_teaser.html
  2. +1 1  apps/addons/templates/addons/home.html
  3. +1 1  apps/addons/templates/addons/mobile/home.html
  4. +1 1  apps/addons/templates/addons/qr_code.html
  5. +13 0 apps/amo/helpers.py
  6. +1 1  apps/applications/templates/applications/appversions.html
  7. +1 1  apps/bandwagon/templates/bandwagon/collection_listing.html
  8. +1 1  apps/browse/templates/browse/themes.html
  9. +1 1  apps/devhub/templates/devhub/base.html
  10. +1 1  apps/devhub/templates/devhub/search.html
  11. +1 1  apps/discovery/templates/discovery/pane.html
  12. +6 6 apps/nick/templates/nick/featured.html
  13. +10 10 apps/stats/templates/stats/stats.html
  14. +1 1  apps/users/templates/admin/blacklisted_email_domain/add.html
  15. +1 1  apps/users/templates/admin/blacklisted_username/add.html
  16. +1 1  apps/users/templates/users/edit.html
  17. +4 4 apps/zadmin/templates/admin/base.html
  18. +1 1  apps/zadmin/templates/admin/base_site.html
  19. +6 6 templates/base.html
  20. +1 1  templates/header_title.html
  21. +3 3 templates/mobile/base.html
  22. +1 1  templates/search.html
6 apps/addons/templates/addons/collections_teaser.html
@@ -18,7 +18,7 @@
18 18 <h2>{{ _('What are Add-ons?') }}</h2>
19 19 <div class="column-wrapper">
20 20 <div class="first column">
21   - <h3><img src="{{ MEDIA_URL }}img/amo2009/illustrations/extras.gif"
  21 + <h3><img src="{{ media('img/amo2009/illustrations/extras.gif') }}"
22 22 alt="{{ _('Extras') }}">
23 23 </h3>
24 24 <p>
@@ -29,7 +29,7 @@
29 29 </p>
30 30 </div>
31 31 <div class="column">
32   - <h3><img src="{{ MEDIA_URL }}img/amo2009/illustrations/themes.gif"
  32 + <h3><img src="{{ media('img/amo2009/illustrations/themes.gif') }}"
33 33 alt="{{ _('Themes') }}">
34 34 </h3>
35 35 <p>
@@ -40,7 +40,7 @@
40 40 </p>
41 41 </div>
42 42 <div class="column">
43   - <h3><img src="{{ MEDIA_URL }}img/amo2009/illustrations/install.gif"
  43 + <h3><img src="{{ media('img/amo2009/illustrations/install.gif') }}"
44 44 alt="{{ _('Install') }}">
45 45 </h3>
46 46 <p>
2  apps/addons/templates/addons/home.html
@@ -96,7 +96,7 @@
96 96
97 97 <div class="secondary collections-sidebar">
98 98 <img alt="" width="100" height="125"
99   - src="{{ MEDIA_URL }}img/amo2009/illustrations/logo-collections-100x125.png">
  99 + src="{{ media('img/amo2009/illustrations/logo-collections-100x125.png') }}">
100 100 <h3><a href="{{ url('collections.list') }}">{{ _('Collections', 'addons_home_collections') }}</a></h3>
101 101 <p>
102 102 {% trans %}
2  apps/addons/templates/addons/mobile/home.html
@@ -10,7 +10,7 @@ <h1 class="site-title">
10 10 {% set appicon = 'firefox' if request.APP == amo.MOBILE else request.APP.short %}
11 11 <a href="{{ url('home') }}"
12 12 title="{{ _('Return to the {0} Add-ons homepage')|f(request.APP.pretty) }}">
13   - <img alt="{{ request.APP.pretty }}" src="{{ MEDIA_URL + 'img/zamboni/app_icons/' + appicon + '.png' }}">
  13 + <img alt="{{ request.APP.pretty }}" src="{{ media('img/zamboni/app_icons/' + appicon + '.png') }}">
14 14 {{ _('Mobile Add-ons') }}
15 15 </a>
16 16 </h1>
2  apps/addons/templates/addons/qr_code.html
... ... @@ -1,7 +1,7 @@
1 1 {# Bug 595561: testing QR codes for a couple addons.
2 2 Image path is temporary for testing. #}
3 3 <div id="addon-qr-code">
4   - <img src="{{ MEDIA_URL }}img/zamboni/qr_code_test/{{ addon.id }}.jpg"
  4 + <img src="{{ media('img/zamboni/qr_code_test/' + addon.id + '.jpg') }}"
5 5 alt="{{ _("QR code for add-on") }}" />
6 6 {{ _("Want {0} on your mobile Firefox? Scan this QR code to install directly
7 7 to your phone. (You'll need a QR reader. Search your phone's marketplace if
13 apps/amo/helpers.py
@@ -333,3 +333,16 @@ def recaptcha(context, form):
333 333 @register.inclusion_tag('amo/mobile/sort_by.html')
334 334 def mobile_sort_by(base_url, options, selected):
335 335 return locals()
  336 +
  337 +
  338 +@register.function
  339 +@jinja2.contextfunction
  340 +def media(context, url):
  341 + """Get a MEDIA_URL link with a cache buster querystring."""
  342 + if url.endswith('.js'):
  343 + build = context['BUILD_ID_JS']
  344 + elif url.endswith('.css'):
  345 + build = context['BUILD_ID_CSS']
  346 + else:
  347 + build = context['BUILD_ID_IMG']
  348 + return context['MEDIA_URL'] + utils.urlparams(url, b=build)
2  apps/applications/templates/applications/appversions.html
@@ -18,7 +18,7 @@
18 18 {% for app in apps %}
19 19 <div class="appversion prose">
20 20 <h3>
21   - <img src="{{ MEDIA_URL }}img/amo2009/app-icons/small/{{ app.short }}.png">
  21 + <img src="{{ media('img/amo2009/app-icons/small/' + app.short + '.png') }}">
22 22 {{ app.pretty }}
23 23 </h3>
24 24 <ul>
2  apps/bandwagon/templates/bandwagon/collection_listing.html
@@ -57,7 +57,7 @@
57 57 <div>
58 58 <h3>{{ _('Add-on Collector') }}</h3>
59 59 <p>{% trans app=request.APP.pretty %}
60   - <img id="addon-collector-logo" src="{{ MEDIA_URL }}img/amo2009/illustrations/logo-collections-download-146x159.png"
  60 + <img id="addon-collector-logo" src="{{ media('img/amo2009/illustrations/logo-collections-download-146x159.png') }}"
61 61 width="146" height="159">
62 62 Get updates on followed collections or manage your own collections directly
63 63 from {{ app }} with this add-on.
2  apps/browse/templates/browse/themes.html
@@ -129,5 +129,5 @@
129 129 {% endblock %}
130 130
131 131 {% block js %}
132   -<script src="{{ MEDIA_URL }}js/zamboni/themes.js"></script>
  132 +<script src="{{ media('js/zamboni/themes.js') }}"></script>
133 133 {% endblock %}
2  apps/devhub/templates/devhub/base.html
@@ -105,7 +105,7 @@ <h1 class="site-title">
105 105 {% endblock %}
106 106
107 107 {% block footer_extras %}
108   - <img class="footerlogo" src="{{ MEDIA_URL }}img/amo2009/developers/hub-logo-footer.png" alt="">
  108 + <img class="footerlogo" src="{{ media('img/amo2009/developers/hub-logo-footer.png') }}" alt="">
109 109 {% endblock %}
110 110
111 111 {% block outer_content %}{% include "messages.html" %}{% endblock %}
2  apps/devhub/templates/devhub/search.html
@@ -6,5 +6,5 @@
6 6 value="{{ search_form.q.data or '' }}"
7 7 placeholder="{{ _('Search developer documentation') }}">
8 8 </span>
9   - <input type="image" class="submit go-button" src="{{ settings.MEDIA_URL }}img/zamboni/global/btn-search.png" title="{{ _('Search') }}">
  9 + <input type="image" class="submit go-button" src="{{ media('img/zamboni/global/btn-search.png') }}" title="{{ _('Search') }}">
10 10 </form>
2  apps/discovery/templates/discovery/pane.html
@@ -23,7 +23,7 @@
23 23 data-recs-url="{{ url('discovery.recs') }}">
24 24 <header>
25 25 <section id="intro">
26   - <h1><img src="{{ MEDIA_URL }}img/zamboni/discovery_pane/logo-addons.png"
  26 + <h1><img src="{{ media('img/zamboni/discovery_pane/logo-addons.png') }}"
27 27 width="87" height="82">{{ _('What are Add-ons?') }}</h1>
28 28 <p>
29 29 {% trans %}
12 apps/nick/templates/nick/featured.html
... ... @@ -1,9 +1,9 @@
@@ -80,10 +80,10 @@
20 apps/stats/templates/stats/stats.html
@@ -3,9 +3,9 @@
3 3 {% set range = view.range %}
4 4
5 5 {% block extrahead %}
6   - <link rel="stylesheet" href="{{ MEDIA_URL }}css/legacy/stats.css"/>
  6 + <link rel="stylesheet" href="{{ media('css/legacy/stats.css') }}"/>
7 7 <link rel="stylesheet"
8   - href="{{ MEDIA_URL }}css/zamboni/jquery-ui/custom-1.7.2.css">
  8 + href="{{ media('css/zamboni/jquery-ui/custom-1.7.2.css') }}">
9 9 {% endblock %}
10 10
11 11 {% block title %}
@@ -124,14 +124,14 @@ <h4 class="author">{{ _('by {0}')|f(users_list(addon.listed_authors))|xssafe }}<
124 124 {% endblock %}
125 125
126 126 {% block js %}
127   -<script src="{{ MEDIA_URL }}js/zamboni/jquery-datepicker.js"></script>
128   -<script src="{{ MEDIA_URL }}js/zamboni/highcharts.src.js"></script>
  127 +<script src="{{ media('js/zamboni/jquery-datepicker.js') }}"></script>
  128 +<script src="{{ media('js/zamboni/highcharts.src.js') }}"></script>
129 129 <!--[if IE]>
130   - <script src="{{ MEDIA_URL }}js/excanvas.compiled.js" type="text/javascript"></script>
  130 + <script src="{{ media('js/excanvas.compiled.js" type="text/javascript') }}"></script>
131 131 <![endif]-->
132   -<script src="{{ MEDIA_URL }}js/zamboni/stats/csv_keys.js"></script>
133   -<script src="{{ MEDIA_URL }}js/zamboni/stats/helpers.js"></script>
134   -<script src="{{ MEDIA_URL }}js/zamboni/stats/stats_manager.js"></script>
135   -<script src="{{ MEDIA_URL }}js/zamboni/stats/stats_tables.js"></script>
136   -<script src="{{ MEDIA_URL }}js/zamboni/stats/stats.js"></script>
  132 +<script src="{{ media('js/zamboni/stats/csv_keys.js') }}"></script>
  133 +<script src="{{ media('js/zamboni/stats/helpers.js') }}"></script>
  134 +<script src="{{ media('js/zamboni/stats/stats_manager.js') }}"></script>
  135 +<script src="{{ media('js/zamboni/stats/stats_tables.js') }}"></script>
  136 +<script src="{{ media('js/zamboni/stats/stats.js') }}"></script>
137 137 {% endblock %}
2  apps/users/templates/admin/blacklisted_email_domain/add.html
@@ -2,7 +2,7 @@
2 2 {% from 'includes/forms.html' import required %}
3 3 {% block extrahead %}
4 4 {{ super() }}
5   - <link rel="stylesheet" href="{{ MEDIA_URL }}css/zamboni/admin-django.css">
  5 + <link rel="stylesheet" href="{{ media('css/zamboni/admin-django.css') }}">
6 6 {% endblock %}
7 7
8 8 {% block title %}{{ page_title('Add Blacklisted E-mail Domains') }}{% endblock %}
2  apps/users/templates/admin/blacklisted_username/add.html
@@ -2,7 +2,7 @@
2 2 {% from 'includes/forms.html' import required %}
3 3 {% block extrahead %}
4 4 {{ super() }}
5   - <link rel="stylesheet" href="{{ MEDIA_URL }}css/zamboni/admin-django.css">
  5 + <link rel="stylesheet" href="{{ media('css/zamboni/admin-django.css') }}">
6 6 {% endblock %}
7 7
8 8 {% block title %}{{ page_title('Add Blacklisted Usernames') }}{% endblock %}
2  apps/users/templates/users/edit.html
@@ -5,7 +5,7 @@
5 5 {% block title %}{{ page_title(_('Account Settings')) }}{% endblock %}
6 6
7 7 {% block extrahead %}
8   -<link rel="stylesheet" href="{{ MEDIA_URL }}css/zamboni/translations/trans.css">
  8 +<link rel="stylesheet" href="{{ media('css/zamboni/translations/trans.css') }}">
9 9 {% endblock %}
10 10
11 11 {% block content %}
8 apps/zadmin/templates/admin/base.html
@@ -8,14 +8,14 @@
8 8
9 9 {% block extrahead %}
10 10 <link rel="stylesheet" media="screen,projection,tv"
11   - href="{{ MEDIA_URL }}css/zamboni/admin-mozilla.css">
  11 + href="{{ media('css/zamboni/admin-mozilla.css') }}">
12 12 <link rel="stylesheet" media="screen,projection,tv"
13   - href="{{ MEDIA_URL }}css/developers.css">
14   -<link rel="stylesheet" href="{{ MEDIA_URL }}css/zamboni/translations/trans.css">
  13 + href="{{ media('css/developers.css') }}">
  14 +<link rel="stylesheet" href="{{ media('css/zamboni/translations/trans.css') }}">
15 15 {% endblock %}
16 16
17 17 {% block js %}
18   -<script src="{{ MEDIA_URL }}js/zamboni/tabs.js"></script>
  18 +<script src="{{ media('js/zamboni/tabs.js') }}"></script>
19 19 {% endblock %}
20 20
21 21 {% block navbar %}
2  apps/zadmin/templates/admin/base_site.html
@@ -14,7 +14,7 @@
14 14
15 15 {% templatetag openblock %} block extrahead {% templatetag closeblock %}
16 16 {% templatetag openvariable %} super() {% templatetag closevariable %}
17   - <link rel="stylesheet" href="{{ MEDIA_URL}}css/zamboni/admin-django.css">
  17 + <link rel="stylesheet" href="{{ media('css/zamboni/admin-django.css') }}">
18 18 {% block extrastyle %}{% endblock %}
19 19 {% block extrahead %}{% endblock %}
20 20 {% templatetag openblock %} endblock {% templatetag closeblock %}
12 templates/base.html
@@ -8,7 +8,7 @@
8 8 <title>{% block title %}{{ _('Mozilla Add-ons') }}{% endblock %}</title>
9 9
10 10 <link rel="shortcut icon" type="image/x-icon"
11   - href="{{ MEDIA_URL}}img/favicon.ico">
  11 + href="{{ media('img/favicon.ico') }}">
12 12
13 13 {% block rss_feed %}{% endblock %}
14 14
@@ -19,12 +19,12 @@
19 19
20 20 {% block site_css %}
21 21 {{ css('zamboni/css') }}
22   - <!--[if IE]><link rel="stylesheet" href="{{ MEDIA_URL }}css/legacy/ie.css"><![endif]-->
23   - <!--[if IE 7]><link rel="stylesheet" href="{{ MEDIA_URL }}css/legacy/ie7.css"><![endif]-->
  22 + <!--[if IE]><link rel="stylesheet" href="{{ media('css/legacy/ie.css') }}"><![endif]-->
  23 + <!--[if IE 7]><link rel="stylesheet" href="{{ media('css/legacy/ie7.css') }}"><![endif]-->
24 24 {% endblock %}
25 25
26 26 {% block extrahead %}{% endblock %}
27   - <noscript><link rel="stylesheet" href="{{ MEDIA_URL }}css/legacy/nojs.css"></noscript>
  27 + <noscript><link rel="stylesheet" href="{{ media('css/legacy/nojs.css') }}"></noscript>
28 28 </head>
29 29 <body class="html-{{ DIR }} {{ request.APP.short }} moz-header-slim {% block bodyclass %}{% endblock %}"
30 30 data-app="{{ request.APP.short }}"
@@ -137,14 +137,14 @@
137 137 <div id="footer" role="contentinfo">
138 138 <div class="section">
139 139 {% block footer_extras %}
140   - <img class="footerlogo" src="{{ MEDIA_URL }}img/zamboni/footer-logo-med.png" alt="">
  140 + <img class="footerlogo" src="{{ media('img/zamboni/footer-logo-med.png') }}" alt="">
141 141 {% endblock %}
142 142 {% include "footer.html" %}
143 143 </div> {# section #}
144 144 </div> {# footer #}
145 145 {% endblock %}
146 146 {# Webtrends Stats Tracking #}
147   - <script defer src="{{ MEDIA_URL }}js/webtrends/webtrends-v0.1.js"></script>
  147 + <script defer src="{{ media('js/webtrends/webtrends-v0.1.js') }}"></script>
148 148 <noscript>
149 149 <img id="DCSIMG" width="1" height="1"
150 150 src="https://statse.webtrendslive.com/dcso6de4r0000082npfcmh4rf_4b1e/njs.gif?dcsuri=/nojavascript&amp;WT.js=No&amp;WT.tv=8.6.2" />
2  templates/header_title.html
@@ -2,7 +2,7 @@ <h1 class="site-title">
2 2 {% macro heading(text, icon) -%}
3 3 <a href="{{ url('home') }}"
4 4 title="{{ _('Return to the {0} Add-ons homepage')|f(request.APP.pretty) }}">
5   - {{ text|f(MEDIA_URL + 'img/zamboni/app_icons/' + icon + '.png')|safe }}</a>
  5 + {{ text|f(media('img/zamboni/app_icons/' + icon + '.png'))|safe }}</a>
6 6 {%- endmacro %}
7 7 {% if request.APP == amo.FIREFOX %}
8 8 {{ heading(_('<img alt="Firefox" src="{0}"> Add-ons'), 'firefox') }}
6 templates/mobile/base.html
@@ -6,7 +6,7 @@
6 6 <title>{% block title %}{{ _('Mozilla Add-ons') }}{% endblock %}</title>
7 7
8 8 <link rel="shortcut icon" type="image/x-icon"
9   - href="{{ MEDIA_URL}}img/favicon.ico">
  9 + href="{{ media('img/favicon.ico') }}">
10 10
11 11 {% block rss_feed %}{% endblock %}
12 12
@@ -39,7 +39,7 @@ <h1 class="site-title">
39 39 {% set appicon = 'firefox' if request.APP == amo.MOBILE else request.APP.short %}
40 40 <a href="{{ url('home') }}"
41 41 title="{{ _('Return to the {0} Add-ons homepage')|f(request.APP.pretty) }}">
42   - <img alt="{{ request.APP.pretty }}" src="{{ MEDIA_URL + 'img/zamboni/app_icons/' + appicon + '.png' }}">
  42 + <img alt="{{ request.APP.pretty }}" src="{{ media('img/zamboni/app_icons/' + appicon + '.png') }}">
43 43 {{ _('Mobile Add-ons') }}
44 44 </a>
45 45 </h1>
@@ -64,7 +64,7 @@ <h1 class="site-title">
64 64 {% endblock %}
65 65 {% block js %}{% endblock %}
66 66 {# Webtrends Stats Tracking #}
67   - <script defer src="{{ MEDIA_URL }}js/webtrends/webtrends-v0.1.js"></script>
  67 + <script defer src="{{ media('js/webtrends/webtrends-v0.1.js') }}"></script>
68 68 <noscript>
69 69 <img id="DCSIMG" width="1" height="1"
70 70 src="https://statse.webtrendslive.com/dcso6de4r0000082npfcmh4rf_4b1e/njs.gif?dcsuri=/nojavascript&amp;WT.js=No&amp;WT.tv=8.6.2" />
2  templates/search.html
@@ -8,5 +8,5 @@
8 8 {{ search_form.cat }}
9 9 </span>
10 10 <input id="search-button" type="image" class="submit" title="{{ _('Search') }}"
11   - src="{{ settings.MEDIA_URL }}img/zamboni/global/btn-search.png">
  11 + src="{{ media('img/zamboni/global/btn-search.png') }}">
12 12 </form>

0 comments on commit c865421

Please sign in to comment.
Something went wrong with that request. Please try again.