Update Walmart Spark templates. Backedup all their hidden tags in course settings and removed so they don't show up in the search results anymore.

This commit is contained in:
Norm Rasmussen
2023-11-22 22:38:06 -05:00
parent 7bc8b430be
commit 87b721483f
14 changed files with 630 additions and 105 deletions

Binary file not shown.

View File

@ -1 +1,39 @@
{% capture course_path %}{% route course, id: course.id %}{% endcapture %}{% capture course_label %}{% endcapture %}{% capture course_data_label %}none{% endcapture %} {% assign course_is_new = false %} {% assign created_at_date_seconds = current_person.created_at | date: "%s" %} {% assign course_published_date_seconds = course.properties.initial_publish_date | date: "%s" %} {% if course_published_date_seconds > created_at_date_seconds %}{% assign course_is_new = true %}{% endif %}{% if course_is_new %}{% if course.progress == 0 %}{% capture course_label %}<div class="label label-green new-topic-label">New</div>{% endcapture %}{% capture course_data_label %}new{% endcapture %} {% endif %} {% endif %} {% if course.progress > 0 and course.progress < 100 %}{% capture course_label %}<div class="label label-orange">In progress</div>{% endcapture %}{% capture course_data_label %}in-progress{% endcapture %} {% elsif course.completed? %} {% capture course_label %}<div class="label label-gray">Viewed</div>{% endcapture %}{% capture course_data_label %}viewed{% endcapture %}{% endif %}<a href="{{ course_path }}" class="np-card"><div class="np-card-container">{% if course.ribbon %}<div class="np-card-ribbon">{{ course.ribbon }}</div>{% endif %}<img class="np-card-image" alt="{{ course.name }}" src="{{ course.image_url }}" width="819" height="503" /> <div class="np-card-content np-card-content-vertical np-card-padding"><h3 class="np-card-content-title">{{ course.name }}</h3>{% if course.instructors.size > 0 %}<div class="np-card-content-subtitle">{{ course.instructor_names }}</div>{% endif %}<div class="card-info-wrapper">{% if course.properties.course_length != 'NULL' %}<div class="card-content-length">{{ course.properties.course_length }}</div>{% endif %}{{course_label}}</div></div></div></a>
{% capture course_label %}{% endcapture %}
{% capture course_data_label %}none{% endcapture %}
{% assign course_is_new = false %}
{% assign created_at_date_seconds = current_person.created_at | date: "%s" %}
{% assign course_published_date_seconds = course.properties.initial_publish_date | date: "%s" %}
{% if course_published_date_seconds > created_at_date_seconds %}{% assign course_is_new = true %}{% endif %}
{% if course_is_new %}
{% if course.progress == 0 %}
{% capture course_label %}<div class="label label-green new-topic-label">New</div>{% endcapture %}
{% capture course_data_label %}new{% endcapture %}
{% endif %}
{% endif %}
{% if course.progress > 0 and course.progress < 100 %}
{% capture course_label %}<div class="label label-orange">In progress</div>{% endcapture %}
{% capture course_data_label %}in-progress{% endcapture %}
{% elsif course.completed? %}
{% capture course_label %}<div class="label label-gray">Viewed</div>{% endcapture %}
{% capture course_data_label %}viewed{% endcapture %}
{% endif %}
<a class="np-card featured-card" href="{% route course, id: course.id %}">
<div class="np-card-container">
<img src="{{ course.image_url }}" alt="{{ course.name }}" />
<div class="card-content-wrapper">
<div class="featured-card-title">
{{ course.name }}
</div>
<div class="featured-card-desc">
{{ course.short_description }}
</div>
<div class="card-info">
{% if course.properties.course_length != 'NULL' %}
<div class="card-content-length">{{ course.properties.course_length }}</div>
{% endif %}
{{course_label}}
</div>
</div>
</div>
</a>

View File

@ -0,0 +1,25 @@
<a class="np-card featured-card" href="{% route learning_path, id: learning_path.id %}">
<div class="np-card-container lp-card-container">
<img src="{{ learning_path.image_url }}" alt="{{ learning_path.name }}" />
<div class="card-content-wrapper">
<div class="featured-card-title">{{ learning_path.name }}</div>
<div class="featured-card-desc">{{ learning_path.description | strip_html }}</div>
<div class="card-info">
<div class="lp-courses-count">{{ learning_path.items.count }} resources</div>
<span class="dot-divider">&#183;</span>
{% for item in learning_path.items %}
{% if item.course? %}
{% for enrolled_course in enrolled_courses %}
{% if item.id == enrolled_course.id %}
{% assign course_time = enrolled_course.properties.course_length | split: " " %}
{% assign course_time_number = course_time | slice: 0 %}
<div class="np-hidden hidden-course-length" data-course-length="{{course_time_number}}"></div>
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
<div class="lp-time"></div>
</div>
</div>
</div>
</a>

View File

@ -0,0 +1,25 @@
{% capture course_label %}{% endcapture %}
{% capture course_data_label %}none{% endcapture %}
{% if learning_path.progress > 0 and learning_path.progress < 100 %}
{% capture course_label %}<div class="label label-orange">In progress</div>{% endcapture %}
{% capture course_data_label %}in-progress{% endcapture %}
{% elsif learning_path.completed? %}
{% capture course_label %}<div class="label label-gray">Viewed</div>{% endcapture %}
{% capture course_data_label %}viewed{% endcapture %}
{% endif %}
<a href="{% route learning_path, id: learning_path.id %}" class="np-card-condensed" data-label="{{course_data_label}}">
<div class="np-card-condensed-content-wrapper">
<div class="title-wrapper">
<div class="np-course-title">{{ learning_path.name }}</div>
<div class="np-card-condensed-content-description">
{{ learning_path.description | strip_html }}
</div>
<div class="info-wrapper">
<div class="card-content-length">{{ learning_path.items.count }} resources</div>
<div class="labels-wrapper">{{course_label}}</div>
</div>
</div>
</div>
</a>

View File

@ -3,36 +3,53 @@
{% comment %} NON SPECIFIED {% endcomment %}
{% for school_category in school_categories %}
{% unless school_category == "Getting Started" or school_category == "Earnings" or school_category == "Shopping & Delivery" or school_category == "Delivery" or school_category == "Using the App" or school_category == "Contacting Customers" %}
<div class="np-category-card" data-category='{{school_category | replace: " ", "-" | downcase }}'>
<div class="np-category-card-content-wrapper">
<div class="np-category-card-img">
{% if school_category == "Arrival & Pick Up" %}
<img src="https://cdn.northpass.io/walmart/category-arrival-pickup-icon.webp" width="60" height="60" alt="Category Icon">
{% elsif school_category == "Drop Off & Returns" %}
<img src="https://cdn.northpass.io/walmart/category-dropoff-returns-icon.webp" width="60" height="60" alt="Category Icon">
{% elsif school_category == "Troubleshooting" %}
<img src="https://cdn.northpass.io/walmart/category-troubleshooting-icon.webp" width="60" height="60" alt="Category Icon">
{% elsif school_category == "Trust & Safety" %}
<img src="https://cdn.northpass.io/walmart/category-trust-safety-icon.webp" width="60" height="60" alt="Category Icon">
{% elsif school_category == "Offer Acceptance" %}
<img src="https://cdn.northpass.io/walmart/category-offer-acceptance-icon.webp" width="60" height="60" alt="Category Icon">
{% elsif school_category == "Returns" %}
<img src="https://cdn.northpass.io/walmart/category-returns-icon.webp" width="60" height="60" alt="Category Icon">
{% else %}
<img src="https://cdn.northpass.io/walmart/category-spark-icon.webp" width="61" height="60" alt="Category Icon">
{% endif %}
</div>
<div class="title-wrapper">
<div class="labels-wrapper">
<div class="label label-green new-topic-label">New</div>
{% if school_category == "Resource Bundles" %}
{% if features.learning_paths? and learning_paths.enrolled.any? %}
<div class="np-category-card" data-category='resource-bundles'>
<div class="np-category-card-content-wrapper">
<div class="np-category-card-img">
<img src="https://cdn.northpass.io/walmart/category-resource-bundles-icon.webp" width="60" height="60" alt="Category Icon">
</div>
<div class="title-wrapper">
<div class="np-category-title">Resource Bundles</div>
</div>
</div>
<div class="np-category-title">{{school_category}}</div>
<i class="fas fa-chevron-right"></i>
</div>
{% include "filtered_learning_paths_tray", category_name: "Resource Bundles" %}
{% endif %}
{% else %}
<div class="np-category-card" data-category='{{school_category | replace: " ", "-" | downcase }}'>
<div class="np-category-card-content-wrapper">
<div class="np-category-card-img">
{% if school_category == "Arrival & Pick Up" %}
<img src="https://cdn.northpass.io/walmart/category-arrival-pickup-icon.webp" width="60" height="60" alt="Category Icon">
{% elsif school_category == "Drop Off & Returns" %}
<img src="https://cdn.northpass.io/walmart/category-dropoff-returns-icon.webp" width="60" height="60" alt="Category Icon">
{% elsif school_category == "Troubleshooting" %}
<img src="https://cdn.northpass.io/walmart/category-troubleshooting-icon.webp" width="60" height="60" alt="Category Icon">
{% elsif school_category == "Trust & Safety" %}
<img src="https://cdn.northpass.io/walmart/category-trust-safety-icon.webp" width="60" height="60" alt="Category Icon">
{% elsif school_category == "Offer Acceptance" %}
<img src="https://cdn.northpass.io/walmart/category-offer-acceptance-icon.webp" width="60" height="60" alt="Category Icon">
{% elsif school_category == "Returns" %}
<img src="https://cdn.northpass.io/walmart/category-returns-icon.webp" width="60" height="60" alt="Category Icon">
{% else %}
<img src="https://cdn.northpass.io/walmart/category-spark-icon.webp" width="61" height="60" alt="Category Icon">
{% endif %}
</div>
<div class="title-wrapper">
<div class="labels-wrapper">
<div class="label label-green new-topic-label">New</div>
</div>
<div class="np-category-title">{{school_category}}</div>
</div>
</div>
<i class="fas fa-chevron-right"></i>
</div>
<i class="fas fa-chevron-right"></i>
</div>
{% include "filtered_courses_tray", category_name: school_category %}
{% include "filtered_courses_tray", category_name: school_category %}
{% endif %}
{% endunless %}
{% endfor %}
{% endif %}

View File

@ -0,0 +1,14 @@
<div class="filtered-courses-tray filtered-learning-paths-tray" data-tray='{{school_category | replace: " ", "-" | downcase }}'>
<div class="tray-header"><div class="close-tray"><i class="fal fa-arrow-left"></i></div><div class="header-title">{{category_name}}</div></div>
{% if current_person.signed_in? %}<div class="np-courses-search np-header-search-expanded tray-search"><form action="{% route search %}" method="get" data-test="mobile-search"><i class="np-header-search-icon far fa-search"></i><input aria-label="Search courses" class="np-header-search-input np-header-font-background-color" type="text" name="q" placeholder="Search" /></form></div>{% endif %}
<div class="tray-wrapper">
{% assign learning_paths_by_progress = enrolled_learning_paths | sort: "progress" %}
{% for learning_path in learning_paths_by_progress %}
{% for lp_category in learning_path.categories %}
{% if school_category == lp_category.name %}
{% include "cards_learning_path_condensed" with learning_path %}
{% endif %}
{% endfor %}
{% endfor %}
</div>
</div>

View File

@ -7,11 +7,11 @@
{% assign live_school_id = "3c8229bf-a77c-4c88-8c65-75a03b0b1212" %}
{% if current_school.id == staging_school_id %}
{% comment %} <link rel="stylesheet" href="https://cdn.northpass.io/walmart/staging/walmart-styles_04262023_v1.min.css" /> {% endcomment %}
{% comment %} <link rel="stylesheet" href="https://cdn.northpass.io/walmart/staging/walmart-styles_11092023_v1.min.css" /> {% endcomment %}
{% elsif current_school.id == production_sandbox_school_id %}
{% comment %} <link rel="stylesheet" href="https://cdn.northpass.io/walmart/production-sandbox/walmart-styles_04112023_v1.min.css" /> {% endcomment %}
{% comment %} <link rel="stylesheet" href="https://cdn.northpass.io/walmart/production-sandbox/walmart-styles_11092023_v1.min.css" /> {% endcomment %}
{% elsif current_school.id == live_school_id %}
<link rel="stylesheet" href="https://cdn.northpass.io/walmart/live/walmart-styles_04062023_v1.min.css" />
<link rel="stylesheet" href="https://cdn.northpass.io/walmart/live/walmart-styles_11092023_v1.min.css" />
{% endif %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
@ -19,11 +19,11 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/easy-toggle-state/1.16.0/easy-toggle-state.min.js" integrity="sha512-hG7MyW8uOh26+C0KutsTVCJm8waH4iA9vSa8gOsosTHdIh6JjOE/MRn8vmcFg2rLGTnpVWmSKcDJF48cB89/3w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
{% if current_school.id == staging_school_id %}
{% comment %} <script src="https://cdn.northpass.io/walmart/staging/walmart-js_03062023_v1.min.js" defer ></script> {% endcomment %}
{% comment %} <script src="https://cdn.northpass.io/walmart/staging/walmart-js_11092023_v1.min.js" defer ></script> {% endcomment %}
{% include "js_scripts" %}
{% elsif current_school.id == production_sandbox_school_id %}
{% comment %} <script src="https://cdn.northpass.io/walmart/production-sandbox/walmart-js_10062023_v1.min.js" defer ></script> {% endcomment %}
{% comment %} <script src="https://cdn.northpass.io/walmart/production-sandbox/walmart-js_11092023_v1.min.js" defer ></script> {% endcomment %}
{% include "js_scripts" %}
{% elsif current_school.id == live_school_id %}
<script src="https://cdn.northpass.io/walmart/live/walmart-js_10062023_v1.min.js" defer ></script>
<script src="https://cdn.northpass.io/walmart/live/walmart-js_11092023_v1.min.js" defer ></script>
{% endif %}

View File

@ -0,0 +1,51 @@
{% if learning_path.enrolled? and course.unlocked? %}
<div class="learning-path-item-wrapper">
<div class="np-learning-path-outline-bar {% if courses_index == 1 %}np-hidden{% endif %}"></div>
<div class="learning-path-item-indicator {% if course.completed? %}completed{% endif %}">
{% if course.completed? %}
<i class="fa fa-check"></i>
{% else %}
{{courses_index}}
{% endif %}
</div>
<a class="np-learning-path-outline-item np-card-container" href="{% route learning_path_course, learning_path_id: learning_path.id, id: course.id %}">
<div class="np-card-content">
<div class="np-learning-path-outline-content">
<div class="labels-wrapper">
{% if course.progress > 0 and course.progress < 100 %}
<div class="label label-orange">In progress</div>
{% endif %}
</div>
<div class="np-learning-path-outline-name np-top-title">
{{ course.name }}
</div>
<div class="learning-path-outline-desc">
Lorem ipsum dolor sit amit
</div>
<div class="info-wrapper">
<div class="course-time">XX min</div>
</div>
</div>
<i class="fas fa-chevron-right np-learning-path-outline-icon"></i>
</div>
</a>
</div>
{% else %}
<div class="learning-path-item-wrapper">
<div class="np-learning-path-outline-bar {% if courses_index == 1 %}np-hidden{% endif %}"></div>
<div class="learning-path-item-indicator">{{courses_index}}</div>
<div class="np-learning-path-outline-item np-learning-path-outline-inactive-item np-card-container">
<div class="np-learning-path-outline-content">
<div class="np-learning-path-outline-name np-top-title">
{{ course.name }}
</div>
<div class="learning-path-outline-desc">
Lorem ipsum dolor sit amit
</div>
<div class="info-wrapper">
<div class="course-time">XX min</div>
</div>
</div>
</div>
</div>
{% endif %}

View File

@ -1,7 +1,7 @@
{% if result.type == "course" %}
<div class="np-card np-search-result">
<div class="np-card-container">
<a class="np-card-content" href="{% if result.path contains 'activities' %}{{ result.path }}{% else %}{{ result.path | replace: '?search_sid=', '/cover?search_sid='}}{% endif %}">
<a class="np-card-content" href="{% if result.path contains 'activities' %}{{ result.path }}{% else %}{{ result.path | replace: '?search_sid=', '/cover?search_sid='}}{% endif %}">
<div class="np-search-result-content">
<div>
<div class="np-search-result-title">
@ -13,5 +13,4 @@
</a>
</div>
</div>
{% endif %}
{% endif %}

View File

@ -1,6 +1,8 @@
{% if course.properties.skip_course_outline_page %}
<script> window.location.replace('{% route course_viewer, course_id: course.id, learning_path_id: params.learning_path_id %}') </script>
{% else %}
{% if course.properties.skip_course_outline_page %}
<script>
window.location.replace('{% route course_viewer, course_id: course.id, learning_path_id: params.learning_path_id %}')
</script>
{% else %}
{% assign back_button_url = "/app/courses" %}
{% for category in course.categories %}
{% assign cat_name = category.name | replace: " ", "-" | downcase %}
@ -8,41 +10,45 @@
{% endfor %}
<div class="mobile-header">
<a href="{{back_button_url}}" class="exit-icon"><i class="fal fa-arrow-left"></i></a>
<div class="header-title">{{course.name}}</div>
<a href="{{back_button_url}}" class="exit-icon">
<i class="fal fa-arrow-left"></i>
</a>
<div class="header-title">{{ course.name }}</div>
</div>
<main class="np-main np-max-width np-page-container course-cover-page">
<div id="course-mobile">
<div class="np-card-container transparent-card">
{% unless course.image_url contains "/assets/defaults/learning_experience/course-" %}
<img src="{{ course.image_url }}" class="np-top-image" alt="{{ course.name }}" />
{% endunless %}
<div class="np-top-title">{{ course.name }}</div>
<div class="cover-flex-container">
<div class="card-content-length">
{% if course.properties.course_length != 'NULL' %}
<div class="card-content-length">{{ course.properties.course_length }}</div>
{% endif %}
<div class="np-card cover-page-card">
<div class="np-card-container">
<img src="{{ course.image_url }}" alt="{{ course.name }}" />
<div class="card-content-wrapper">
<div class="cover-page-card-title">{{ course.name }}</div>
<div class="cover-page-card-desc">{{ course.full_description }}</div>
<div class="card-info">
{% if course.properties.course_length != 'NULL' %}
<div class="card-content-length">{{ course.properties.course_length }}</div>
{% endif %}
</div>
</div>
</div>
<hr class="hr-dotted" />
</div>
<div class="np-card-container np-card-padding np-card-spacing desc-block">
<h3 class="np-card-heading">About the Resource</h3>
<div class="np-card-text">{{ course.full_description }}</div>
</div>
<div class="np-card-container np-card-padding np-card-spacing">
{% include "course_outline" %}
</div>
<div class="np-top-cta stick-to-bottom">
{% if course.learner_can_retake? %}
{% if course.learner_can_retake? %}
<form action="{% route course_retake, id: course.id %}" method="POST">
{% form_authenticity_token %}
<button type="submit" class="np-top-button np-button-font-color np-button np-button-big">Review</button>
</form>
{% else %}
<a class="np-top-button np-button-font-color np-button np-button-big" {% if course.enrolled? %} href="{% route course_viewer, course_id: course.id, learning_path_id: params.learning_path_id %}" {% else %} href="{% route course_enrollment, code: course.enrollment_code %}" {% endif %} >
<a
class="np-top-button np-button-font-color np-button np-button-big"
{% if course.enrolled? %}
href="{% route course_viewer, course_id: course.id, learning_path_id: params.learning_path_id %}"
{% else %}
href="{% route course_enrollment, code: course.enrollment_code %}"
{% endif %}>
{% if course.progress > 0 and course.progress < 100 %}
Resume
{% elsif course.completed? %}
@ -53,20 +59,36 @@
</a>
{% endif %}
</div>
</div>
</div>
</main>
{% endif %}
<script>
<script>
setTimeout(function() {
if (sessionStorage.getItem('appContext') !== null && sessionStorage.getItem('appContext') !== 'Returning to App') {
$(".mobile-header .exit-icon").attr("href", "javascript: sendMessage()")
const isAppContextAware = sessionStorage.getItem('appContext') !== null && sessionStorage.getItem('appContext') !== 'Returning to App';
const appContextCategoryOrigin = sessionStorage.getItem('appContextCategoryOrigin')
if (document.referrer.includes("/search") || document.referrer.includes("/progress")) {
console.log("User came directly from 'Search' or 'Progress' Tab.")
if (isAppContextAware && !appContextCategoryOrigin) {
console.log("Go back to app.")
$(".mobile-header .exit-icon").attr("href", "javascript: sendMessage()")
} else {
console.log("Go back to previous page")
$(".mobile-header .exit-icon").attr("href", "javascript: goBack()")
}
} else {
if (document.referrer.includes("/search") || document.referrer.includes("/progress")) {
$(".mobile-header .exit-icon").attr("href", "javascript: goBack()")
if (window.location.pathname.includes("learning_paths")) {
console.log("User navigating a learning path, Arrow will redirect back to learning path cover page.")
const pathParts = window.location.pathname.split("/")
$(".mobile-header .exit-icon").attr("href", `/app/learning_paths/${pathParts[3]}`)
} else {
if (isAppContextAware && !appContextCategoryOrigin) {
console.log("App Context value exists. Category Origin does not. Go back to app.")
$(".mobile-header .exit-icon").attr("href", "javascript: sendMessage()")
}
}
}
}, 500)
</script>
</script>

View File

@ -1,48 +1,108 @@
{% assign available_school_categories = '' | split: '' %}
{% assign enrolled_courses = courses.enrolled %}
{% for course in enrolled_courses %}
{% for course in enrolled_courses %}
{% for cat in course.categories %}
{% assign cat_name = cat.name | split: '!@#$%^&*()' %}
{% assign available_school_categories = available_school_categories | concat: cat_name %}
{% endfor %}
{% endfor %}
{% assign enrolled_learning_paths = learning_paths.enrolled %}
{% for learning_path in enrolled_learning_paths %}
{% for lp_cat in learning_path.categories %}
{% assign lp_cat_name = lp_cat.name | split: '!@#$%^&*()' %}
{% assign available_school_categories = available_school_categories | concat: lp_cat_name %}
{% endfor %}
{% endfor %}
{% assign unique_school_categories = available_school_categories | uniq | sort %}
{% capture icon %} fa-arrow-left{% endcapture %}
{% assign resource_bundles_to_display = "" %}
{% if features.learning_paths? %}
{% if enrolled_learning_paths.any? %}
{% if current_person.properties.access_level == "EXPERIENCED" %}
{% assign resource_bundles_to_display = current_school.properties.featured_resource_bundles_experienced | downcase %}
{% elsif current_person.properties.access_level == "BEGINNER" %}
{% assign resource_bundles_to_display = current_school.properties.featured_resource_bundles_beginner | downcase %}
{% endif %}
{% endif %}
{% endif %}
{% assign resource_bundles_to_display_array = resource_bundles_to_display | split: "," %}
{% capture icon %}
fa-arrow-left{% endcapture %}
{% include "mobile_header", title: "Resource Center", back_icon: icon, back_link: "javascript:sendMessage();" %}
{% include "sub_navigation" %}
<main class="np-main np-courses np-subpage-container np-max-width">
{% if current_person.signed_in? %}
<div class="np-courses-search np-header-search-expanded"><form action="{% route search %}" method="get" data-test="mobile-search"><i class="np-header-search-icon far fa-search"></i><input aria-label="Search courses" class="np-header-search-input np-header-font-background-color" type="text" name="q" placeholder="Search" /></form>
</div>
{% endif %}
{% if current_person.properties.show_welcome_message %}
<div class="intro-msg"><div class="intro-msg-icon-wrapper"><div class="intro-msg-icon"></div> </div><div class="intro-msg-text">Explore these videos and text-based resources to get the most out of the Spark Driver&trade; App.</div></div>
{% endif %}
{% if courses.enrolled.any? %}
<div class="recommended-courses-section">
<div class="np-courses-section-label">Featured</div>
<div class="recommended-courses-carousel-outer-container">
<div class="recommended-courses-carousel">
{% for course in courses.enrolled %}
{% if course.properties.is_recommended_course == true %}
{% if course.properties.access_level == current_person.properties.access_level %}
<div class="course-slide" data-initialpublishdate="{{course.properties.initial_publish_date}}" data-position="{{course.properties.featured_course_position}}">
{% include "cards_course" with course %}
</div>
{% if current_person.signed_in? %}
<div class="np-courses-search np-header-search-expanded">
<form
action="{% route search %}"
method="get"
data-test="mobile-search">
<i class="np-header-search-icon far fa-search"></i><input
aria-label="Search courses"
class="np-header-search-input np-header-font-background-color"
type="text"
name="q"
placeholder="Search" /></form>
</div>
{% endif %}
{% if current_person.properties.show_welcome_message %}
<div class="intro-msg"><div class="intro-msg-icon-wrapper"><div class="intro-msg-icon"></div></div><div class="intro-msg-text">Questions? We can help! Check out these optional resources to get the most out of the Spark Driver&trade; app.</div></div>
{% endif %}
{% if courses.enrolled.any? %}
<div class="recommended-courses-section">
<div class="np-courses-section-label">Featured</div>
<div class="recommended-courses-carousel-outer-container">
<div class="recommended-courses-carousel">
{% if features.learning_paths? %}
{% if enrolled_learning_paths.any? %}
{% for bundle in resource_bundles_to_display_array %}
{% assign bundle_name = bundle | strip | escape_once %}
{% for learning_path in enrolled_learning_paths %}
{% assign lp_title_downcase = learning_path.name | downcase | strip | escape_once %}
{% if lp_title_downcase contains bundle_name %}
<div class="course-slide lp-slide">
{% include "cards_learning_path" with learning_path, enrolled_courses: enrolled_courses %}
</div>
{% break %}
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% for course in enrolled_courses %}
{% if course.properties.is_recommended_course == true %}
{% if course.properties.access_level == current_person.properties.access_level %}
<div
class="course-slide"
data-initialpublishdate="{{course.properties.initial_publish_date}}"
data-position="{{course.properties.featured_course_position}}">
{% include "cards_course" with course %}
</div>
{% endif %}
{% endif %}
{% endfor %}
</div>
</div>
</div>
{% endif %}
<div class="all-categories-section">
<div class="np-courses-section-label" style="margin-bottom:15px;">All Categories</div>
<div class="category-cards-wrapper">
{% include "category_cards", school_categories: unique_school_categories %}
</div>
</div>
</div>
{% endif %}
<div class="all-categories-section">
<div class="np-courses-section-label" style="margin-bottom:15px;">All Categories</div>
<div class="category-cards-wrapper">{% include "category_cards", school_categories: unique_school_categories %}</div>
</div>
</main>
<script>$(document).ready(function() { const showWelcomeMessage = '{{current_person.properties.show_welcome_message}}'
if (showWelcomeMessage == 'true'){ let userData = { learner_uuid: '{{current_person.id}}', }
const schoolUuid = '{{current_school.id}}'
hideWelcomeMessage(userData, schoolUuid) }})</script>
<script>
$(document).ready(function() {
const showWelcomeMessage = '{{current_person.properties.show_welcome_message}}'
if (showWelcomeMessage == 'true') {
let userData = {
learner_uuid: '{{current_person.id}}'
}
const schoolUuid = '{{current_school.id}}'
hideWelcomeMessage(userData, schoolUuid)
}
})
</script>

View File

@ -1,10 +1,120 @@
{% capture icon %}
fa-arrow-left
{% endcapture %}
{% include "mobile_header", title: learning_path.name, back_icon: icon, back_link: "/app/courses" %}
<div class="np-top-cta stick-to-bottom np-hidden">
{% learning_path_next_step_button learning_path, class: "lp-button np-top-button np-button-font-color np-button np-button-big" %}
</div>
{% include "sub_navigation" %}
<script>
const learningPathBtnText = document.querySelector(".lp-button").innerText
console.log(learningPathBtnText)
if (learningPathBtnText.toLowerCase() == "start path") {
document.querySelector(".lp-button").click()
}
</script>
{% capture icon %}fa-arrow-left{% endcapture %}
{% include "mobile_header", title: learning_path.name, back_icon: icon, back_link: "/app/courses#resource-bundles" %}
{% assign courses = courses.enrolled %}
<main class="np-main np-max-width np-page-container">
<div id="learning-path-mobile">
{% include "learning_path_mobile_view" %}
<div class="np-card cover-page-card">
<div class="np-card-container">
<img src="{{ learning_path.image_url }}" alt="{{ learning_path.name }}" />
<div class="card-content-wrapper">
<div class="cover-page-card-title">{{ learning_path.name }}</div>
<div class="cover-page-card-desc">{{ learning_path.description | strip_html }}</div>
<div class="card-info">
<div class="card-courses-count">{{ learning_path.items.count }} resources</div>
<span class="dot-divider">&#183;</span>
<div class="card-time"></div>
</div>
</div>
</div>
</div>
<div class="np-card-spacing">
<div class="np-learning-path-outline">
<div class="np-card-heading">Contents</div>
{% assign courses_index = 1 %}
{% for item in learning_path.items %}
{% assign course_desc = "" %}
{% assign course_length = "" %}
{% assign course_is_new = false %}
{% for course in courses %}
{% if course.id == item.id %}
{% assign course_desc = course.short_description %}
{% assign course_length = course.properties.course_length %}
{% assign created_at_date_seconds = current_person.created_at | date: "%s" %}
{% assign course_published_date_seconds = course.properties.initial_publish_date | date: "%s" %}
{% if course_published_date_seconds > created_at_date_seconds %}{% assign course_is_new = true %}{% endif %}
{% endif %}
{% endfor %}
{% if item.course? %}
{% if learning_path.enrolled? and item.unlocked? %}
<div class="learning-path-item-wrapper">
<div class="np-learning-path-outline-bar {% if courses_index == 1 %}np-hidden{% endif %}"></div>
<div class="learning-path-item-indicator {% if item.completed? %}completed{% endif %}">
{% if item.completed? %}
<i class="fa fa-check"></i>
{% else %}
{{courses_index}}
{% endif %}
</div>
<a class="np-learning-path-outline-item np-card-container" href="{% route learning_path_course, learning_path_id: learning_path.id, id: item.id %}">
<div class="np-card-content">
<div class="np-learning-path-outline-content">
<div class="np-learning-path-outline-name np-top-title">{{ item.name }}</div>
<div class="learning-path-outline-desc">{{course_desc}}</div>
<div class="info-wrapper">
<div class="course-time">{{course_length}}</div>
<div class="labels-wrapper" style="margin-left:10px">
{% if item.progress > 0 and item.progress < 100 %}
<div class="label label-orange">In progress</div>
{% endif %}
{% if course_is_new %}
{% if item.progress == 0 %}
<div class="label label-green">New</div>
{% endif %}
{% endif %}
</div>
</div>
</div>
<i class="fas fa-chevron-right np-learning-path-outline-icon"></i>
</div>
</a>
</div>
{% else %}
<div class="learning-path-item-wrapper">
<div class="np-learning-path-outline-bar {% if courses_index == 1 %}np-hidden{% endif %}"></div>
<div class="learning-path-item-indicator">{{courses_index}}</div>
<div class="np-learning-path-outline-item np-learning-path-outline-inactive-item np-card-container">
<div class="np-learning-path-outline-content">
<div class="np-learning-path-outline-name np-top-title">{{ item.name }}</div>
<div class="learning-path-outline-desc">{{course_desc}}</div>
<div class="info-wrapper">
<div class="course-time">{{course_length}}</div>
<div class="labels-wrapper" style="margin-left:10px">
<div class="label label-green">New</div>
</div>
</div>
</div>
</div>
</div>
{% endif %}
{% endif %}
{% assign courses_index = courses_index | plus: 1 %}
{% endfor %}
</div>
</div>
</div>
</div>
</main>
<script>
setTimeout(function() {
const isAppContextAware = sessionStorage.getItem('appContext') !== null && sessionStorage.getItem('appContext') !== 'Returning to App';
const appContextCategoryOrigin = sessionStorage.getItem('appContextCategoryOrigin')
if (isAppContextAware && !appContextCategoryOrigin) {
console.log("App Context value exists. Category Origin does not. Go back to app.")
$(".mobile-header .exit-icon").attr("href", "javascript: sendMessage()")
}
}, 500)
</script>

View File

@ -0,0 +1,113 @@
<div class="np-top-cta stick-to-bottom np-hidden">
{% learning_path_next_step_button learning_path, class: "lp-button np-top-button np-button-font-color np-button np-button-big" %}
</div>
{% include "sub_navigation" %}
<script>
const learningPathBtnText = document.querySelector(".lp-button").innerText
console.log(learningPathBtnText)
if (learningPathBtnText.toLowerCase() == "start new content") {
document.querySelector(".np-top-cta").innerText = "Start"
document.querySelector(".np-top-cta").classList.remove("np-hidden")
document.querySelector(".np-sub-navigation").style.display = "none";
}
</script>
{% capture icon %}fa-arrow-left{% endcapture %}
{% include "mobile_header", title: learning_path.name, back_icon: icon, back_link: "/app/courses#resource-bundles" %}
{% assign courses = courses.enrolled %}
<main class="np-main np-max-width np-page-container">
<div id="learning-path-mobile">
<div class="np-card cover-page-card">
<div class="np-card-container">
<img src="{{ learning_path.image_url }}" alt="{{ learning_path.name }}" />
<div class="card-content-wrapper">
<div class="cover-page-card-title">{{ learning_path.name }}</div>
<div class="cover-page-card-desc">{{ learning_path.description | strip_html }}</div>
<div class="card-info">
<div class="card-courses-count">{{ learning_path.items.count }} resources</div>
<span class="dot-divider">&#183;</span>
<div class="card-time"></div>
</div>
</div>
</div>
</div>
<div class="np-card-spacing">
<div class="np-learning-path-outline">
<div class="np-card-heading">Contents</div>
{% assign courses_index = 1 %}
{% for item in learning_path.items %}
{% assign course_desc = "" %}
{% assign course_length = "" %}
{% for course in courses %}
{% if course.id == item.id %}
{% assign course_desc = course.short_description %}
{% assign course_length = course.properties.course_length %}
{% endif %}
{% endfor %}
{% if item.course? %}
{% if learning_path.enrolled? and item.unlocked? %}
<div class="learning-path-item-wrapper">
<div class="np-learning-path-outline-bar {% if courses_index == 1 %}np-hidden{% endif %}"></div>
<div class="learning-path-item-indicator {% if item.completed? %}completed{% endif %}">
{% if item.completed? %}
<i class="fa fa-check"></i>
{% else %}
{{courses_index}}
{% endif %}
</div>
<a class="np-learning-path-outline-item np-card-container" href="{% route learning_path_course, learning_path_id: learning_path.id, id: item.id %}">
<div class="np-card-content">
<div class="np-learning-path-outline-content">
<div class="labels-wrapper">
{% if item.progress > 0 and item.progress < 100 %}
<div class="label label-orange">In progress</div>
{% endif %}
</div>
<div class="np-learning-path-outline-name np-top-title">{{ item.name }}</div>
<div class="learning-path-outline-desc">{{course_desc}}</div>
<div class="info-wrapper">
<div class="course-time">{{course_length}}</div>
</div>
</div>
<i class="fas fa-chevron-right np-learning-path-outline-icon"></i>
</div>
</a>
</div>
{% else %}
<div class="learning-path-item-wrapper">
<div class="np-learning-path-outline-bar {% if courses_index == 1 %}np-hidden{% endif %}"></div>
<div class="learning-path-item-indicator">{{courses_index}}</div>
<div class="np-learning-path-outline-item np-learning-path-outline-inactive-item np-card-container">
<div class="np-learning-path-outline-content">
<div class="np-learning-path-outline-name np-top-title">{{ item.name }}</div>
<div class="learning-path-outline-desc">{{course_desc}}</div>
<div class="info-wrapper">
<div class="course-time">{{course_length}}</div>
<div class="labels-wrapper" style="margin-left:10px">
<div class="label label-green">New</div>
</div>
</div>
</div>
</div>
</div>
{% endif %}
{% endif %}
{% assign courses_index = courses_index | plus: 1 %}
{% endfor %}
</div>
</div>
</div>
</div>
</main>
<script>
setTimeout(function() {
const isAppContextAware = sessionStorage.getItem('appContext') !== null && sessionStorage.getItem('appContext') !== 'Returning to App';
const appContextCategoryOrigin = sessionStorage.getItem('appContextCategoryOrigin')
if (isAppContextAware && !appContextCategoryOrigin) {
console.log("App Context value exists. Category Origin does not. Go back to app.")
$(".mobile-header .exit-icon").attr("href", "javascript: sendMessage()")
}
}, 500)
</script>

View File

@ -0,0 +1,51 @@
About Your Earnings
<div style="display:none;">
Pay, Paid, Payment, Earn, Money, Income
</div>
Checking the status of your driver referrals
<div style="display:none;">
Referral status, Referred, Friend, Family
</div>
Claiming your Branch Wallet
<div style="display:none;">
Pay, Paid, Payment, Wallet, Earnings, Claim
</div>
Earnings FAQ
<div style="display:none;">
Paid, Payment, Pay, Money, Deposit, Bonus, Earn, Branch, ONE, Income
</div>
How to apply for ONE for existing drivers
--NO TAGS--
How to apply for ONE for new drivers
<div style="display:none;">
Sign-up, Create account, Instant pay, Same day pay, Payment, Paid, Pay, Money, Earnings, How to apply
</div>
How to switch earnings accounts
<div style="display:none;">
Switch payment, Switch account, Switch earnings, New pay account, Pay account, Bank
</div>
Information on when driver referrals are updated
<div style="display:none;">
Referral error, Report missing referral, Incorrect referral,
</div>
Referral incentives
<div style="display:none;">
Referrals, Incentives, Earn Money, Earn Extra Money, Refer friend, Refer family
</div>
Rewards Program
--NO TAGS--
Viewing your earnings
<div style="display:none;">
Paid, Pay, Payment, View pay, Find payment, Income, Money, Earn
</div>