Skip to content

Commit

Permalink
Sub nav updates: (#14751)
Browse files Browse the repository at this point in the history
* Sub nav updates:
1. Update /firefox to have consistent sub navs
2. Remove and re-order links on /firefox/more page

* remove unused ftl string

* remove redundant sub-nav variations

* add sub nav to features, brower comparison and more pages
  • Loading branch information
wen-2018 authored Jul 10, 2024
1 parent d4a7f61 commit 7babc30
Show file tree
Hide file tree
Showing 29 changed files with 135 additions and 265 deletions.
4 changes: 4 additions & 0 deletions bedrock/firefox/templates/firefox/all-unified.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
{% set android_nightly_url = android_nightly_full_builds[0].platforms.android.download_url %}
{% set ios_url = ios_release_full_builds[0].platforms.ios.download_url %}

{% block sub_navigation %}
{% include 'firefox/includes/sub-nav-firefox.html' %}
{% endblock %}

{% block content %}
<main>
<div class="mzp-l-content">
Expand Down
2 changes: 2 additions & 0 deletions bedrock/firefox/templates/firefox/base/base-protocol.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@

{% block body_class %}{{ super() }} mzp-t-firefox{% endblock %}
{% block body_attrs %}{{ super() }} data-global-nav-current-link="firefox"{% endblock %}

{% block sub_navigation %}{% endblock %}
4 changes: 4 additions & 0 deletions bedrock/firefox/templates/firefox/browsers/compare/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ <h3 class="c-compare-item-title">{{ title }}</h3>

{% block body_class %}compare-index{% endblock %}

{% block sub_navigation %}
{% include 'firefox/includes/sub-nav-firefox.html' %}
{% endblock %}

{% block content %}
{{ callout (
title=self.page_title(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
{% endblock %}

{% block sub_navigation %}
{% include 'firefox/browsers/mobile/includes/sub-nav.html' %}
{% include 'firefox/includes/sub-nav-firefox.html' %}
{% endblock %}

{% block content %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
{% endblock %}

{% block sub_navigation %}
{% include 'firefox/browsers/mobile/includes/sub-nav.html' %}
{% include 'firefox/includes/sub-nav-firefox.html' %}
{% endblock %}

{% block content %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
{% set android_url = play_store_url('firefox', 'firefox-browsers-mobile-get-app') %}
{% set ios_url = app_store_url('firefox', 'firefox-browsers-mobile-get-app') %}

{% block sub_navigation %}
{% include 'firefox/includes/sub-nav-firefox.html' %}
{% endblock %}

{% block content %}
<main class="mzp-l-content mzp-t-content-md mzp-t-firefox">
<section>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
{% endblock %}

{% block sub_navigation %}
{% include 'firefox/browsers/mobile/includes/sub-nav.html' %}
{% include 'firefox/includes/sub-nav-firefox.html' %}
{% endblock %}

{% block content %}
Expand Down
2 changes: 1 addition & 1 deletion bedrock/firefox/templates/firefox/browsers/mobile/ios.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
{% endblock %}

{% block sub_navigation %}
{% include 'firefox/browsers/mobile/includes/sub-nav.html' %}
{% include 'firefox/includes/sub-nav-firefox.html' %}
{% endblock %}

{% block content %}
Expand Down
18 changes: 1 addition & 17 deletions bedrock/firefox/templates/firefox/enterprise/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,7 @@
{% endblock %}

{% block sub_navigation %}
<nav class="c-sub-navigation">
<div class="mzp-l-content">
<div class="c-sub-navigation-content">
<h2 class="c-sub-navigation-title is-summary">
<a href="{{ url('firefox') }}" data-link-type="nav" data-link-position="subnav" data-link-text="Firefox">
<img class="c-sub-navigation-icon" src="{{ static('protocol/img/logos/firefox/logo.svg') }}" width="24" height="24" alt="">
{{ ftl('sub-navigation-firefox') }}
</a>
</h2>
<ul class="c-sub-navigation-list is-details is-closed">
<li class="c-sub-navigation-item"><a href="{{ url('firefox.developer.index') }}" data-link-type="nav" data-link-position="subnav" data-link-text="Developer Edition">{{ ftl('sub-navigation-developer-edition') }}</a></li>
<li class="c-sub-navigation-item"><a href="{{ url('firefox.channel.desktop') }}" data-link-type="nav" data-link-position="subnav" data-link-text="Nightly and Beta">{{ ftl('sub-navigation-nightly-and-beta') }}</a></li>
<li class="c-sub-navigation-item"><a href="{{ url('firefox.all') }}" data-link-type="nav" data-link-position="subnav" data-link-text="All Languages">{{ ftl('sub-navigation-all-languages', fallback='download-button-systems-languages') }}</a></li>
</ul>
</div>
</div>
</nav>
{% include 'firefox/includes/sub-nav-firefox.html' %}
{% endblock %}

{% block content %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
{{ css_bundle('firefox_facebook_container') }}
{% endblock %}

{% block sub_navigation %}
{% include 'firefox/includes/sub-nav-firefox.html' %}
{% endblock %}

{% block content %}
<main>
{% call split(
Expand Down
4 changes: 4 additions & 0 deletions bedrock/firefox/templates/firefox/features/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ <h3 class="c-feature-item-title">{{ title }}</h3>

{% block body_class %}features-index{% endblock %}

{% block sub_navigation %}
{% include 'firefox/includes/sub-nav-firefox.html' %}
{% endblock %}

{% block content %}
{{ callout (
title=self.page_title(),
Expand Down
42 changes: 42 additions & 0 deletions bedrock/firefox/templates/firefox/includes/sub-nav-firefox.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

{#
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 https://mozilla.org/MPL/2.0/.
#}

{% from "macros.html" import sub_nav with context %}

{{ sub_nav(
title={
'text': ftl('sub-navigation-firefox'),
'href': url('firefox'),
'icon': static('protocol/img/logos/firefox/logo.svg')
},
links=[
{
'text': ftl('sub-navigation-desktop') ,
'href': url('firefox.new'),
'cta_name': "Desktop"
},
{
'text': ftl('sub-navigation-mobile'),
'href': url('firefox.browsers.mobile.index') ,
'cta_name': "Mobile"
},
{
'text': ftl('sub-navigation-features'),
'href': url('firefox.features.index'),
'cta_name': "Features"
},
{
'text': ftl('sub-navigation-compare-browsers'),
'href': url('firefox.browsers.compare.index'),
'cta_name': "Compare Browsers"
},
{
'text': ftl('sub-navigation-more'),
'href': url('firefox.more'),
'cta_name': "More"
}]
) }}
37 changes: 1 addition & 36 deletions bedrock/firefox/templates/firefox/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,42 +43,7 @@
{% set _entrypoint = 'mozilla.org-firefox-home' %}

{% block sub_navigation %}
{% if ftl_has_messages('sub-navigation-firefox', 'sub-navigation-what-is-a-browser', 'sub-navigation-browsing-history') %}
<nav class="c-sub-navigation">
<div class="mzp-l-content">
<div class="c-sub-navigation-content">
<h2 class="c-sub-navigation-title is-summary">
<a href="{{ url('firefox') }}" data-link-type="nav" data-link-position="subnav" data-link-text="Firefox">
<img class="c-sub-navigation-icon" src="{{ static('protocol/img/logos/firefox/logo.svg') }}" width="24" height="24" alt="">
{{ ftl('sub-navigation-firefox') }}
</a>
</h2>
<ul class="c-sub-navigation-list is-details is-closed">
<li class="c-sub-navigation-item">
<a href="{{ url('firefox.browsers.what-is-a-browser') }}" data-link-type="nav" data-link-position="subnav" data-link-text="What Is a Browser?">
{{ ftl('sub-navigation-what-is-a-browser') }}
</a>
</li>
<li class="c-sub-navigation-item">
<a href="{{ url('firefox.browsers.browser-history') }}" data-link-type="nav" data-link-position="subnav" data-link-text="Browser History">
{{ ftl('sub-navigation-browser-history') }}
</a>
</li>
<li class="c-sub-navigation-item">
<a href="{{ url('firefox.faq') }}" data-link-type="nav" data-link-position="subnav" data-link-text="FAQ">
{{ ftl('sub-navigation-faq') }}
</a>
</li>
<li class="c-sub-navigation-item">
<a href="{{ url('firefox.more') }}" data-link-type="nav" data-link-position="subnav" data-link-text="Learn More">
{{ ftl('sub-navigation-learn-more') }}
</a>
</li>
</ul>
</div>
</div>
</nav>
{% endif %}
{% include 'firefox/includes/sub-nav-firefox.html' %}
{% endblock %}

{% block content %}
Expand Down
Loading

0 comments on commit 7babc30

Please sign in to comment.