Skip to content

Commit

Permalink
Merge pull request #14136 from minkyngkm/wd-13834-update-nav
Browse files Browse the repository at this point in the history
WD-13834 update navigation for /pro/distributor pages
  • Loading branch information
minkyngkm authored Aug 2, 2024
2 parents 145bdfb + 3226282 commit 3f3bdc8
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
14 changes: 14 additions & 0 deletions navigation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,20 @@ pro:
- title: Discourse
path: https://discourse.ubuntu.com/c/ubuntu-pro

Distributor:
title: Ubuntu Pro Distributor
path: /pro/distributor

children:
- title: Overview
path: /pro/distributor
- title: Account users
path: /pro/distributor/users
- title: Docs
path: https://documentation.ubuntu.com/pro
- title: Discourse
path: https://discourse.ubuntu.com/c/ubuntu-pro

account:
title: Account
path: /account
Expand Down
2 changes: 2 additions & 0 deletions static/js/src/advantage/distributor/Distributor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ const Distributor = () => {
<a
className="p-button--positive"
href="https://www.partner.canonical.com/#/deals/new"
target="_blank"
rel="noopener noreferrer"
>
<Icon
name={ICONS.externalLink}
Expand Down
11 changes: 10 additions & 1 deletion templates/templates/_navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
{% endif %}
{% endif %}
</div>

<nav class="p-navigation__nav"
aria-label="{{ breadcrumbs.section.title | replace(' ', '&nbsp;') | safe }} navigation">
{% if breadcrumbs.children %}
Expand Down Expand Up @@ -179,12 +179,21 @@
{% elif child.path != '/blog/archives' and child.path != '/blog/upcoming' %}
{% set has_access = not child.login_required or child.login_required and user_info %}
{% if has_access %}
{% if breadcrumbs.section.title == "Ubuntu Pro Distributor" and child.title == "Docs" or child.title == "Discourse" %}
<li class="p-navigation__item {% if child.active %}is-selected{% endif %}">
<a class="p-navigation__link"
href="{{ child.path }}" target="_blank"
{% if child.active %}aria-current="page"{% endif %}>{{
child.title }}</a>
</li>
{% else %}
<li class="p-navigation__item {% if child.active %}is-selected{% endif %}">
<a class="p-navigation__link"
href="{{ child.path }}"
{% if child.active %}aria-current="page"{% endif %}>{{
child.title }}</a>
</li>
{% endif %}
{% endif %}
{% endif %}
{% endif %}
Expand Down
3 changes: 3 additions & 0 deletions webapp/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@
"/pro/contracts/<contract_id>/token", view_func=get_contract_token
)
app.add_url_rule("/pro/users", view_func=advantage_account_users_view)
app.add_url_rule(
"/pro/distributor/users", view_func=advantage_account_users_view
)
app.add_url_rule("/pro/account-users", view_func=get_account_users)
app.add_url_rule(
"/pro/accounts/<account_id>/user",
Expand Down

0 comments on commit 3f3bdc8

Please sign in to comment.