diff --git a/Custom_Templates/customer_templates/Chubb/_featured_cards_course.html.liquid b/Custom_Templates/customer_templates/Chubb/_featured_cards_course.html.liquid index 157047a6..d223549a 100644 --- a/Custom_Templates/customer_templates/Chubb/_featured_cards_course.html.liquid +++ b/Custom_Templates/customer_templates/Chubb/_featured_cards_course.html.liquid @@ -1,3 +1,16 @@ +{% if current_person.groups.any? %} + {% for group in current_person.groups %} + {% if group.id == '' %} + {% comment %} + < -----------------------------> + The carousel HTML goes here. + < -----------------------------> + {% endcomment %} + {% endif %} + {% endfor %} +{% endif %} + + {% if current_person.groups.any? %} {% for group in current_person.groups %} {% if group.id == '5766ee65-0f6e-42fa-b932-a26b3bbb1636' %} @@ -35,15 +48,7 @@ - {% elsif group.id == '' %} - {% comment %} - <-------------------------------> - Jenelle, similar to above for Cornerstone, please add your carousel items here! - <-------------------------------> - {% endcomment %} - {% endif %} - {% endfor %} -{% endif %} +{% unless group.id = '' %}
@@ -127,4 +132,8 @@
+ {% endunless %} + {% endif %} + {% endfor %} +{% endif %} diff --git a/Custom_Templates/customer_templates/Chubb/_recommended_carousel.html.liquid b/Custom_Templates/customer_templates/Chubb/_recommended_carousel.html.liquid index 6cdd44a9..5506ba07 100644 --- a/Custom_Templates/customer_templates/Chubb/_recommended_carousel.html.liquid +++ b/Custom_Templates/customer_templates/Chubb/_recommended_carousel.html.liquid @@ -1,44 +1,70 @@ {% assign content_counter = 0 %} -{% for course in courses.in_catalog %} - {% for category in course.categories %} - {% if category.name == 'Recommended' %} +{% if current_person.groups.any? %} + {% for group in current_person.groups %} + {% for course in courses.in_catalog %} + {% for category in course.categories %} + {% if group.id = '' and category.name = 'Recommended - ' %} + {% assign content_counter = content_counter | plus: 1 %} + {% elsif category.name == 'Recommended' %} {% assign content_counter = content_counter | plus: 1 %} {% endif %} - {% endfor %} -{% endfor %} -{% for learning_path in learning_paths.available %} - {% for category in learning_path.categories %} - {% if category.name == 'Recommended' %} - {% assign content_counter = content_counter | plus: 1 %} - {% endif %} - {% endfor %} -{% endfor %} + {% endfor %} + {% endfor %} + {% endfor %} +{% endif %} +{% if current_person.groups.any? %} + {% for group in current_person.groups %} + {% for learning_path in learning_paths.available %} + {% for category in learning_path.categories %} + {% if group.id = '' and category.name = 'Recommended - ' %} + {% assign content_counter = content_counter | plus: 1 %} + {% elsif category.name == 'Recommended' %} + {% assign content_counter = content_counter | plus: 1 %} + {% endif %} + {% endfor %} + {% endfor %} + {% endfor %} +{% endif %} {% comment %} -To add for Chubb: -If person is in group show certain courses. {% endcomment%} diff --git a/Scripts/API_Tests/Client_API_Extract.csv.gz b/Scripts/API_Tests/Client_API_Extract.csv.gz index 863d9084..3f3e76ee 100644 Binary files a/Scripts/API_Tests/Client_API_Extract.csv.gz and b/Scripts/API_Tests/Client_API_Extract.csv.gz differ diff --git a/Scripts/API_Tests/Client_File.csv.gz b/Scripts/API_Tests/Client_File.csv.gz index 7f112213..0164d6f8 100644 Binary files a/Scripts/API_Tests/Client_File.csv.gz and b/Scripts/API_Tests/Client_File.csv.gz differ diff --git a/Scripts/API_Tests/__pycache__/Apikeys.cpython-310.pyc b/Scripts/API_Tests/__pycache__/Apikeys.cpython-310.pyc index 3a7ab0bc..31462127 100644 Binary files a/Scripts/API_Tests/__pycache__/Apikeys.cpython-310.pyc and b/Scripts/API_Tests/__pycache__/Apikeys.cpython-310.pyc differ diff --git a/Scripts/API_Tests/get_course_ids.py b/Scripts/API_Tests/get_course_ids.py index 6431ad0d..0f735706 100644 --- a/Scripts/API_Tests/get_course_ids.py +++ b/Scripts/API_Tests/get_course_ids.py @@ -4,7 +4,7 @@ import pprint import csv pp = pprint.PrettyPrinter(indent=4) -APIKEY = Apikeys.EMPLOY +APIKEY = Apikeys.SUPPLIERPROD HEADERS = { "accept": "application/json", "X-Api-Key": APIKEY, @@ -22,8 +22,8 @@ def get_courses(): while True: # for course_name in COURSES: count += 1 - # url = f"https://api.northpass.com/v2/courses/?filter[name][eq]={course_name}" - url = f"https://api.northpass.com/v2/courses/?limit=100&page={count}" + # url = f"https://api2.northpass.com/v2/courses/?filter[name][eq]={course_name}" + url = f"https://api2.northpass.com/v2/courses/?limit=100&page={count}" response = requests.get(url, headers=HEADERS) response = response.json() nextlink = response["links"] @@ -41,14 +41,14 @@ def get_courses(): break pp.pprint(list_of_ids) - # print(len(list_of_ids)) - # with open( - # "/Users/normrasmussen/Downloads/LuminateUS-Courses.csv", "a+", newline='\n' - # ) as csvfile: - # for group in list_of_ids: - # for key, value in group.items(): - # csvwriter = csv.writer(csvfile) - # csvwriter.writerow([key, value]) + print(len(list_of_ids)) + with open( + "/Users/normrasmussen/Downloads/Supplier-Courses.csv", "a+", newline='\n' + ) as csvfile: + for group in list_of_ids: + for key, value in group.items(): + csvwriter = csv.writer(csvfile) + csvwriter.writerow([key, value]) if __name__ == "__main__": diff --git a/Scripts/API_Tests/get_groups_and_learners.py b/Scripts/API_Tests/get_groups_and_learners.py index 738a4220..a58b1169 100644 --- a/Scripts/API_Tests/get_groups_and_learners.py +++ b/Scripts/API_Tests/get_groups_and_learners.py @@ -2,8 +2,8 @@ import requests import Apikeys import pandas as pd -BASEURL = "https://api.northpass.com/v2/" -APIKEY = Apikeys.SKAN +BASEURL = "https://api2.northpass.com/v2/" +APIKEY = Apikeys.SUPPLIERPROD HEADERS = {"X-Api-Key": APIKEY, "accept": "application/json"} LISTGROUPS = "groups/" @@ -27,7 +27,10 @@ def get_groups(): if "next" not in nextlink: break - get_memberships(groups_list) + # get_memberships(groups_list) + df = pd.DataFrame.from_records(groups_list) + print(df) + df.to_csv("~/Downloads/Supplier_Groups.csv") def get_memberships(groups_list):