Files
Gainsight/Custom_Templates/customer_templates/Walmart Supplier Prod/homepage.html.liquid
2024-08-23 18:51:09 -04:00

316 lines
7.7 KiB
Plaintext

{% comment %}
<script>
function showPopup() {
setTimeout(function() {
document.querySelector(".popup-trigger").click()
}, 500)
}
function showSurveyPopup() {
setTimeout(function() {
document.querySelector(".survey-popup-trigger").click()
}, 500)
}
function formatDate(date) {
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
const year = date.getFullYear();
return `${month}/${day}/${year}`;
}
function RerunWorkato() {
const today = new Date();
const formattedDate = formatDate(today);
const data = {
person_uuid: '{{current_person.id}}',
date: formattedDate
}
let webhookUrl
if (schoolID == "804edb32-c300-42f3-82b7-e5d55fcbc2a6") {
webhookUrl = "https://webhooks.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/user-interacted-with-popup"
} else if (schoolID == "10183441-2254-4b1e-a9f7-9549ca773257") { // live school
webhookUrl = "https://webhooks.workato.com/webhooks/rest/bd1a1eb7-7e79-4208-a1db-8e9c7440bcc9/user-interacted-with-popup-live"
}
if (webhookUrl) {
fetch(webhookUrl, {
method: 'post',
body: JSON.stringify(data)
}).then(function(response) {
return response.json();
}).then(function(data) {
console.log(res)
}).catch(error => {
console.log(error)
});
}
}
</script>
{% endcomment %}
{% assign catalog_courses = courses.in_catalog %}
{% include "header" %}
<main class="np-main np-homepage">
<div class="np-homepage-hero">
<div class="np-homepage-hero-container">
<div class="np-homepage-hero-content">
<div class="np-homepage-headline">
{{ homepage.headline }}
</div>
<div class="hero-search-wrapper">
<div class="np-homepage-subheadline">
{{ homepage.subheadline }}
</div>
<form
class="np-header-search np-hero-search"
data-test="mobile-search"
method="get"
action="{% route search %}">
<input
aria-label="What are you looking for?"
class="hero-search-input"
type="text"
name="q"
placeholder="What are you looking for?" />
<i class="np-header-search-icon hero-search-icon far fa-search"></i>
</form>
</div>
</div>
<img
class="np-homepage-hero-image"
src="{{ homepage.artwork_url }}"
alt="{{ homepage.headline }}" />
</div>
</div>
{% include "sub_navigation" %}
{% include "homepage_featured", items: catalog_courses %}
<div class="np-max-width np-homepage-row-wrapper">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12" style="display:flex; flex-direction:column;">
<div class="np-section-header">Progress Tracker</div>
<div class="learning-path-progress-container">
<div class="row">
{% assign lps_in_progress = 0 %}
{% assign enrolled_learning_paths = learning_paths.enrolled | sort: "progress" | reverse %}
{% for learning_path in enrolled_learning_paths %}
{% if learning_path.progress > 0 %}
{% assign lps_in_progress = lps_in_progress | plus: 1 %}
{% if lps_in_progress < 4 %}
<div class="col-xs-12 col-md-4">
{% include "cards_learning_path_progress" %}
</div>
{% endif %}
{% endif %}
{% endfor %}
{% if lps_in_progress > 0 %}
<div class="see-more-wrapper">
<a href="/app/dashboard" style="margin-top:24px;">See more</a>
</div>
{% endif %}
{% if lps_in_progress == 0 %}
<div class="col-xs-12">
<div class="np-learning-paths-resources-container">
<div class="np-zero-state-text">
Yikes! You don't have any learning Paths in progress.
</div>
<img class="np-zero-state-learning-paths" alt="" />
</div>
</div>
{% endif %}
</div>
</div>
</div>
{% comment %} {% if features.training_events? %}
<div class="col-xs-12 col-sm-5 col-md-4">
<div class="homepage-events">
<div class="np-section-header">Upcoming Courses</div>
<div class="upcoming events">
{% if training_events.available.any? %}
{% for training_event in training_events.available limit:1 %}
{% include "cards_training_event" with training_event %}
{% endfor %}
<div class="see-more-wrapper">
<a href="/app/training_events" style="margin-top:24px;">See more</a>
</div>
{% else %}
{% include "training_events_zero_state" %}
{% endif %}
</div>
</div>
</div>
{% endif %} {% endcomment %}
</div>
</div>
{% include "homepage_ongoing_training", items: catalog_courses %}
{% include "homepage_topics" %}
{%- comment -%}
<button
type="button"
class="popup-trigger"
data-toggle-class-on-target
data-toggle-target="#firstTimeUsers"
data-toggle-escape
data-toggle-modal>
Click
</button>
<button
type="button"
class="survey-popup-trigger"
data-toggle-class-on-target
data-toggle-target="#surveyPopup"
data-toggle-escape
data-toggle-modal>
Click
</button>
</main>
{%- endcomment -%}
{% include "footer" %}
<style>
.np-homepage-hero {
background-color: #0071ce;
padding: 40px 24px 24px;
flex-direction: column;
height: 250px;
}
.np-homepage-hero-image {
object-fit: unset;
width: 115px;
height: auto;
min-height: unset;
margin-top: 24px;
}
.np-homepage-hero-content {
position: relative;
padding: 0;
color: #fff;
}
.np-homepage-hero .np-homepage-headline {
font-weight: 700;
font-size: 24px;
line-height: 33px;
margin-bottom: 24px;
}
.np-homepage-subheadline {
font-size: 20px;
line-height: 24px;
margin-bottom: 8px;
opacity: 1;
}
.np-hero-search {
width: 100%;
}
.hero-search-input {
background-color: #F1F3F4;
border-radius: 4px;
padding: 14px 19px 14px 44px;
border: none;
font-size: 14px;
line-height: 19px;
width: 100%;
background: #fff;
}
.hero-search-icon {
right: unset;
left: 16px;
color: #6C6C6C;
}
.np-homepage-row-wrapper {
padding: 0 16px;
margin-bottom: 56px;
}
.np-homepage-featured-empty {
margin: 0;
border: 2px solid #dadce0;
border-radius: 8px;
padding: 60px 32px;
}
.learning-path-progress-container,
.learning-path-progress-container > .row {
height: 100%;
}
.popup-trigger,
.survey-popup-trigger {
visibility: hidden;
opacity: 0;
}
@media(min-width:768px) {
.np-homepage-hero-container {
display: flex;
align-items: center;
}
.np-homepage-hero .np-homepage-headline {
font-size: 40px;
line-height: 50px;
margin-bottom: 20px;
text-align: left;
}
.np-homepage-hero-image {
width: 200px;
height: auto;
margin: 0 0 0 64px;
}
.hero-search-wrapper {
display: flex;
}
.np-hero-search {
margin-left: 32px;
flex: 2;
}
}
@media(min-width:768px) and (max-width:1365px) {
.np-homepage-hero .np-homepage-headline {
font-size: 3.516vw;
line-height: 4.249vw;
}
}
@media(min-width:1200px) {
.np-homepage-hero-image {
width: 300px;
margin: 0 0 0 100px;
}
}
@media(min-width:1366px) {
.np-homepage-hero .np-homepage-headline {
font-size: 48px;
line-height: 58px;
}
}
</style>