Use same topbar nav on public/logged in pages

This commit is contained in:
Patrick Smith 2019-02-05 20:40:08 -05:00
parent faa3bcf31e
commit 095cdcc42b
3 changed files with 23 additions and 45 deletions

View File

@ -17,31 +17,7 @@
<div id='app-root'> <div id='app-root'>
{% include 'components/usa_header.html' %} {% include 'components/usa_header.html' %}
<header class="topbar topbar--public"> {% include 'navigation/topbar.html' %}
<nav class="topbar__navigation">
<a href="{{ url_for('atst.home') }}" class="topbar__link topbar__link--home">
{{ Icon('shield', classes='topbar__link-icon') }}
<span class="topbar__link-label">{{ "base_public.header_title" | translate }}</span>
</a>
{% if g.current_user %}
<a href="{{ url_for('users.user') }}" class="topbar__link">
<span class="topbar__link-label">{{ g.current_user.first_name + " " + g.current_user.last_name }}</span>
{{ Icon('avatar', classes='topbar__link-icon') }}
</a>
<a href="{{ url_for('atst.logout') }}" class="topbar__link" title='Log out of JEDI Cloud'>
{{ Icon('logout', classes='topbar__link-icon') }}
</a>
{% else %}
<a href="{{ url_for('atst.home') }}" class="topbar__link" title='Log in'>
<span class="topbar__link-label">{{ "base_public.login" | translate }}</span>
{{ Icon('avatar', classes='topbar__link-icon') }}
</a>
{% endif %}
</nav>
</header>
{% block content %}{% endblock %} {% block content %}{% endblock %}

View File

@ -2,18 +2,12 @@
<header class="topbar"> <header class="topbar">
<nav class="topbar__navigation"> <nav class="topbar__navigation">
{% if not portfolio %}
<a href="{{ url_for('atst.home') }}" class="topbar__link topbar__link--home"> <a href="{{ url_for('atst.home') }}" class="topbar__link topbar__link--home">
{{ Icon('shield', classes='topbar__link-icon') }} {{ Icon('shield', classes='topbar__link-icon') }}
<span class="topbar__link-label"> <span class="topbar__link-label">
{{ "navigation.topbar.jedi_cloud_link_text" | translate }} {{ "navigation.topbar.jedi_cloud_link_text" | translate }}
</span> </span>
</a> </a>
{% else %}
<a href="{{ url_for('atst.home') }}" class="topbar__link topbar__link--shield" title="JEDI Cloud Home">
{{ Icon('shield', classes='topbar__link-icon') }}
</a>
{% endif %}
<div class="topbar__context {% if portfolio %}topbar__context--portfolio{% endif %}"> <div class="topbar__context {% if portfolio %}topbar__context--portfolio{% endif %}">
{% if portfolio %} {% if portfolio %}
@ -59,14 +53,22 @@
{% endif %} {% endif %}
{% if g.current_user %}
<a href="{{ url_for('users.user') }}" class="topbar__link"> <a href="{{ url_for('users.user') }}" class="topbar__link">
<span class="topbar__link-label">{{ g.current_user.first_name + " " + g.current_user.last_name }}</span> <span class="topbar__link-label">{{ g.current_user.first_name + " " + g.current_user.last_name }}</span>
{{ Icon('avatar', classes='topbar__link-icon') }} {{ Icon('avatar', classes='topbar__link-icon') }}
</a> </a>
<a href="{{ url_for('atst.logout') }}" class="topbar__link" title='{{ "navigation.topbar.logout_link_title" | translate }}'> <a href="{{ url_for('atst.logout') }}" class="topbar__link" title='{{ "navigation.topbar.logout_link_title" | translate }}'>
<span class="topbar__link-label">Logout</span>
{{ Icon('logout', classes='topbar__link-icon') }} {{ Icon('logout', classes='topbar__link-icon') }}
</a> </a>
{% else %}
<a href="{{ url_for('atst.home') }}" class="topbar__link" title='Log in'>
<span class="topbar__link-label">{{ "base_public.login" | translate }}</span>
{{ Icon('avatar', classes='topbar__link-icon') }}
</a>
{% endif %}
</div> </div>
</nav> </nav>
</header> </header>

View File

@ -290,7 +290,7 @@ login:
title_tag: Sign in | JEDI Cloud title_tag: Sign in | JEDI Cloud
navigation: navigation:
topbar: topbar:
jedi_cloud_link_text: JEDI Cloud jedi_cloud_link_text: JEDI
logout_link_title: Log out of JEDI Cloud logout_link_title: Log out of JEDI Cloud
named_portfolio: 'Portfolio {portfolio}' named_portfolio: 'Portfolio {portfolio}'
no_other_active_portfolios: You have no other active JEDI portfolios. no_other_active_portfolios: You have no other active JEDI portfolios.