Permalink
Browse files

Merge pull request #1 from darkwing/bug-838224

Adding focus/active link states, fixing test, cleaning up python template
  • Loading branch information...
2 parents 62e7ffe + ec27618 commit fafae223f357c8f317e87cf1be0162cb8a53a40e @tx2z tx2z committed Feb 11, 2013
Showing with 21 additions and 31 deletions.
  1. +12 −12 apps/landing/templates/landing/home.html
  2. +5 −15 apps/landing/test_templates.py
  3. +4 −4 media/css/mdn-screen.css
@@ -80,33 +80,33 @@
<section id="home-promos" class="home-promos">
<div class="promo" id="promo-webapps">
- <a href="{{ _('https://developer.mozilla.org/en-US/docs/apps')}}">
- <h2>{{_("Create")}}<br />{{_("Web Apps")}}</h2>
- <p>{{_("Develop apps using Web standards and open technologies")}}</p>
+ <a href="{{ devmo_url('apps') }}">
+ <h2>{{ _('Create<br />Web Apps') | safe}}</h2>
+ <p>{{ _('Develop apps using Web standards and open technologies') }}</p>
</a>
<div></div>
</div>
<div class="promo" id="promo-fosdev">
- <a href="{{ _('https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS')}}">
- <h2>{{_("Firefox OS")}}<br />{{_("for developers")}}</h2>
- <p>{{_("Open source mobile OS built with HTML, JavaScript, & WebAPIs")}}</p>
+ <a href="{{ devmo_url('Mozilla/Firefox_OS') }}">
+ <h2>{{ _('Firefox OS<br />for developers') | safe }}</h2>
+ <p>{{ _('Open source mobile OS built with HTML, JavaScript, & WebAPIs') }}</p>
</a>
<div></div>
</div>
<div class="promo" id="promo-fosmob">
- <a href="{{ _('https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_for_Android')}}">
- <h2>{{_("Firefox MOBILE")}}<br />{{_("for developers")}}</h2>
- <p>{{_("How to use device APIs, test sites, & build mobile add-ons")}}</p>
+ <a href="{{ devmo_url('Mozilla/Firefox_for_Android')}}">
+ <h2>{{ _('Firefox MOBILE<br />for developers') | safe }}</h2>
+ <p>{{ _('How to use device APIs, test sites, & build mobile add-ons') }}</p>
</a>
<div></div>
</div>
<div class="promo" id="promo-fxdev">
- <a href="{{_('http://www.mozilla.com/en-US/firefox/channel/')}}">
- <h2>{{_("Firefox")}}<br />{{_("for developers")}}</h2>
- <p>{{_("See what’s new for web developers in the latest version of Firefox")}}</p>
+ <a href="{{ devmo_url('firefox/channel') }}">
+ <h2>{{ _('Firefox<br />for developers') | safe }}</h2>
+ <p>{{ _('See what’s new for web developers in the latest version of Firefox') }}</p>
</a>
<div></div>
</div>
@@ -1,20 +1,18 @@
from nose.tools import eq_, ok_
from pyquery import PyQuery as pq
import test_utils
-from waffle.models import Switch
import constance.config
from sumo.tests import LocalizingClient
from sumo.urlresolvers import reverse
-def get_promos(client, url):
+def get_promos(client, url, selector):
r = client.get(url, follow=True)
eq_(200, r.status_code)
doc = pq(r.content)
- aurora_promo = doc.find('#promo-aurora')
- social_promo = doc.find('#promo-social')
- return aurora_promo, social_promo
+ promo = doc.find(selector)
+ return promo
class HomeTests(test_utils.TestCase):
@@ -23,16 +21,8 @@ def setUp(self):
def test_social_promo(self):
url = reverse('landing.views.home')
-
- aurora_promo, social_promo = get_promos(self.client, url)
- ok_(aurora_promo)
- ok_(not social_promo)
-
- Switch.objects.create(name="social_promo", active=True)
-
- aurora_promo, social_promo = get_promos(self.client, url)
- ok_(not aurora_promo)
- ok_(social_promo)
+ promo = get_promos(self.client, url, '#promo-fosdev')
+ ok_(promo)
def test_google_analytics(self):
url = reverse('landing.views.home')
@@ -474,16 +474,16 @@ html[lang="en-US"] #promo-social div { background: url("../img/bg-social-promo-n
.home-promos .promo div { background-image: url("../img/bg-promos-top-homepage.jpg"); }
.home-promos .promo#promo-webapps { background-color: #667680; background-position: 0 0; }
.home-promos .promo#promo-webapps div { background-position: 10px 0; }
-.home-promos .promo#promo-webapps:hover div { background-position: -12px 0; }
+.home-promos .promo#promo-webapps:hover div, .home-promos .promo#promo-webapps:active div, .home-promos .promo#promo-webapps:focus div { background-position: -12px 0; }
.home-promos .promo#promo-fosdev { background-color: #088dd2; background-position: 0 489px; }
.home-promos .promo#promo-fosdev div { background-position: 10px -163px; }
-.home-promos .promo#promo-fosdev:hover div { background-position: -12px -163px; }
+.home-promos .promo#promo-fosdev:hover div, .home-promos .promo#promo-fosdev:active div, .home-promos .promo#promo-fosdev:focus div { background-position: -12px -163px; }
.home-promos .promo#promo-fosmob { background-color: #de5d0a; background-position: 0 326px; }
.home-promos .promo#promo-fosmob div { background-position: 10px -326px; }
-.home-promos .promo#promo-fosmob:hover div { background-position: -12px -326px; }
+.home-promos .promo#promo-fosmob:hover div, .home-promos .promo#promo-fosmob:active div, .home-promos .promo#promo-fosmob:focus div { background-position: -12px -326px; }
.home-promos .promo#promo-fxdev { background-color: #022856; background-position: 0 163px; }
.home-promos .promo#promo-fxdev div { background-position: 10px -489px; }
-.home-promos .promo#promo-fxdev:hover div { background-position: -12px -489px; }
+.home-promos .promo#promo-fxdev:hover div, .home-promos .promo#promo-fxdev:active div, .home-promos .promo#promo-fxdev:focus div { background-position: -12px -489px; }
.home-extra #webfwd-promo { margin: -15px 0 1.5em; }

0 comments on commit fafae22

Please sign in to comment.