Skip to content

Commit

Permalink
Only show one header (bug 682359)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkoberger committed Aug 26, 2011
1 parent b41fe18 commit c349bb0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
3 changes: 3 additions & 0 deletions apps/devhub/templates/devhub/base.html
Expand Up @@ -5,6 +5,9 @@
{% endif %}
{% block bodyclass %}developer-hub {{ editable }}{% endblock %}

{# Don't show the amo header on devhub pages #}
{% set hide_header = True %}

{% block bodyattrs %}
{% if addon %}data-default-locale="{{ addon.default_locale|lower }}"{% endif %}
{% endblock %}
Expand Down
13 changes: 13 additions & 0 deletions apps/devhub/tests/test_views.py
Expand Up @@ -137,6 +137,19 @@ def test_my_addons(self):
eq_(doc('#site-nav ul li.top').eq(0).find('li a').eq(7).text(),
'more add-ons...')

def test_only_one_header(self):
# For bug 682359.
# Remove this test when we switch to Impala in the devhub!
url = reverse('devhub.addons')
r = self.client.get(url)
doc = pq(r.content)

# Make sure we're on a non-impala page
error = "This test should be run on a non-impala page"
assert doc('.is-impala').length == 0, error

assert doc('#header').length == 0, "Uh oh, there's two headers!"


class TestDashboard(HubTest):

Expand Down
3 changes: 3 additions & 0 deletions apps/editors/templates/editors/base.html
Expand Up @@ -4,6 +4,9 @@

{% block bodyclass %}editor-tools {% endblock %}

{# Don't show the amo header on editor pages #}
{% set hide_header = True %}

{% block site_header_title %}
<h1 class="site-title">
<a href="{{ url('editors.home') }}" title="{{ _('Return to the Editor Tools homepage') }}">
Expand Down
2 changes: 1 addition & 1 deletion templates/base.html
Expand Up @@ -62,7 +62,7 @@
{% endif %}
<div class="section">
{% block site_header %}
{% if request.APP == amo.FIREFOX or request.APP == amo.MOBILE %}
{% if not hide_header and (request.APP == amo.FIREFOX or request.APP == amo.MOBILE) %}
{% include "amo_header.html" %}
{% else %}
<div id="minimal-header"><a class="mozilla" href="http://www.mozilla.org/">
Expand Down
2 changes: 1 addition & 1 deletion templates/impala/base.html
Expand Up @@ -43,7 +43,7 @@
<meta name="csrf" content="{{ csrf_token }}">
{% endif %}
</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 %} is-impala"
data-app="{{ request.APP.short }}"
data-appname="{{ request.APP.pretty }}"
data-appid="{{ request.APP.id }}"
Expand Down

0 comments on commit c349bb0

Please sign in to comment.