Skip to content

Commit

Permalink
Factorize the nav template code in a template of its own
Browse files Browse the repository at this point in the history
  • Loading branch information
magopian committed Jul 30, 2015
1 parent b983451 commit 832dbf6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 44 deletions.
24 changes: 1 addition & 23 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,29 +72,7 @@
<a href="//www.mozilla.org/" id="tabzilla">Mozilla</a>
</div>
<div class="amo-header">
<nav id="aux-nav" role="navigation" class="menu-nav c">
<ul>
{% if not settings.READ_ONLY %}
{% include "impala/user_login.html" %}
{% endif %}
{% block aux_nav %}
<li>
<a href="#" id="other-apps"
title="{{ _('Find add-ons for other applications') }}">
{{ _('Other Applications') }}</a>
<ul class="other-apps">
{% for app in amo.APP_USAGE %}
{% if app != request.APP and app != amo.MOBILE %}
<li id="app-{{ app.short }}" class="{{ app.short }}">
<a href="{{ locale_url(app.short) }}">{{ app.pretty }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</li>
{% endblock aux_nav %}
</ul>
</nav>
{% include "base_nav.html" %}
{% block header_search %}
<div class="header-search" role="search">
{% block search_form %}
Expand Down
21 changes: 21 additions & 0 deletions templates/base_nav.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<nav id="aux-nav" role="navigation" class="menu-nav c">
<ul>
{% if not settings.READ_ONLY %}
{% include "impala/user_login.html" %}
{% endif %}
{% block aux_nav %}
<li>
<a href="#" id="other-apps" title="{{ _('Find add-ons for other applications') }}">{{ _('Other Applications') }}</a>
<ul class="other-apps">
{% for app in amo.APP_USAGE %}
{% if app != request.APP and app != amo.MOBILE %}
<li id="app-{{ app.short }}" class="{{ app.short }}">
<a href="{{ locale_url(app.short) }}">{{ app.pretty }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</li>
{% endblock aux_nav %}
</ul>
</nav>
22 changes: 1 addition & 21 deletions templates/impala/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,7 @@
<a href="//www.mozilla.org/" id="tabzilla">Mozilla</a>
</div>
<div class="amo-header">
<nav id="aux-nav" role="navigation" class="menu-nav c">
<ul>
{% if not settings.READ_ONLY %}
{% include "impala/user_login.html" %}
{% endif %}
{% block aux_nav %}
<li>
<a href="#" id="other-apps" title="{{ _('Find add-ons for other applications') }}">{{ _('Other Applications') }}</a>
<ul class="other-apps">
{% for app in amo.APP_USAGE %}
{% if app != request.APP and app != amo.MOBILE %}
<li id="app-{{ app.short }}" class="{{ app.short }}">
<a href="{{ locale_url(app.short) }}">{{ app.pretty }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</li>
{% endblock aux_nav %}
</ul>
</nav>
{% include "base_nav.html" %}
<div class="header-search" role="search">
{% block search_form %}
{# Get this in scope. #}
Expand Down

0 comments on commit 832dbf6

Please sign in to comment.