278 lines
8.0 KiB
Plaintext
278 lines
8.0 KiB
Plaintext
<header class="np-header np-header-color">
|
|
<div class="np-header-content">
|
|
<div class="np-hidden-desktop np-header-mobile-menu-nav">
|
|
{% if current_person.signed_in? %}
|
|
<button
|
|
data-toggle-class="np-hidden"
|
|
class="np-header-mobile-menu-nav-button fal fa-times np-hidden np-header-font-color"
|
|
data-toggle-target=".np-header-mobile-avatar-menu,
|
|
.np-header-mobile-menu-content, .np-main, .np-footer"
|
|
></button>
|
|
<button
|
|
data-test="open-mobile-menu"
|
|
data-toggle-class="np-hidden"
|
|
class="np-header-mobile-menu-nav-button np-header-mobile-avatar-menu"
|
|
data-toggle-target=".fa-times, .np-header-mobile-menu-content, .np-main, .np-footer"
|
|
>
|
|
<img
|
|
alt="{{ current_person.name }}"
|
|
class="np-header-avatar-image"
|
|
src="{{ current_person.avatar_url }}"
|
|
/>
|
|
</button>
|
|
{% endif %}
|
|
</div>
|
|
{% if current_school.logo_url %}
|
|
<h1 class="header-logo">
|
|
<a href="{% route home %}">
|
|
<img
|
|
alt="{{ current_school.name }}"
|
|
class="np-header-logo-image"
|
|
src="{{ current_school.logo_url }}"
|
|
/>
|
|
</a>
|
|
</h1>
|
|
<div class="header-text chubb np-hidden-mobile">Online Learning Center</div>
|
|
{% else %}
|
|
<a href="{% route home %}" class="np-school-name np-header-font-color">
|
|
{{ current_school.name }}
|
|
</a>
|
|
{% endif %}
|
|
|
|
<div class="np-hidden-mobile np-header-desktop-nav">
|
|
<ul class="np-header-desktop-nav-list">
|
|
{% for website_navigation in navigations.header_navigations_external %}
|
|
<li class= "np-header-desktop-nav-item">
|
|
<a
|
|
href="{{ website_navigation.path }}"
|
|
class="np-header-desktop-nav-link np-header-font-color"
|
|
target="_blank"
|
|
>
|
|
{{ website_navigation.name }}
|
|
</a>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
|
|
{% if current_person.signed_in? %}
|
|
<div class="np-hidden-mobile np-header-search np-header-search-expanded">
|
|
<form action="{% route search %}" method="get" data-test="desktop-search">
|
|
<input
|
|
aria-label="{% t .search %}"
|
|
class="header-search-input"
|
|
type="text"
|
|
name="q"
|
|
placeholder="Search..."
|
|
/>
|
|
<i class="np-header-search-icon far fa-search"></i>
|
|
</form>
|
|
</div>
|
|
<div class="np-hidden-mobile np-header-avatar">
|
|
<button
|
|
class="np-header-avatar-button"
|
|
data-test="open-desktop-menu"
|
|
data-toggle-class-on-target="np-hidden"
|
|
data-toggle-target=".np-header-avatar-tooltip"
|
|
data-toggle-outside
|
|
>
|
|
<i class="fal fa-user-circle header-avatar-image"></i>
|
|
</button>
|
|
|
|
<div class="np-header-avatar-tooltip np-hidden" role="tooltip">
|
|
<span class="np-header-avatar-tooltip-arrow-up"></span>
|
|
<div class="np-header-avatar-tooltip-learner">
|
|
<div class="np-header-avatar-tooltip-learner-name">
|
|
{{ current_person.name }}
|
|
</div>
|
|
<div class="np-header-avatar-tooltip-learner-email">
|
|
{{ current_person.email }}
|
|
</div>
|
|
</div>
|
|
<nav class="np-header-avatar-tooltip-navigation">
|
|
{% unless current_school.sso_active? %}
|
|
<a
|
|
class="np-header-avatar-tooltip-navigation-link"
|
|
href="{% route account %}"
|
|
>
|
|
{% t .profile_settings %}
|
|
</a>
|
|
{% endunless %}
|
|
{% if current_person.signed_in? %}
|
|
<a
|
|
class="np-header-avatar-tooltip-navigation-link"
|
|
href="{% route transcript %}"
|
|
>
|
|
{% t .transcript %}
|
|
</a>
|
|
{% endif %}
|
|
<a
|
|
class="np-header-avatar-tooltip-navigation-link np-danger"
|
|
href="{% route logout %}"
|
|
>
|
|
{% t .sign_out %}
|
|
</a>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
{% else %}
|
|
<a
|
|
class="np-header-sign-in np-header-desktop-nav-link np-header-font-color"
|
|
aria-label="{% t shared.sign_in %}"
|
|
href="{% route login %}"
|
|
>
|
|
{% t shared.sign_in %}
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
<div class="hamburger-menu">
|
|
<i class="fal fa-bars" id="menu-icon"></i>
|
|
</div>
|
|
|
|
<div class="menu-container">
|
|
<div class="close-btn"><i class="fal fa-times"></i></div>
|
|
<ul class="menu">
|
|
<li><a href="/app">Home</a></li>
|
|
<li><a href="/app/dashboard">Dashboard</a></li>
|
|
<li><a href="/app/catalog">Catalog</a></li>
|
|
<li><a href="https://chubbeducation.com/olc-info">FAQ / User Guides</a></li>
|
|
<li><a href="https://secure.chubb.com/">Chubb Agent Portal</a></li>
|
|
<li><a href="https://chubbeducation.com/">chubbeducation.com</a></li>
|
|
</ul>
|
|
</div>
|
|
</header>
|
|
|
|
<div class="np-hidden-desktop">
|
|
<div class="np-header-mobile-menu-content np-hidden">
|
|
{% if current_person.signed_in? %}
|
|
<img
|
|
alt="{{ current_person.name }}"
|
|
class="np-header-mobile-menu-content-avatar"
|
|
src="{{ current_person.avatar_url }}"
|
|
/>
|
|
<div class="np-header-mobile-menu-content-name">
|
|
{{ current_person.name }}
|
|
</div>
|
|
{% endif %}
|
|
<div class="np-header-mobile-menu-content-nav">
|
|
<form
|
|
class="np-header-search"
|
|
data-test="mobile-search"
|
|
method="get"
|
|
action="{% route search %}"
|
|
>
|
|
<input
|
|
aria-label="{% t .search %}"
|
|
class="np-header-search-input"
|
|
type="text"
|
|
name="q"
|
|
placeholder="{% t .search %}"
|
|
/>
|
|
<i class="np-header-search-icon far fa-search"></i>
|
|
</form>
|
|
{% for website_navigation in navigations.header_navigations %}
|
|
<a
|
|
href="{{ website_navigation.path }}"
|
|
class="np-header-mobile-menu-content-button"
|
|
{% if website_navigation.external? %} target="_blank" {% endif %}
|
|
>
|
|
{{ website_navigation.name }}
|
|
</a>
|
|
{% endfor %}
|
|
<div class="np-header-mobile-menu-content-line"></div>
|
|
{% unless current_school.sso_active? %}
|
|
<a
|
|
class="np-header-mobile-menu-content-button"
|
|
href="{% route account %}"
|
|
>
|
|
{% t .profile_settings %}
|
|
</a>
|
|
{% endunless %}
|
|
<a
|
|
class="np-header-mobile-menu-content-button np-danger"
|
|
href="{% route logout %}"
|
|
>
|
|
{% t .sign_out %}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% include "messages" %}
|
|
|
|
<style>
|
|
.menu-container {
|
|
display: none;
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background-color: rgba(0, 0, 0, 0.7);
|
|
z-index:11;
|
|
}
|
|
|
|
.menu {
|
|
list-style: none;
|
|
padding: 30px 5%;
|
|
margin: 0;
|
|
background-color: #fff;
|
|
z-index: 40;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: last baseline;
|
|
}
|
|
|
|
.menu li {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.menu a {
|
|
text-decoration: none;
|
|
color: #333;
|
|
font-size: 18px;
|
|
}
|
|
|
|
.menu a:hover {
|
|
color: #6e27c5;
|
|
}
|
|
.close-btn {
|
|
position: absolute;
|
|
top: 20px;
|
|
right: 25px;
|
|
cursor: pointer;
|
|
font-size: 24px;
|
|
color: #333;
|
|
}
|
|
|
|
.close-btn:hover {
|
|
color: #6e27c5;
|
|
}
|
|
.np-header-mobile-menu-nav {
|
|
position: initial !important;
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
const hamburgerMenu = document.querySelector('.hamburger-menu');
|
|
const menuContainer = document.querySelector('.menu-container');
|
|
const closeBtn = document.querySelector('.close-btn');
|
|
|
|
hamburgerMenu.addEventListener('click', function () {
|
|
menuContainer.style.display = menuContainer.style.display === 'block' ? 'none' : 'block';
|
|
});
|
|
|
|
closeBtn.addEventListener('click', function () {
|
|
menuContainer.style.display = 'none';
|
|
});
|
|
|
|
menuContainer.addEventListener('click', function (e) {
|
|
if (e.target === menuContainer) {
|
|
menuContainer.style.display = 'none';
|
|
}
|
|
});
|
|
});
|
|
|
|
</script>
|