Skip to content

Commit

Permalink
Merge pull request #968 from kyoshino/bug-705416-relnotes-index
Browse files Browse the repository at this point in the history
Bug 705416 - Port Firefox Release Notes index page to Bedrock and automate the update
  • Loading branch information
jpetto committed Aug 2, 2013
2 parents 041eb0a + f708fb9 commit 3a37119
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 0 deletions.
66 changes: 66 additions & 0 deletions bedrock/firefox/templates/firefox/releases/index.html
@@ -0,0 +1,66 @@
{% extends "firefox/base-resp.html" %}

{% block page_title %}{{ _('Mozilla Firefox Release Notes') }}{% endblock %}
{% block body_id %}firefox-releases-index{% endblock %}

{% block site_css %}
{{ css('firefox_releases_index') }}
{% endblock %}

{% block breadcrumbs %}
<nav class="breadcrumbs">
<a href="{{ url('mozorg.home') }}">{{ _('Home') }}</a> >
<a href="{{ url('firefox') }}">{{ _('Firefox') }}</a> >
<span>{{ _('Release Notes') }}</span>
</nav>
{% endblock %}

{% block content %}
<div id="main-feature">
<h1>{{ _('Firefox Releases') }}</h1>
<p>{{ _('Firefox release notes are specific to each version of the application. Select your version from the list below to see the release notes for it.') }}</p>
</div>

<div id="main-content">
<ol reversed>
{% for int_version, versions in releases -%}
<li>
<strong>{{ get_link(int_version, versions.major) }}</strong>
{% if versions.minor -%}
<ol>
{% for version in versions.minor -%}
<li>{{ get_link(int_version, version) }}</li>
{% endfor -%}
</ol>
{% endif -%}
</li>
{% endfor -%}
<li>
<strong><a href="0.1.html">0.1</a></strong>
<ol>
<li><a href="0.2.html">0.2</a></li>
<li><a href="0.3.html">0.3</a></li>
<li><a href="0.4.html">0.4</a></li>
<li><a href="0.5.html">0.5</a></li>
<li><a href="0.6.html">0.6</a></li>
<li><a href="0.6.1.html">0.6.1</a></li>
<li><a href="0.7.html">0.7</a></li>
<li><a href="0.7.1.html">0.7.1</a></li>
<li><a href="0.8.html">0.8</a></li>
<li><a href="0.9.html">0.9</a></li>
<li><a href="0.9.1.html">0.9.1/0.9.2</a></li>
<li><a href="0.9.3.html">0.9.3</a></li>
<li><a href="0.10.html">1.0 Preview Release</a></li>
</ol>
</li>
</ol>
</div>
{% endblock %}

{% macro get_link(int_version, version) %}
{%- if int_version < 2 -%}
<a href="{{ version }}.html">{{ version }}</a>
{%- else -%}
<a href="../{{ version }}/releasenotes/">{{ version }}</a>
{%- endif -%}
{% endmacro %}
2 changes: 2 additions & 0 deletions bedrock/firefox/urls.py
Expand Up @@ -49,6 +49,8 @@
page('firefox/organizations', 'firefox/organizations/organizations.html'),
page('firefox/performance', 'firefox/performance.html'),
page('firefox/nightly/firstrun', 'firefox/nightly_firstrun.html'),
url('^firefox/releases/$', views.releases_index,
name='firefox.releases.index'),
page('firefox/security', 'firefox/security.html'),
url(r'^firefox/installer-help/$', views.installer_help,
name='firefox.installer-help'),
Expand Down
17 changes: 17 additions & 0 deletions bedrock/firefox/views.py
Expand Up @@ -271,3 +271,20 @@ def firstrun_new(request, view):
template = view + '.html'

return l10n_utils.render(request, 'firefox/firstrun/' + template)


def releases_index(request):
releases = {}
major_releases = firefox_details.firefox_history_major_releases
minor_releases = firefox_details.firefox_history_stability_releases

for release in major_releases:
releases[float(re.findall(r'^\d+\.\d+', release)[0])] = {
'major': release,
'minor': sorted(filter(lambda x: re.findall(r'^' + re.escape(release), x),
minor_releases),
key=lambda x: int(re.findall(r'\d+$', x)[0]))
}

return l10n_utils.render(request, 'firefox/releases/index.html',
{'releases': sorted(releases.items(), reverse=True)})
3 changes: 3 additions & 0 deletions bedrock/settings/base.py
Expand Up @@ -224,6 +224,9 @@ def JINJA_CONFIG():
'css/base/mozilla-expanders.less',
'css/firefox/platforms.less',
),
'firefox_releases_index': (
'css/firefox/releases-index.less',
),
'firefox_security': (
'css/firefox/security.less',
),
Expand Down
1 change: 1 addition & 0 deletions etc/httpd/global.conf
Expand Up @@ -141,6 +141,7 @@ RewriteRule ^/en-US/firefox/happy(/?)$ /b/en-US/firefox/happy$1 [PT]
RewriteRule ^/en-US/firefox/speed(/?)$ /b/en-US/firefox/speed$1 [PT]
RewriteRule ^/en-US/firefox/geolocation(/?)$ /b/en-US/firefox/geolocation$1 [PT]
RewriteRule ^/en-US/firefox/channel(/?)$ /b/en-US/firefox/channel$1 [PT]
RewriteRule ^/en-US/firefox/releases(/?)$ /b/en-US/firefox/releases$1 [PT]

# bug 893006
RewriteRule ^/(\w{2,3}(?:-\w{2})?/)?firefox/update(.*)$ /b/$1firefox/update$2 [PT]
Expand Down
45 changes: 45 additions & 0 deletions media/css/firefox/releases-index.less
@@ -0,0 +1,45 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

@import "template-resp.less";

#main-feature {
h1,
p {
.span-all();
margin-bottom: @baseLine / 2;
}
}

#main-content {
ol {
margin: 0;
list-style-type: none;
li {
overflow: hidden;
margin: 0;
border-bottom: 1px dotted #d6d6d6;
padding: @baseLine / 2;
line-height: @baseLine * 1.5;
&:last-child {
border: 0 none;
}
strong {
float: left;
width: 6em;
}
ol {
margin-left: 6em;
li {
float: left;
overflow: visible;
border: 0 none;
padding: 0;
width: 6em;
white-space: nowrap;
}
}
}
}
}

0 comments on commit 3a37119

Please sign in to comment.