385 lines
10 KiB
Plaintext
385 lines
10 KiB
Plaintext
{% assign is_in_authenticated_group = false %}
|
|
|
|
{% for group in current_person.groups %}
|
|
{% if group.name == "All Users" or group.id == "6331d115-ea74-418a-99b2-af5c81208fe1" %}
|
|
{% assign is_in_authenticated_group = true %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
{% if current_person.email contains "+preview" %}
|
|
{% assign is_in_authenticated_group = true %}
|
|
{% endif %}
|
|
|
|
{% unless is_in_authenticated_group %}
|
|
<script>
|
|
console.log(window.location.pathname)
|
|
if (window.location.pathname != "/app") {
|
|
window.location.replace("/app")
|
|
}
|
|
</script>
|
|
{% endunless %}
|
|
|
|
<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"
|
|
>
|
|
{% comment %} <img
|
|
alt="{{ current_person.name }}"
|
|
class="np-header-avatar-image"
|
|
src="{{ current_person.avatar_url }}"
|
|
/> {% endcomment %}
|
|
<i class="far fa-bars"></i>
|
|
</button>
|
|
{% endif %}
|
|
</div>
|
|
{% if current_school.logo_url %}
|
|
<h1 class="np-header-logo">
|
|
<a href="/app/catalog">
|
|
<img
|
|
alt="{{ current_school.name }}"
|
|
class="np-header-logo-image"
|
|
src="{{ current_school.logo_url }}"
|
|
/>
|
|
</a>
|
|
</h1>
|
|
{% else %}
|
|
<a href="/app/catalog" 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">
|
|
<li class="np-header-desktop-nav-item">
|
|
<a href="/app/catalog" class="np-header-desktop-nav-link trainings-link">
|
|
Trainings
|
|
</a>
|
|
</li>
|
|
|
|
<li class="np-header-desktop-nav-item">
|
|
<a href="/app/learning_paths" class="np-header-desktop-nav-link learning-paths-link">
|
|
Lernweg
|
|
</a>
|
|
</li>
|
|
|
|
<li class="np-header-desktop-nav-item">
|
|
<a href="/app/zertifikate" class="np-header-desktop-nav-link certs-link">
|
|
Auszeichnungen
|
|
</a>
|
|
</li>
|
|
|
|
<li class="np-header-desktop-nav-item">
|
|
<a href="/app/on-the-job" class="np-header-desktop-nav-link videos-link">
|
|
On-The-Job Videos
|
|
</a>
|
|
</li>
|
|
|
|
{% comment %} <li class="np-header-desktop-nav-item" style="pointer-events:none;opacity: 0.6;">
|
|
<a href="/app/training_events" class="np-header-desktop-nav-link events-link">
|
|
Veranstaltungen
|
|
</a>
|
|
</li> {% endcomment %}
|
|
|
|
{% 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="np-header-search-input np-header-font-background-color"
|
|
type="text"
|
|
name="q"
|
|
placeholder="{% t .search %}"
|
|
/>
|
|
<i class="np-header-search-icon far fa-search" aria-label="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
|
|
>
|
|
<img
|
|
alt="{{ current_person.name }}"
|
|
class="np-header-avatar-image"
|
|
src="{{ current_person.avatar_url }}"
|
|
>
|
|
</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 %}
|
|
<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"
|
|
href="{% route login %}"
|
|
>
|
|
{% t shared.sign_in %}
|
|
</div>
|
|
{% endif %}
|
|
</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" aria-label="search"></i>
|
|
</form>
|
|
|
|
<a href="/app/catalog" class="np-header-mobile-menu-content-button">
|
|
Trainings
|
|
</a>
|
|
|
|
<a href="/app/learning_paths" class="np-header-mobile-menu-content-button">
|
|
Lernweg
|
|
</a>
|
|
|
|
<a href="/app/zertifikate" class="np-header-mobile-menu-content-button">
|
|
Auszeichnungen
|
|
</a>
|
|
|
|
<a href="/app/on-the-job" class="np-header-mobile-menu-content-button">
|
|
On-The-Job Videos
|
|
</a>
|
|
|
|
{% comment %} <a href="/app/training_events" class="np-header-mobile-menu-content-button" style="pointer-events:none;
|
|
opacity: 0.6;">
|
|
Veranstaltungen
|
|
</a> {% endcomment %}
|
|
|
|
<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>
|
|
|
|
.np-header {
|
|
height: auto;
|
|
padding-top: 12px;
|
|
}
|
|
|
|
body.mobile-menu-open .np-header {
|
|
background-color:#3e1191;
|
|
}
|
|
|
|
.np-header-logo {
|
|
padding: 0.75rem 0;
|
|
}
|
|
|
|
.np-header-logo-image {
|
|
height:30px;
|
|
}
|
|
|
|
.np-header .fa-bars {
|
|
font-size: 28px;
|
|
color: #fff;
|
|
}
|
|
|
|
.np-header-mobile-menu-content {
|
|
background-color: #8B78FA;
|
|
top:66px;
|
|
}
|
|
|
|
.np-header-mobile-menu-nav-button.np-header-font-color {
|
|
color:#fff;
|
|
}
|
|
|
|
.np-header-mobile-menu-content-avatar {
|
|
width:75px;
|
|
height:75px;
|
|
}
|
|
|
|
.np-header-mobile-menu-content-name {
|
|
color:#fff;
|
|
}
|
|
|
|
|
|
@media screen and ( min-width: 48rem ) {
|
|
.np-header-logo {
|
|
padding: 1.25rem 0;
|
|
}
|
|
}
|
|
/* --- Navigation --- */
|
|
.np-header-desktop-nav-list {
|
|
justify-content: end;
|
|
margin: 1rem;
|
|
padding-left: 0;
|
|
}
|
|
.np-header-desktop-nav-link {
|
|
padding: 0.1rem 0.75rem 0.15rem;
|
|
border: transparent 2px solid;
|
|
border-radius: 3rem;
|
|
color:#fff;
|
|
font-size:18px;
|
|
margin-right:12px;
|
|
}
|
|
.np-header-desktop-nav-item {
|
|
padding: 0;
|
|
margin: 2px;
|
|
}
|
|
|
|
.np-header-desktop-nav-link:focus,
|
|
.np-header-desktop-nav-link:hover {
|
|
border-color: #7625f7;
|
|
color:#fff;
|
|
outline: none;
|
|
}
|
|
|
|
.np-header-desktop-nav-link.is-active {
|
|
background-color: #8b78fa;
|
|
}
|
|
.np-header-desktop-nav-link.is-active:focus {
|
|
border-color: #275cb8;
|
|
}
|
|
|
|
.np-header-search-input:hover + .np-header-search-icon {
|
|
color: #bfe4ff;
|
|
}
|
|
|
|
.np-header-search-input:focus {
|
|
border-color: #275cb8;
|
|
outline: none;
|
|
border-radius: 3rem;
|
|
padding: 0 1.25rem 0 2.5rem;
|
|
}
|
|
|
|
.np-header-search-input:focus + .np-header-search-icon {
|
|
color: #304780;
|
|
}
|
|
|
|
.np-header-mobile-menu-content-button.np-danger {
|
|
border-color: #ff5773;
|
|
color: #E52242;
|
|
}
|
|
|
|
@media (min-width:768px) {
|
|
.np-header-search-input {
|
|
opacity: unset;
|
|
border-radius: 3rem;
|
|
background-color: #304780;
|
|
}
|
|
|
|
.np-header-search-icon {
|
|
right: unset;
|
|
left: 0.75rem;
|
|
}
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
const currentPath = window.location.pathname;
|
|
|
|
if (currentPath == "/app/courses") {
|
|
$(".trainings-link").addClass("is-active")
|
|
} else if (currentPath.includes("/app/learning_paths")) {
|
|
$(".learning-paths-link").addClass("is-active")
|
|
} else if (currentPath == "/app/zertifikate") {
|
|
$(".certs-link").addClass("is-active")
|
|
} else if (currentPath == "/app/on-the-job") {
|
|
$(".videos-link").addClass("is-active")
|
|
} else if (currentPath.includes("/app/training_events")) {
|
|
$(".events-link").addClass("is-active")
|
|
}
|
|
|
|
$("button[data-test='open-mobile-menu']").click(function() {
|
|
console.log($(this))
|
|
$("body").addClass("mobile-menu-open")
|
|
})
|
|
|
|
$(".np-header-mobile-menu-nav-button:not([data-test='open-mobile-menu'])").click(function() {
|
|
$("body").removeClass("mobile-menu-open")
|
|
})
|
|
|
|
</script> |