Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

give everything a build id

  • Loading branch information...
commit c865421e0936c470e98748f4e57a1763b66da468 1 parent 822f7d7
Jeff Balogh authored
View
6 apps/addons/templates/addons/collections_teaser.html
@@ -18,7 +18,7 @@
<h2>{{ _('What are Add-ons?') }}</h2>
<div class="column-wrapper">
<div class="first column">
- <h3><img src="{{ MEDIA_URL }}img/amo2009/illustrations/extras.gif"
+ <h3><img src="{{ media('img/amo2009/illustrations/extras.gif') }}"
alt="{{ _('Extras') }}">
</h3>
<p>
@@ -29,7 +29,7 @@
</p>
</div>
<div class="column">
- <h3><img src="{{ MEDIA_URL }}img/amo2009/illustrations/themes.gif"
+ <h3><img src="{{ media('img/amo2009/illustrations/themes.gif') }}"
alt="{{ _('Themes') }}">
</h3>
<p>
@@ -40,7 +40,7 @@
</p>
</div>
<div class="column">
- <h3><img src="{{ MEDIA_URL }}img/amo2009/illustrations/install.gif"
+ <h3><img src="{{ media('img/amo2009/illustrations/install.gif') }}"
alt="{{ _('Install') }}">
</h3>
<p>
View
2  apps/addons/templates/addons/home.html
@@ -96,7 +96,7 @@
<div class="secondary collections-sidebar">
<img alt="" width="100" height="125"
- src="{{ MEDIA_URL }}img/amo2009/illustrations/logo-collections-100x125.png">
+ src="{{ media('img/amo2009/illustrations/logo-collections-100x125.png') }}">
<h3><a href="{{ url('collections.list') }}">{{ _('Collections', 'addons_home_collections') }}</a></h3>
<p>
{% trans %}
View
2  apps/addons/templates/addons/mobile/home.html
@@ -10,7 +10,7 @@ <h1 class="site-title">
{% set appicon = 'firefox' if request.APP == amo.MOBILE else request.APP.short %}
<a href="{{ url('home') }}"
title="{{ _('Return to the {0} Add-ons homepage')|f(request.APP.pretty) }}">
- <img alt="{{ request.APP.pretty }}" src="{{ MEDIA_URL + 'img/zamboni/app_icons/' + appicon + '.png' }}">
+ <img alt="{{ request.APP.pretty }}" src="{{ media('img/zamboni/app_icons/' + appicon + '.png') }}">
{{ _('Mobile Add-ons') }}
</a>
</h1>
View
2  apps/addons/templates/addons/qr_code.html
@@ -1,7 +1,7 @@
{# Bug 595561: testing QR codes for a couple addons.
Image path is temporary for testing. #}
<div id="addon-qr-code">
- <img src="{{ MEDIA_URL }}img/zamboni/qr_code_test/{{ addon.id }}.jpg"
+ <img src="{{ media('img/zamboni/qr_code_test/' + addon.id + '.jpg') }}"
alt="{{ _("QR code for add-on") }}" />
{{ _("Want {0} on your mobile Firefox? Scan this QR code to install directly
to your phone. (You'll need a QR reader. Search your phone's marketplace if
View
13 apps/amo/helpers.py
@@ -333,3 +333,16 @@ def recaptcha(context, form):
@register.inclusion_tag('amo/mobile/sort_by.html')
def mobile_sort_by(base_url, options, selected):
return locals()
+
+
+@register.function
+@jinja2.contextfunction
+def media(context, url):
+ """Get a MEDIA_URL link with a cache buster querystring."""
+ if url.endswith('.js'):
+ build = context['BUILD_ID_JS']
+ elif url.endswith('.css'):
+ build = context['BUILD_ID_CSS']
+ else:
+ build = context['BUILD_ID_IMG']
+ return context['MEDIA_URL'] + utils.urlparams(url, b=build)
View
2  apps/applications/templates/applications/appversions.html
@@ -18,7 +18,7 @@
{% for app in apps %}
<div class="appversion prose">
<h3>
- <img src="{{ MEDIA_URL }}img/amo2009/app-icons/small/{{ app.short }}.png">
+ <img src="{{ media('img/amo2009/app-icons/small/' + app.short + '.png') }}">
{{ app.pretty }}
</h3>
<ul>
View
2  apps/bandwagon/templates/bandwagon/collection_listing.html
@@ -57,7 +57,7 @@
<div>
<h3>{{ _('Add-on Collector') }}</h3>
<p>{% trans app=request.APP.pretty %}
- <img id="addon-collector-logo" src="{{ MEDIA_URL }}img/amo2009/illustrations/logo-collections-download-146x159.png"
+ <img id="addon-collector-logo" src="{{ media('img/amo2009/illustrations/logo-collections-download-146x159.png') }}"
width="146" height="159">
Get updates on followed collections or manage your own collections directly
from {{ app }} with this add-on.
View
2  apps/browse/templates/browse/themes.html
@@ -129,5 +129,5 @@
{% endblock %}
{% block js %}
-<script src="{{ MEDIA_URL }}js/zamboni/themes.js"></script>
+<script src="{{ media('js/zamboni/themes.js') }}"></script>
{% endblock %}
View
2  apps/devhub/templates/devhub/base.html
@@ -105,7 +105,7 @@ <h1 class="site-title">
{% endblock %}
{% block footer_extras %}
- <img class="footerlogo" src="{{ MEDIA_URL }}img/amo2009/developers/hub-logo-footer.png" alt="">
+ <img class="footerlogo" src="{{ media('img/amo2009/developers/hub-logo-footer.png') }}" alt="">
{% endblock %}
{% block outer_content %}{% include "messages.html" %}{% endblock %}
View
2  apps/devhub/templates/devhub/search.html
@@ -6,5 +6,5 @@
value="{{ search_form.q.data or '' }}"
placeholder="{{ _('Search developer documentation') }}">
</span>
- <input type="image" class="submit go-button" src="{{ settings.MEDIA_URL }}img/zamboni/global/btn-search.png" title="{{ _('Search') }}">
+ <input type="image" class="submit go-button" src="{{ media('img/zamboni/global/btn-search.png') }}" title="{{ _('Search') }}">
</form>
View
2  apps/discovery/templates/discovery/pane.html
@@ -23,7 +23,7 @@
data-recs-url="{{ url('discovery.recs') }}">
<header>
<section id="intro">
- <h1><img src="{{ MEDIA_URL }}img/zamboni/discovery_pane/logo-addons.png"
+ <h1><img src="{{ media('img/zamboni/discovery_pane/logo-addons.png') }}"
width="87" height="82">{{ _('What are Add-ons?') }}</h1>
<p>
{% trans %}
View
12 apps/nick/templates/nick/featured.html
@@ -1,9 +1,9 @@
{% extends "base.html" %}
{% block extrahead %}
-<link rel="stylesheet" href="{{ MEDIA_URL }}css/zamboni/nick.css">
+<link rel="stylesheet" href="{{ media('css/zamboni/nick.css') }}">
<link rel="stylesheet"
- href="{{ MEDIA_URL }}css/zamboni/jquery-ui/custom-1.7.2.css">
+ href="{{ media('css/zamboni/jquery-ui/custom-1.7.2.css') }}">
{% endblock %}
{% block title %}
@@ -80,10 +80,10 @@
{% endblock %}
{% block js %}
-<script src="{{ MEDIA_URL }}js/zamboni/jquery-ui/custom-1.7.2.min.js"></script>
-<script src="{{ MEDIA_URL }}js/zamboni/jquery.sparkline.min.js"></script>
-<script src="{{ MEDIA_URL }}js/zamboni/jquery.tablesorter.min.js"></script>
-<script src="{{ MEDIA_URL }}js/zamboni/nick.js"></script>
+<script src="{{ media('js/zamboni/jquery-ui/custom-1.7.2.min.js') }}"></script>
+<script src="{{ media('js/zamboni/jquery.sparkline.min.js') }}"></script>
+<script src="{{ media('js/zamboni/jquery.tablesorter.min.js') }}"></script>
+<script src="{{ media('js/zamboni/nick.js') }}"></script>
<script>
</script>
{% endblock %}
View
20 apps/stats/templates/stats/stats.html
@@ -3,9 +3,9 @@
{% set range = view.range %}
{% block extrahead %}
- <link rel="stylesheet" href="{{ MEDIA_URL }}css/legacy/stats.css"/>
+ <link rel="stylesheet" href="{{ media('css/legacy/stats.css') }}"/>
<link rel="stylesheet"
- href="{{ MEDIA_URL }}css/zamboni/jquery-ui/custom-1.7.2.css">
+ href="{{ media('css/zamboni/jquery-ui/custom-1.7.2.css') }}">
{% endblock %}
{% block title %}
@@ -124,14 +124,14 @@ <h4 class="author">{{ _('by {0}')|f(users_list(addon.listed_authors))|xssafe }}<
{% endblock %}
{% block js %}
-<script src="{{ MEDIA_URL }}js/zamboni/jquery-datepicker.js"></script>
-<script src="{{ MEDIA_URL }}js/zamboni/highcharts.src.js"></script>
+<script src="{{ media('js/zamboni/jquery-datepicker.js') }}"></script>
+<script src="{{ media('js/zamboni/highcharts.src.js') }}"></script>
<!--[if IE]>
- <script src="{{ MEDIA_URL }}js/excanvas.compiled.js" type="text/javascript"></script>
+ <script src="{{ media('js/excanvas.compiled.js" type="text/javascript') }}"></script>
<![endif]-->
-<script src="{{ MEDIA_URL }}js/zamboni/stats/csv_keys.js"></script>
-<script src="{{ MEDIA_URL }}js/zamboni/stats/helpers.js"></script>
-<script src="{{ MEDIA_URL }}js/zamboni/stats/stats_manager.js"></script>
-<script src="{{ MEDIA_URL }}js/zamboni/stats/stats_tables.js"></script>
-<script src="{{ MEDIA_URL }}js/zamboni/stats/stats.js"></script>
+<script src="{{ media('js/zamboni/stats/csv_keys.js') }}"></script>
+<script src="{{ media('js/zamboni/stats/helpers.js') }}"></script>
+<script src="{{ media('js/zamboni/stats/stats_manager.js') }}"></script>
+<script src="{{ media('js/zamboni/stats/stats_tables.js') }}"></script>
+<script src="{{ media('js/zamboni/stats/stats.js') }}"></script>
{% endblock %}
View
2  apps/users/templates/admin/blacklisted_email_domain/add.html
@@ -2,7 +2,7 @@
{% from 'includes/forms.html' import required %}
{% block extrahead %}
{{ super() }}
- <link rel="stylesheet" href="{{ MEDIA_URL }}css/zamboni/admin-django.css">
+ <link rel="stylesheet" href="{{ media('css/zamboni/admin-django.css') }}">
{% endblock %}
{% block title %}{{ page_title('Add Blacklisted E-mail Domains') }}{% endblock %}
View
2  apps/users/templates/admin/blacklisted_username/add.html
@@ -2,7 +2,7 @@
{% from 'includes/forms.html' import required %}
{% block extrahead %}
{{ super() }}
- <link rel="stylesheet" href="{{ MEDIA_URL }}css/zamboni/admin-django.css">
+ <link rel="stylesheet" href="{{ media('css/zamboni/admin-django.css') }}">
{% endblock %}
{% block title %}{{ page_title('Add Blacklisted Usernames') }}{% endblock %}
View
2  apps/users/templates/users/edit.html
@@ -5,7 +5,7 @@
{% block title %}{{ page_title(_('Account Settings')) }}{% endblock %}
{% block extrahead %}
-<link rel="stylesheet" href="{{ MEDIA_URL }}css/zamboni/translations/trans.css">
+<link rel="stylesheet" href="{{ media('css/zamboni/translations/trans.css') }}">
{% endblock %}
{% block content %}
View
8 apps/zadmin/templates/admin/base.html
@@ -8,14 +8,14 @@
{% block extrahead %}
<link rel="stylesheet" media="screen,projection,tv"
- href="{{ MEDIA_URL }}css/zamboni/admin-mozilla.css">
+ href="{{ media('css/zamboni/admin-mozilla.css') }}">
<link rel="stylesheet" media="screen,projection,tv"
- href="{{ MEDIA_URL }}css/developers.css">
-<link rel="stylesheet" href="{{ MEDIA_URL }}css/zamboni/translations/trans.css">
+ href="{{ media('css/developers.css') }}">
+<link rel="stylesheet" href="{{ media('css/zamboni/translations/trans.css') }}">
{% endblock %}
{% block js %}
-<script src="{{ MEDIA_URL }}js/zamboni/tabs.js"></script>
+<script src="{{ media('js/zamboni/tabs.js') }}"></script>
{% endblock %}
{% block navbar %}
View
2  apps/zadmin/templates/admin/base_site.html
@@ -14,7 +14,7 @@
{% templatetag openblock %} block extrahead {% templatetag closeblock %}
{% templatetag openvariable %} super() {% templatetag closevariable %}
- <link rel="stylesheet" href="{{ MEDIA_URL}}css/zamboni/admin-django.css">
+ <link rel="stylesheet" href="{{ media('css/zamboni/admin-django.css') }}">
{% block extrastyle %}{% endblock %}
{% block extrahead %}{% endblock %}
{% templatetag openblock %} endblock {% templatetag closeblock %}
View
12 templates/base.html
@@ -8,7 +8,7 @@
<title>{% block title %}{{ _('Mozilla Add-ons') }}{% endblock %}</title>
<link rel="shortcut icon" type="image/x-icon"
- href="{{ MEDIA_URL}}img/favicon.ico">
+ href="{{ media('img/favicon.ico') }}">
{% block rss_feed %}{% endblock %}
@@ -19,12 +19,12 @@
{% block site_css %}
{{ css('zamboni/css') }}
- <!--[if IE]><link rel="stylesheet" href="{{ MEDIA_URL }}css/legacy/ie.css"><![endif]-->
- <!--[if IE 7]><link rel="stylesheet" href="{{ MEDIA_URL }}css/legacy/ie7.css"><![endif]-->
+ <!--[if IE]><link rel="stylesheet" href="{{ media('css/legacy/ie.css') }}"><![endif]-->
+ <!--[if IE 7]><link rel="stylesheet" href="{{ media('css/legacy/ie7.css') }}"><![endif]-->
{% endblock %}
{% block extrahead %}{% endblock %}
- <noscript><link rel="stylesheet" href="{{ MEDIA_URL }}css/legacy/nojs.css"></noscript>
+ <noscript><link rel="stylesheet" href="{{ media('css/legacy/nojs.css') }}"></noscript>
</head>
<body class="html-{{ DIR }} {{ request.APP.short }} moz-header-slim {% block bodyclass %}{% endblock %}"
data-app="{{ request.APP.short }}"
@@ -137,14 +137,14 @@
<div id="footer" role="contentinfo">
<div class="section">
{% block footer_extras %}
- <img class="footerlogo" src="{{ MEDIA_URL }}img/zamboni/footer-logo-med.png" alt="">
+ <img class="footerlogo" src="{{ media('img/zamboni/footer-logo-med.png') }}" alt="">
{% endblock %}
{% include "footer.html" %}
</div> {# section #}
</div> {# footer #}
{% endblock %}
{# Webtrends Stats Tracking #}
- <script defer src="{{ MEDIA_URL }}js/webtrends/webtrends-v0.1.js"></script>
+ <script defer src="{{ media('js/webtrends/webtrends-v0.1.js') }}"></script>
<noscript>
<img id="DCSIMG" width="1" height="1"
src="https://statse.webtrendslive.com/dcso6de4r0000082npfcmh4rf_4b1e/njs.gif?dcsuri=/nojavascript&amp;WT.js=No&amp;WT.tv=8.6.2" />
View
2  templates/header_title.html
@@ -2,7 +2,7 @@ <h1 class="site-title">
{% macro heading(text, icon) -%}
<a href="{{ url('home') }}"
title="{{ _('Return to the {0} Add-ons homepage')|f(request.APP.pretty) }}">
- {{ text|f(MEDIA_URL + 'img/zamboni/app_icons/' + icon + '.png')|safe }}</a>
+ {{ text|f(media('img/zamboni/app_icons/' + icon + '.png'))|safe }}</a>
{%- endmacro %}
{% if request.APP == amo.FIREFOX %}
{{ heading(_('<img alt="Firefox" src="{0}"> Add-ons'), 'firefox') }}
View
6 templates/mobile/base.html
@@ -6,7 +6,7 @@
<title>{% block title %}{{ _('Mozilla Add-ons') }}{% endblock %}</title>
<link rel="shortcut icon" type="image/x-icon"
- href="{{ MEDIA_URL}}img/favicon.ico">
+ href="{{ media('img/favicon.ico') }}">
{% block rss_feed %}{% endblock %}
@@ -39,7 +39,7 @@ <h1 class="site-title">
{% set appicon = 'firefox' if request.APP == amo.MOBILE else request.APP.short %}
<a href="{{ url('home') }}"
title="{{ _('Return to the {0} Add-ons homepage')|f(request.APP.pretty) }}">
- <img alt="{{ request.APP.pretty }}" src="{{ MEDIA_URL + 'img/zamboni/app_icons/' + appicon + '.png' }}">
+ <img alt="{{ request.APP.pretty }}" src="{{ media('img/zamboni/app_icons/' + appicon + '.png') }}">
{{ _('Mobile Add-ons') }}
</a>
</h1>
@@ -64,7 +64,7 @@ <h1 class="site-title">
{% endblock %}
{% block js %}{% endblock %}
{# Webtrends Stats Tracking #}
- <script defer src="{{ MEDIA_URL }}js/webtrends/webtrends-v0.1.js"></script>
+ <script defer src="{{ media('js/webtrends/webtrends-v0.1.js') }}"></script>
<noscript>
<img id="DCSIMG" width="1" height="1"
src="https://statse.webtrendslive.com/dcso6de4r0000082npfcmh4rf_4b1e/njs.gif?dcsuri=/nojavascript&amp;WT.js=No&amp;WT.tv=8.6.2" />
View
2  templates/search.html
@@ -8,5 +8,5 @@
{{ search_form.cat }}
</span>
<input id="search-button" type="image" class="submit" title="{{ _('Search') }}"
- src="{{ settings.MEDIA_URL }}img/zamboni/global/btn-search.png">
+ src="{{ media('img/zamboni/global/btn-search.png') }}">
</form>
Please sign in to comment.
Something went wrong with that request. Please try again.