Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix bug 777837: Separate apps landing page from waffle switch for app…

…s promo on home page
  • Loading branch information...
commit 5641ec0bb71aa05ab08bf47c4bf3f8fc2a03c59b 1 parent 9b22fba
@lmorchard lmorchard authored openjck committed
View
2  apps/landing/templates/landing/home.html
@@ -143,7 +143,7 @@
<div class="home-extra">
<div class="col-1">
- {% if waffle.switch('apps_landing') %}
+ {% if waffle.switch('apps_promo') %}
<figure id="apps-promo" class="promo banner">
<a href="{{ url('apps') }}">
<img src="{{MEDIA_URL}}img/labsapps-promo-456x150.png" width="456" height="150" alt="{{ _("Be part of the Mozilla Labs Apps project. Learn More.") }}">
View
22 apps/landing/test_views.py
@@ -127,17 +127,6 @@ def test_apps_menu_item(self):
url = reverse('landing.views.home')
r = self.client.get(url)
eq_(200, r.status_code)
-
- doc = pq(r.content)
- nav_sub_topics = doc.find('ul#nav-sub-topics')
- ok_(nav_sub_topics)
- apps_item = nav_sub_topics.find('li#nav-sub-apps')
- eq_([], apps_item)
-
- s = Switch.objects.create(name='apps_landing', active=True)
- s.save()
- r = self.client.get(url)
- eq_(200, r.status_code)
doc = pq(r.content)
nav_sub_topics = doc.find('ul#nav-sub-topics')
ok_(nav_sub_topics)
@@ -146,11 +135,6 @@ def test_apps_menu_item(self):
def test_apps(self):
url = reverse('landing.views.apps')
- r = self.client.get(url)
- eq_(404, r.status_code)
-
- s = Switch.objects.create(name='apps_landing', active=True)
- s.save()
r = self.client.get(url, follow=True)
eq_(200, r.status_code)
doc = pq(r.content)
@@ -161,8 +145,6 @@ def test_apps(self):
@patch('landing.views.basket.subscribe')
def test_apps_subscription(self, subscribe):
subscribe.return_value = True
- s = Switch.objects.create(name='apps_landing', active=True)
- s.save()
url = reverse('landing.views.apps_subscription')
r = self.client.post(url,
{'format': 'html',
@@ -177,8 +159,6 @@ def test_apps_subscription(self, subscribe):
@patch('landing.views.basket.subscribe')
def test_apps_subscription_ajax(self, subscribe):
subscribe.return_value = True
- s = Switch.objects.create(name='apps_landing', active=True)
- s.save()
url = reverse('landing.views.apps_subscription')
r = self.client.post(url,
{'format': 'html',
@@ -196,8 +176,6 @@ def test_apps_subscription_ajax(self, subscribe):
@patch('landing.views.basket.subscribe')
def test_apps_subscription_bad_values(self, subscribe):
subscribe.return_value = True
- s = Switch.objects.create(name='apps_landing', active=True)
- s.save()
url = reverse('landing.views.apps_subscription')
r = self.client.post(url, {'format': 1, 'email': 'nope'})
eq_(200, r.status_code)
View
2  apps/landing/views.py
@@ -67,14 +67,12 @@ def web(request):
return common_landing(request, section=SECTION_WEB)
-@waffle_switch('apps_landing')
def apps(request):
"""Web landing page."""
return common_landing(request, section=SECTION_APPS,
extra={'form': SubscriptionForm()})
-@waffle_switch('apps_landing')
def apps_subscription(request):
form = SubscriptionForm(data=request.POST)
context = {'form': form}
View
2  templates/base.html
@@ -64,9 +64,7 @@ <h1 id="logo"><a href="{{ url('home') }}"><img src="{{ MEDIA_URL }}img/mdn-logo-
<li id="nav-main-topics" class="menu"><a href="#nav-sub-topics" class="toggle" aria-haspopup="true" aria-labelledby="nav-main-topics" title="{{ _('Explore other parts of MDN') }}">{{ _('Topics') }}</a>
<ul id="nav-sub-topics" class="sub-menu" aria-hidden="true">
<li id="nav-sub-web"><a href="{{ url('web') }}">{{ _('Web') }}</a></li>
- {% if waffle.switch('apps_landing') %}
<li id="nav-sub-apps"><a href="{{ url('apps') }}">{{ _('Apps') }}</a></li>
- {% endif %}
<li id="nav-sub-mobile"><a href="{{ url('mobile') }}">{{ _('Mobile') }}</a></li>
<li id="nav-sub-addons"><a href="{{ url('addons') }}">{{ _('Add-ons') }}</a></li>
<li id="nav-sub-mozilla"><a href="{{ url('mozilla') }}">{{ _('Mozilla') }}</a></li>
Please sign in to comment.
Something went wrong with that request. Please try again.