Skip to content

Commit

Permalink
Merge pull request #2000 from kyoshino/bug-1009247-channel-redirects
Browse files Browse the repository at this point in the history
Fix Bug 1009247 - Redirect Firefox/Mobile Aurora/Beta PHP download pages to /firefox/channel/
  • Loading branch information
jgmize committed May 12, 2014
2 parents e8d5509 + 328ac86 commit d1ad870
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 28 deletions.
12 changes: 6 additions & 6 deletions bedrock/firefox/templates/firefox/base-resp.html
Expand Up @@ -41,13 +41,13 @@
<li class="last"><a href="{{ url('firefox.android.faq') }}" tabindex="-1">{{_('FAQ')}}</a></li>
</ul>
</li>
<li id="nav-main-releases" class=""><a href="/en-US/firefox/channel/" tabindex="0" aria-owns="nav-main-releases-submenu" aria-haspopup="true">{{_('Releases')}}</a>
<li id="nav-main-releases" class=""><a href="{{ url('firefox.channel') }}" tabindex="0" aria-owns="nav-main-releases-submenu" aria-haspopup="true">{{_('Releases')}}</a>
<ul aria-expanded="false" id="nav-main-releases-submenu" class="submenu">
<li class="first"><a href="/en-US/firefox/channel/" tabindex="-1">{{_('Overview')}}</a></li>
<li><a href="/en-US/firefox/aurora/" tabindex="-1">{{_('Firefox Aurora')}}</a></li>
<li><a href="/beta/" tabindex="-1">{{_('Firefox Beta')}}</a></li>
<li><a href="/en-US/firefox/" tabindex="-1">{{_('Firefox')}}</a></li>
<li class="last"><a href="/en-US/firefox/organizations/" tabindex="-1">{{_('Firefox for Organizations')}}</a></li>
<li class="first"><a href="{{ url('firefox.channel') }}" tabindex="-1">{{_('Overview')}}</a></li>
<li><a href="{{ url('firefox.channel') }}#aurora" tabindex="-1">{{_('Firefox Aurora')}}</a></li>
<li><a href="{{ url('firefox.channel') }}#beta" tabindex="-1">{{_('Firefox Beta')}}</a></li>
<li><a href="{{ url('firefox') }}" tabindex="-1">{{_('Firefox')}}</a></li>
<li class="last"><a href="{{ url('firefox.organizations.organizations') }}" tabindex="-1">{{_('Firefox for Organizations')}}</a></li>
</ul>
</li>
<li id="nav-main-addons"><a href="https://addons.mozilla.org/" tabindex="0" aria-owns="nav-main-addons-submenu" aria-haspopup="true">{{_('Add-ons')}}</a>
Expand Down
6 changes: 3 additions & 3 deletions bedrock/firefox/templates/firefox/base.html
Expand Up @@ -41,9 +41,9 @@
<li id="nav-main-releases" class=""><a href="{{ url('firefox.channel') }}" tabindex="0" aria-owns="nav-main-releases-submenu" aria-haspopup="true">{{ _('Releases') }}</a>
<ul aria-expanded="false" id="nav-main-releases-submenu">
<li class="first"><a href="{{ url('firefox.channel') }}" tabindex="-1">{{ _('Overview') }}</a></li>
<li><a href="/en-US/firefox/aurora/" tabindex="-1">{{ _('Firefox Aurora') }}</a></li>
<li><a href="/beta/" tabindex="-1">{{ _('Firefox Beta') }}</a></li>
<li><a href="/en-US/firefox/" tabindex="-1">{{ _('Firefox') }}</a></li>
<li><a href="{{ url('firefox.channel') }}#aurora" tabindex="-1">{{ _('Firefox Aurora') }}</a></li>
<li><a href="{{ url('firefox.channel') }}#beta" tabindex="-1">{{ _('Firefox Beta') }}</a></li>
<li><a href="{{ url('firefox') }}" tabindex="-1">{{ _('Firefox') }}</a></li>
<li class="last"><a href="{{ url('firefox.organizations.organizations') }}" tabindex="-1">{{ _('Firefox for Organizations') }}</a></li>
</ul>
</li>
Expand Down
8 changes: 3 additions & 5 deletions bedrock/firefox/templates/firefox/channel.html
Expand Up @@ -18,9 +18,9 @@
<div id="main-content" class="pager pager-with-tabs pager-cleartype-fix">

<ul id="toggler-container" class="pager-tabs">
<li id="beta-link"><a href="{{ php_url('/firefox/beta/') }}"><img src="{{ media('/img/firefox/channel/toggler-beta.png?2013-06') }}" id="toggler-logo-beta" /></a></li>
<li id="firefox-link"><a href="{{ php_url('/firefox/') }}"><img src="{{ media('/img/firefox/channel/toggler-firefox.png?2013-06') }}" id="toggler-logo-firefox" /></a></li>
<li id="aurora-link"><a href="{{ php_url('/firefox/aurora/') }}"><img src="{{ media('/img/firefox/channel/toggler-aurora.png?2013-06') }}" id="toggler-logo-aurora" /></a></li>
<li id="beta-link"><a href="#beta"><img src="{{ media('/img/firefox/channel/toggler-beta.png?2013-06') }}" alt="Firefox Beta" id="toggler-logo-beta" /></a></li>
<li id="firefox-link"><a href="#firefox"><img src="{{ media('/img/firefox/channel/toggler-firefox.png?2013-06') }}" alt="Firefox" id="toggler-logo-firefox" /></a></li>
<li id="aurora-link"><a href="#aurora"><img src="{{ media('/img/firefox/channel/toggler-aurora.png?2013-06') }}" alt="Firefox Aurora" id="toggler-logo-aurora" /></a></li>
</ul>

<a href="#" id="carousel-left"></a>
Expand All @@ -38,7 +38,6 @@ <h3>{{_('The latest features in a more stable environment')}}</h3>
<div class="download-box mobile" id="beta-mobile">
{{ download_firefox('beta', icon=False, mobile=True, small=True) }}
</div>
<p class="more"><a href="{{ php_url('/firefox/beta/') }}">{{_('Learn more about Firefox Beta')}}</a></p>
</div>

<div id="firefox" class="pager-page">
Expand All @@ -64,7 +63,6 @@ <h3>{{_('The newest innovations in an experimental environment')}}</h3>
<div class="download-box mobile" id="aurora-mobile">
{{ download_firefox('aurora', icon=False, mobile=True, small=True) }}
</div>
<p class="more"><a href="{{ php_url('/mobile/aurora/') }}">{{_('Learn more about Firefox Aurora')}}</a></p>
<p class="warning">
{% trans link=url('privacy.notices.firefox') + '#telemetry' %}
Firefox Aurora automatically sends feedback to Mozilla. <a href="{{ link }}">Learn more</a>.
Expand Down
6 changes: 2 additions & 4 deletions bedrock/firefox/views.py
Expand Up @@ -470,11 +470,9 @@ def get_release_or_404(version, product):

def get_download_url(channel='Release'):
if channel == 'Aurora':
# TODO: use reverse once bug 987517 is resolved
return '/firefox/aurora/'
return reverse('firefox.channel') + '#aurora'
elif channel == 'Beta':
# TODO: use reverse once bug 752644 is resolved
return '/firefox/beta/'
return reverse('firefox.channel') + '#beta'
else:
return reverse('firefox')

Expand Down
Expand Up @@ -43,7 +43,7 @@ <h3 class="timestamp">November 18, 2010</h3>
personal tasks, we share, we complete many quick tasks in the midst of
ongoing interaction with other websites.{% endtrans %}</p>

<p>{% trans beta=php_url('/firefox/beta/') %}To make these
<p>{% trans beta=url('firefox.channel') + '#beta' %}To make these
experiences effortless and fun, we've developed features to
reduce the complexity of navigating today's web. These include enabling "app
tabs" that are always instantly available, placing tabs on top of the URL
Expand Down Expand Up @@ -71,7 +71,7 @@ <h3 class="timestamp">November 18, 2010</h3>
<img src="{{ media('img/foundation/annualreport/2009/Infographic.png') }}" alt="">

<p>
{% trans feedback=php_url('/firefox/beta/'), awesome="https://support.mozilla.org/en-US/army-of-awesome" %}
{% trans feedback=url('firefox.channel') + '#beta', awesome="https://support.mozilla.org/army-of-awesome" %}
Mozilla has tens of thousands of people contributing code and helping to
localize and evangelize Firefox, and we've worked to expand/increase the
ways that all Firefox users can participate in making Firefox better. With
Expand Down
3 changes: 3 additions & 0 deletions etc/httpd/global.conf
Expand Up @@ -218,6 +218,9 @@ RewriteRule ^/(pt-BR)/firefox/speed(/?)$ /b/$1/firefox/speed$2 [PT]
# bug 796952, 915845, 915867
RewriteRule ^/(\w{2,3}(?:-\w{2})?/)?firefox/unsupported/(.*)$ /b/$1firefox/unsupported/$2 [PT]

# Bug 1009247
RewriteRule ^/(\w{2,3}(?:-\w{2})?/)?(firefox|mobile)/(aurora|beta)/?$ /$1firefox/channel/#$3 [NE,L,R=301]

# bug 960651
RewriteCond %{REQUEST_URI} !/unsupported
RewriteRule ^/(\w{2,3}(?:-\w{2})?/)?(firefox|mobile)/([^/]+)/details(/|/.+\.html)?$ /$1firefox/unsupported/details/ [L,R=301]
Expand Down
8 changes: 0 additions & 8 deletions media/js/firefox/channel.js
Expand Up @@ -11,14 +11,6 @@ $(document).ready(function() {

function redirect(a) {
var href = a.href;

if (href.indexOf('#beta') != -1) {
window.location = '/firefox/beta/';
} else if (href.indexOf('#aurora') != -1) {
window.location = '/firefox/aurora/';
} else if (href.indexOf('#firefox') != -1) {
window.location = '/firefox/';
}
}

pager.$container.bind('changePage', function(e, tab) {
Expand Down

0 comments on commit d1ad870

Please sign in to comment.