Datasnipper templates - redoing their header navigation.

This commit is contained in:
Norm Rasmussen
2024-09-26 17:32:26 -04:00
parent 691a199006
commit c61c1e4410
4 changed files with 58 additions and 39 deletions

View File

@ -7,8 +7,8 @@
document.title = `${defaultPageTitle} | Learning Paths` document.title = `${defaultPageTitle} | Learning Paths`
} else if (window.location.pathname == "/app/training_events") { } else if (window.location.pathname == "/app/training_events") {
document.title = `${defaultPageTitle} | Training Events` document.title = `${defaultPageTitle} | Training Events`
} else if (window.location.pathname == "/app/upcoming-trainings") { //} else if (window.location.pathname == "/app/upcoming-trainings") {
document.title = `${defaultPageTitle} | Upcoming Trainings` // document.title = `${defaultPageTitle} | Upcoming Trainings`
} }
</script> </script>
@ -50,15 +50,20 @@
<div class="np-hidden-mobile np-header-desktop-nav"> <div class="np-hidden-mobile np-header-desktop-nav">
<ul class="np-header-desktop-nav-list"> <ul class="np-header-desktop-nav-list">
{% for link in navigations.sub_navigation %} {% for link in navigations.sub_navigation %}
{% unless link.label == "Catalog" %} {% comment %} {% unless link.label == "Catalog" %} {% endcomment %}
{% assign link_url = "" %} {% assign link_url = "" %}
{% comment %} {% if link.label == "Dashboard" %}
{% assign link_url = "/app/courses" %}
{% else %}
{% assign link_url = link.url %}
{% endif %} {% endcomment %}
<li class="np-header-desktop-nav-item"> <li class="np-header-desktop-nav-item">
<a href="{{ link.url }}" class="np-header-desktop-nav-link {% if link.label == "Events" %}np-button{% else %}np-header-font-color{% endif %} {% if link.label == "Catalog" %}link-dropdown{% endif %}"> <a href="{{ link.url }}" class="np-header-desktop-nav-link
{% if link.label == "Events" %}
TODO: This whole file needs to be cleaned up like cray.
TODO: Hide Events (/app/training_events) and only show /app/upcoming-trainings. Label should be Live Trainings.
np-button
{% else %}
np-header-font-color
{% endif %}
{% if link.label == "Catalog" %}
link-dropdown
{% endif %}">
{% if link.label == "Courses" or link.label == "Dashboard" %} {% if link.label == "Courses" or link.label == "Dashboard" %}
My Courses My Courses
{% elsif link.label == "Catalog" %} {% elsif link.label == "Catalog" %}
@ -70,6 +75,7 @@
class="far fa-chevron-down"></i> class="far fa-chevron-down"></i>
{% elsif link.label == "Events" %} {% elsif link.label == "Events" %}
Live events Live events
{% elsif link.label == "Learning Paths"}
{% else %} {% else %}
{{ link.label }} {{ link.label }}
{% endif %} {% endif %}
@ -108,8 +114,9 @@
</div> </div>
{% endif %} {% endcomment %} {% endif %} {% endcomment %}
</li> </li>
{% endunless %} {% comment %} {% endunless %} {% endcomment %}
{% endfor %} {% endfor %}
{% comment %}
{% for website_navigation in navigations.header_navigations_external %} {% for website_navigation in navigations.header_navigations_external %}
<li class="np-header-desktop-nav-item"> <li class="np-header-desktop-nav-item">
<a <a
@ -119,7 +126,8 @@
{{ website_navigation.name }} {{ website_navigation.name }}
</a> </a>
</li> </li>
{% endfor %} {% endfor %}
{% endcomment %}
</ul> </ul>
</div> </div>
@ -255,4 +263,4 @@
padding-right: 0; padding-right: 0;
} }
} }
</style> </style>

View File

@ -1,6 +1,29 @@
{% include "header" %} {% include "header" %}
{% include "course_version_outdated_alert", courses: courses.in_catalog %} {% include "course_version_outdated_alert", courses: courses.in_catalog %}
<main class="np-main np-catalog np-subpage-container np-max-width"> <main class="np-main np-catalog np-subpage-container np-max-width">
<div class="np-resource-title">
Available Courses
</div>
{% if courses.in_catalog.any? %}
<div class="np-catalog-courses row row-with-thumbnails">
{% for course in courses.in_catalog %}
{% unless course.enrolled? %}
<div class="col-xs-12 col-md-6 col-lg-4 np-stretch-content">
{% include "cards_course" with course %}
</div>
{% endunless %}
{% endfor %}
</div>
{% else %}
{% capture message %}
{% t shared.zero_state.courses.catalog
, key: current_school.course_vocabulary %}
{% endcapture %}
{% include "courses_zero_state", message: message %}
{% endif %}
</div>
{% comment %}
<div class="np-catalog-header-wrapper"> <div class="np-catalog-header-wrapper">
<div class="np-catalog-header"> <div class="np-catalog-header">
<div class="np-resource-title">{{ catalog.headline }}</div> <div class="np-resource-title">{{ catalog.headline }}</div>
@ -9,7 +32,7 @@
{% capture label %} {% capture label %}
{% t shared.filters.by_category %}{% endcapture %} {% t shared.filters.by_category %}{% endcapture %}
{% comment %} {% if courses.in_catalog.any? %} {% if courses.in_catalog.any? %}
{% {%
include "filter_dropdown", include "filter_dropdown",
filters: courses.filters, filters: courses.filters,
@ -18,6 +41,6 @@
%} %}
{% endif %} {% endcomment %} {% endif %} {% endcomment %}
</div> </div>
{% include "courses_catalog" %} {% comment %} {% include "courses_catalog" %} {% endcomment %}
</main> </main>
{% include "footer" %} {% include "footer" %}

View File

@ -2,7 +2,16 @@
{% include "course_version_outdated_alert", courses: courses.enrolled %} {% include "course_version_outdated_alert", courses: courses.enrolled %}
{% include "sub_navigation" %} {% include "sub_navigation" %}
<main class="np-main np-courses np-subpage-container np-max-width"> <main class="np-main np-courses np-subpage-container np-max-width">
<div class="row np-flex-center">
<div class="col-xs-12 col-sm-8">
{% if features.learning_paths? %}
<div class="np-dashboard-resources-title">
{% t shared.learning_paths %}
</div>
{% include "learning_paths_index", items: learning_paths.enrolled %}
{% endif %}
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-6 col-md-7 col-lg-9"> <div class="col-xs-12 col-sm-6 col-md-7 col-lg-9">
<div class="np-resource-title"> <div class="np-resource-title">
@ -10,27 +19,6 @@
</div> </div>
{% include "courses_index", class: "col-xs-12 col-md-6 col-lg-4 np-stretch-content" %} {% include "courses_index", class: "col-xs-12 col-md-6 col-lg-4 np-stretch-content" %}
<div class="np-resource-title">
Available Courses
</div>
{% if courses.in_catalog.any? %}
<div class="np-catalog-courses row row-with-thumbnails">
{% for course in courses.in_catalog %}
{% unless course.enrolled? %}
<div class="col-xs-12 col-md-6 col-lg-4 np-stretch-content">
{% include "cards_course" with course %}
</div>
{% endunless %}
{% endfor %}
</div>
{% else %}
{% capture message %}
{% t shared.zero_state.courses.catalog
, key: current_school.course_vocabulary %}
{% endcapture %}
{% include "courses_zero_state", message: message %}
{% endif %}
</div>
{% if features.training_events? %} {% if features.training_events? %}
<div class="col-xs-12 col-sm-6 col-md-5 col-lg-3"> <div class="col-xs-12 col-sm-6 col-md-5 col-lg-3">
@ -112,4 +100,4 @@ col.style.display = "flex"
} }
}) })
} }
</script> {% endcomment %} </script> {% endcomment %}

View File

@ -13,7 +13,7 @@ HEADERS = {
"X-Api-Key": APIKEY, "X-Api-Key": APIKEY,
} }
BASEURL = "https://api.northpass.com/v2/" BASEURL = "https://api.northpass.com/v2/"
IMPORTFILE = "/Users/normrasmussen/Downloads/cisa-092024.csv" IMPORTFILE = "/Users/normrasmussen/Downloads/cisa-092624.csv"
def bulk_invite_and_group(): def bulk_invite_and_group():