This commit is contained in:
Jeff Balogh 2011-02-04 10:43:56 -08:00
Родитель 822f7d7a8c
Коммит c865421e09
22 изменённых файлов: 60 добавлений и 47 удалений

Просмотреть файл

@ -18,7 +18,7 @@
<h2>{{ _('What are Add-ons?') }}</h2> <h2>{{ _('What are Add-ons?') }}</h2>
<div class="column-wrapper"> <div class="column-wrapper">
<div class="first column"> <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') }}"> alt="{{ _('Extras') }}">
</h3> </h3>
<p> <p>
@ -29,7 +29,7 @@
</p> </p>
</div> </div>
<div class="column"> <div class="column">
<h3><img src="{{ MEDIA_URL }}img/amo2009/illustrations/themes.gif" <h3><img src="{{ media('img/amo2009/illustrations/themes.gif') }}"
alt="{{ _('Themes') }}"> alt="{{ _('Themes') }}">
</h3> </h3>
<p> <p>
@ -40,7 +40,7 @@
</p> </p>
</div> </div>
<div class="column"> <div class="column">
<h3><img src="{{ MEDIA_URL }}img/amo2009/illustrations/install.gif" <h3><img src="{{ media('img/amo2009/illustrations/install.gif') }}"
alt="{{ _('Install') }}"> alt="{{ _('Install') }}">
</h3> </h3>
<p> <p>

Просмотреть файл

@ -96,7 +96,7 @@
<div class="secondary collections-sidebar"> <div class="secondary collections-sidebar">
<img alt="" width="100" height="125" <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> <h3><a href="{{ url('collections.list') }}">{{ _('Collections', 'addons_home_collections') }}</a></h3>
<p> <p>
{% trans %} {% trans %}

Просмотреть файл

@ -10,7 +10,7 @@
{% set appicon = 'firefox' if request.APP == amo.MOBILE else request.APP.short %} {% set appicon = 'firefox' if request.APP == amo.MOBILE else request.APP.short %}
<a href="{{ url('home') }}" <a href="{{ url('home') }}"
title="{{ _('Return to the {0} Add-ons homepage')|f(request.APP.pretty) }}"> 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') }} {{ _('Mobile Add-ons') }}
</a> </a>
</h1> </h1>

Просмотреть файл

@ -1,7 +1,7 @@
{# Bug 595561: testing QR codes for a couple addons. {# Bug 595561: testing QR codes for a couple addons.
Image path is temporary for testing. #} Image path is temporary for testing. #}
<div id="addon-qr-code"> <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") }}" /> alt="{{ _("QR code for add-on") }}" />
{{ _("Want {0} on your mobile Firefox? Scan this QR code to install directly {{ _("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 to your phone. (You'll need a QR reader. Search your phone's marketplace if

Просмотреть файл

@ -333,3 +333,16 @@ def recaptcha(context, form):
@register.inclusion_tag('amo/mobile/sort_by.html') @register.inclusion_tag('amo/mobile/sort_by.html')
def mobile_sort_by(base_url, options, selected): def mobile_sort_by(base_url, options, selected):
return locals() 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)

Просмотреть файл

@ -18,7 +18,7 @@ allowed for these applications.
{% for app in apps %} {% for app in apps %}
<div class="appversion prose"> <div class="appversion prose">
<h3> <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 }} {{ app.pretty }}
</h3> </h3>
<ul> <ul>

Просмотреть файл

@ -57,7 +57,7 @@
<div> <div>
<h3>{{ _('Add-on Collector') }}</h3> <h3>{{ _('Add-on Collector') }}</h3>
<p>{% trans app=request.APP.pretty %} <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"> width="146" height="159">
Get updates on followed collections or manage your own collections directly Get updates on followed collections or manage your own collections directly
from {{ app }} with this add-on. from {{ app }} with this add-on.

Просмотреть файл

@ -129,5 +129,5 @@
{% endblock %} {% endblock %}
{% block js %} {% block js %}
<script src="{{ MEDIA_URL }}js/zamboni/themes.js"></script> <script src="{{ media('js/zamboni/themes.js') }}"></script>
{% endblock %} {% endblock %}

Просмотреть файл

@ -105,7 +105,7 @@
{% endblock %} {% endblock %}
{% block footer_extras %} {% 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 %} {% endblock %}
{% block outer_content %}{% include "messages.html" %}{% endblock %} {% block outer_content %}{% include "messages.html" %}{% endblock %}

Просмотреть файл

@ -6,5 +6,5 @@
value="{{ search_form.q.data or '' }}" value="{{ search_form.q.data or '' }}"
placeholder="{{ _('Search developer documentation') }}"> placeholder="{{ _('Search developer documentation') }}">
</span> </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> </form>

Просмотреть файл

@ -23,7 +23,7 @@
data-recs-url="{{ url('discovery.recs') }}"> data-recs-url="{{ url('discovery.recs') }}">
<header> <header>
<section id="intro"> <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> width="87" height="82">{{ _('What are Add-ons?') }}</h1>
<p> <p>
{% trans %} {% trans %}

Просмотреть файл

@ -1,9 +1,9 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block extrahead %} {% block extrahead %}
<link rel="stylesheet" href="{{ MEDIA_URL }}css/zamboni/nick.css"> <link rel="stylesheet" href="{{ media('css/zamboni/nick.css') }}">
<link rel="stylesheet" <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 %} {% endblock %}
{% block title %} {% block title %}
@ -80,10 +80,10 @@ Nick's Special Featured Add-ons Page for {{ request.APP.pretty }}
{% endblock %} {% endblock %}
{% block js %} {% block js %}
<script src="{{ MEDIA_URL }}js/zamboni/jquery-ui/custom-1.7.2.min.js"></script> <script src="{{ media('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('js/zamboni/jquery.sparkline.min.js') }}"></script>
<script src="{{ MEDIA_URL }}js/zamboni/jquery.tablesorter.min.js"></script> <script src="{{ media('js/zamboni/jquery.tablesorter.min.js') }}"></script>
<script src="{{ MEDIA_URL }}js/zamboni/nick.js"></script> <script src="{{ media('js/zamboni/nick.js') }}"></script>
<script> <script>
</script> </script>
{% endblock %} {% endblock %}

Просмотреть файл

@ -3,9 +3,9 @@
{% set range = view.range %} {% set range = view.range %}
{% block extrahead %} {% block extrahead %}
<link rel="stylesheet" href="{{ MEDIA_URL }}css/legacy/stats.css"/> <link rel="stylesheet" href="{{ media('css/legacy/stats.css') }}"/>
<link rel="stylesheet" <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 %} {% endblock %}
{% block title %} {% block title %}
@ -124,14 +124,14 @@
{% endblock %} {% endblock %}
{% block js %} {% block js %}
<script src="{{ MEDIA_URL }}js/zamboni/jquery-datepicker.js"></script> <script src="{{ media('js/zamboni/jquery-datepicker.js') }}"></script>
<script src="{{ MEDIA_URL }}js/zamboni/highcharts.src.js"></script> <script src="{{ media('js/zamboni/highcharts.src.js') }}"></script>
<!--[if IE]> <!--[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]--> <![endif]-->
<script src="{{ MEDIA_URL }}js/zamboni/stats/csv_keys.js"></script> <script src="{{ media('js/zamboni/stats/csv_keys.js') }}"></script>
<script src="{{ MEDIA_URL }}js/zamboni/stats/helpers.js"></script> <script src="{{ media('js/zamboni/stats/helpers.js') }}"></script>
<script src="{{ MEDIA_URL }}js/zamboni/stats/stats_manager.js"></script> <script src="{{ media('js/zamboni/stats/stats_manager.js') }}"></script>
<script src="{{ MEDIA_URL }}js/zamboni/stats/stats_tables.js"></script> <script src="{{ media('js/zamboni/stats/stats_tables.js') }}"></script>
<script src="{{ MEDIA_URL }}js/zamboni/stats/stats.js"></script> <script src="{{ media('js/zamboni/stats/stats.js') }}"></script>
{% endblock %} {% endblock %}

Просмотреть файл

@ -2,7 +2,7 @@
{% from 'includes/forms.html' import required %} {% from 'includes/forms.html' import required %}
{% block extrahead %} {% block extrahead %}
{{ super() }} {{ super() }}
<link rel="stylesheet" href="{{ MEDIA_URL }}css/zamboni/admin-django.css"> <link rel="stylesheet" href="{{ media('css/zamboni/admin-django.css') }}">
{% endblock %} {% endblock %}
{% block title %}{{ page_title('Add Blacklisted E-mail Domains') }}{% endblock %} {% block title %}{{ page_title('Add Blacklisted E-mail Domains') }}{% endblock %}

Просмотреть файл

@ -2,7 +2,7 @@
{% from 'includes/forms.html' import required %} {% from 'includes/forms.html' import required %}
{% block extrahead %} {% block extrahead %}
{{ super() }} {{ super() }}
<link rel="stylesheet" href="{{ MEDIA_URL }}css/zamboni/admin-django.css"> <link rel="stylesheet" href="{{ media('css/zamboni/admin-django.css') }}">
{% endblock %} {% endblock %}
{% block title %}{{ page_title('Add Blacklisted Usernames') }}{% endblock %} {% block title %}{{ page_title('Add Blacklisted Usernames') }}{% endblock %}

Просмотреть файл

@ -5,7 +5,7 @@
{% block title %}{{ page_title(_('Account Settings')) }}{% endblock %} {% block title %}{{ page_title(_('Account Settings')) }}{% endblock %}
{% block extrahead %} {% block extrahead %}
<link rel="stylesheet" href="{{ MEDIA_URL }}css/zamboni/translations/trans.css"> <link rel="stylesheet" href="{{ media('css/zamboni/translations/trans.css') }}">
{% endblock %} {% endblock %}
{% block content %} {% block content %}

Просмотреть файл

@ -8,14 +8,14 @@
{% block extrahead %} {% block extrahead %}
<link rel="stylesheet" media="screen,projection,tv" <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" <link rel="stylesheet" media="screen,projection,tv"
href="{{ MEDIA_URL }}css/developers.css"> href="{{ media('css/developers.css') }}">
<link rel="stylesheet" href="{{ MEDIA_URL }}css/zamboni/translations/trans.css"> <link rel="stylesheet" href="{{ media('css/zamboni/translations/trans.css') }}">
{% endblock %} {% endblock %}
{% block js %} {% block js %}
<script src="{{ MEDIA_URL }}js/zamboni/tabs.js"></script> <script src="{{ media('js/zamboni/tabs.js') }}"></script>
{% endblock %} {% endblock %}
{% block navbar %} {% block navbar %}

Просмотреть файл

@ -14,7 +14,7 @@ them. See admin.django_to_jinja for more details.
{% templatetag openblock %} block extrahead {% templatetag closeblock %} {% templatetag openblock %} block extrahead {% templatetag closeblock %}
{% templatetag openvariable %} super() {% templatetag closevariable %} {% 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 extrastyle %}{% endblock %}
{% block extrahead %}{% endblock %} {% block extrahead %}{% endblock %}
{% templatetag openblock %} endblock {% templatetag closeblock %} {% templatetag openblock %} endblock {% templatetag closeblock %}

Просмотреть файл

@ -8,7 +8,7 @@
<title>{% block title %}{{ _('Mozilla Add-ons') }}{% endblock %}</title> <title>{% block title %}{{ _('Mozilla Add-ons') }}{% endblock %}</title>
<link rel="shortcut icon" type="image/x-icon" <link rel="shortcut icon" type="image/x-icon"
href="{{ MEDIA_URL}}img/favicon.ico"> href="{{ media('img/favicon.ico') }}">
{% block rss_feed %}{% endblock %} {% block rss_feed %}{% endblock %}
@ -19,12 +19,12 @@
{% block site_css %} {% block site_css %}
{{ css('zamboni/css') }} {{ css('zamboni/css') }}
<!--[if IE]><link rel="stylesheet" href="{{ MEDIA_URL }}css/legacy/ie.css"><![endif]--> <!--[if IE]><link rel="stylesheet" href="{{ media('css/legacy/ie.css') }}"><![endif]-->
<!--[if IE 7]><link rel="stylesheet" href="{{ MEDIA_URL }}css/legacy/ie7.css"><![endif]--> <!--[if IE 7]><link rel="stylesheet" href="{{ media('css/legacy/ie7.css') }}"><![endif]-->
{% endblock %} {% endblock %}
{% block extrahead %}{% 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> </head>
<body class="html-{{ DIR }} {{ request.APP.short }} moz-header-slim {% block bodyclass %}{% endblock %}" <body class="html-{{ DIR }} {{ request.APP.short }} moz-header-slim {% block bodyclass %}{% endblock %}"
data-app="{{ request.APP.short }}" data-app="{{ request.APP.short }}"
@ -137,14 +137,14 @@
<div id="footer" role="contentinfo"> <div id="footer" role="contentinfo">
<div class="section"> <div class="section">
{% block footer_extras %} {% 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 %} {% endblock %}
{% include "footer.html" %} {% include "footer.html" %}
</div> {# section #} </div> {# section #}
</div> {# footer #} </div> {# footer #}
{% endblock %} {% endblock %}
{# Webtrends Stats Tracking #} {# 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> <noscript>
<img id="DCSIMG" width="1" height="1" <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" /> src="https://statse.webtrendslive.com/dcso6de4r0000082npfcmh4rf_4b1e/njs.gif?dcsuri=/nojavascript&amp;WT.js=No&amp;WT.tv=8.6.2" />

Просмотреть файл

@ -2,7 +2,7 @@
{% macro heading(text, icon) -%} {% macro heading(text, icon) -%}
<a href="{{ url('home') }}" <a href="{{ url('home') }}"
title="{{ _('Return to the {0} Add-ons homepage')|f(request.APP.pretty) }}"> 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 %} {%- endmacro %}
{% if request.APP == amo.FIREFOX %} {% if request.APP == amo.FIREFOX %}
{{ heading(_('<img alt="Firefox" src="{0}"> Add-ons'), 'firefox') }} {{ heading(_('<img alt="Firefox" src="{0}"> Add-ons'), 'firefox') }}

Просмотреть файл

@ -6,7 +6,7 @@
<title>{% block title %}{{ _('Mozilla Add-ons') }}{% endblock %}</title> <title>{% block title %}{{ _('Mozilla Add-ons') }}{% endblock %}</title>
<link rel="shortcut icon" type="image/x-icon" <link rel="shortcut icon" type="image/x-icon"
href="{{ MEDIA_URL}}img/favicon.ico"> href="{{ media('img/favicon.ico') }}">
{% block rss_feed %}{% endblock %} {% block rss_feed %}{% endblock %}
@ -39,7 +39,7 @@
{% set appicon = 'firefox' if request.APP == amo.MOBILE else request.APP.short %} {% set appicon = 'firefox' if request.APP == amo.MOBILE else request.APP.short %}
<a href="{{ url('home') }}" <a href="{{ url('home') }}"
title="{{ _('Return to the {0} Add-ons homepage')|f(request.APP.pretty) }}"> 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') }} {{ _('Mobile Add-ons') }}
</a> </a>
</h1> </h1>
@ -64,7 +64,7 @@
{% endblock %} {% endblock %}
{% block js %}{% endblock %} {% block js %}{% endblock %}
{# Webtrends Stats Tracking #} {# 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> <noscript>
<img id="DCSIMG" width="1" height="1" <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" /> src="https://statse.webtrendslive.com/dcso6de4r0000082npfcmh4rf_4b1e/njs.gif?dcsuri=/nojavascript&amp;WT.js=No&amp;WT.tv=8.6.2" />

Просмотреть файл

@ -8,5 +8,5 @@
{{ search_form.cat }} {{ search_form.cat }}
</span> </span>
<input id="search-button" type="image" class="submit" title="{{ _('Search') }}" <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> </form>