From e0f4b9ea698652865bb1632a57967e04ffc589ee Mon Sep 17 00:00:00 2001 From: Norm Rasmussen Date: Thu, 6 Mar 2025 19:27:45 -0500 Subject: [PATCH] Backed up BuilderTrend's templates. --- .../BuilderTrend External/_footer.html.liquid | 2 +- .../_main_hero_masthead.html.liquid | 4 +-- .../_sub_navigation.html.liquid | 2 +- .../_training_session_header.html.liquid | 2 +- .../homepage.html.liquid | 5 +-- .../BuilderTrend External/search.html.liquid | 2 +- .../training_events.html.liquid | 4 +-- Scripts/API_Tests/get_category_ids.py | 8 ++--- .../API_Tests/get_courses_and_categories.py | 35 +++++++++++-------- 9 files changed, 35 insertions(+), 29 deletions(-) diff --git a/Custom_Templates/customer_templates/BuilderTrend External/_footer.html.liquid b/Custom_Templates/customer_templates/BuilderTrend External/_footer.html.liquid index 4c3411bc..7b5e0fd2 100644 --- a/Custom_Templates/customer_templates/BuilderTrend External/_footer.html.liquid +++ b/Custom_Templates/customer_templates/BuilderTrend External/_footer.html.liquid @@ -38,7 +38,7 @@ - Virtual Training + Live Group Trainings diff --git a/Custom_Templates/customer_templates/BuilderTrend External/_main_hero_masthead.html.liquid b/Custom_Templates/customer_templates/BuilderTrend External/_main_hero_masthead.html.liquid index 610b59d4..00dc6e1a 100644 --- a/Custom_Templates/customer_templates/BuilderTrend External/_main_hero_masthead.html.liquid +++ b/Custom_Templates/customer_templates/BuilderTrend External/_main_hero_masthead.html.liquid @@ -20,8 +20,8 @@

Buildertrend University: deep dive our software at our headquarters

March 26-27, 2025

- -

See all sessions

+ +

See all sessions

diff --git a/Custom_Templates/customer_templates/BuilderTrend External/_sub_navigation.html.liquid b/Custom_Templates/customer_templates/BuilderTrend External/_sub_navigation.html.liquid index 4c5e5b02..208ad8cb 100644 --- a/Custom_Templates/customer_templates/BuilderTrend External/_sub_navigation.html.liquid +++ b/Custom_Templates/customer_templates/BuilderTrend External/_sub_navigation.html.liquid @@ -49,7 +49,7 @@ - Virtual Training + Live Group Trainings
diff --git a/Custom_Templates/customer_templates/BuilderTrend External/_training_session_header.html.liquid b/Custom_Templates/customer_templates/BuilderTrend External/_training_session_header.html.liquid index 31b3b465..cc962bd1 100644 --- a/Custom_Templates/customer_templates/BuilderTrend External/_training_session_header.html.liquid +++ b/Custom_Templates/customer_templates/BuilderTrend External/_training_session_header.html.liquid @@ -1,5 +1,5 @@
- Virtual Training + Live Group Trainings diff --git a/Custom_Templates/customer_templates/BuilderTrend External/homepage.html.liquid b/Custom_Templates/customer_templates/BuilderTrend External/homepage.html.liquid index 476caf29..28a34d4c 100644 --- a/Custom_Templates/customer_templates/BuilderTrend External/homepage.html.liquid +++ b/Custom_Templates/customer_templates/BuilderTrend External/homepage.html.liquid @@ -107,7 +107,8 @@
{% if training_events.available.any? %} @@ -177,7 +178,7 @@
{% if training_events.available.any? %} diff --git a/Custom_Templates/customer_templates/BuilderTrend External/search.html.liquid b/Custom_Templates/customer_templates/BuilderTrend External/search.html.liquid index 351dd3ef..438c8900 100644 --- a/Custom_Templates/customer_templates/BuilderTrend External/search.html.liquid +++ b/Custom_Templates/customer_templates/BuilderTrend External/search.html.liquid @@ -6,7 +6,7 @@ {% if training_events.available.any? %}
-
Upcoming Virtual Training
+
Upcoming Live Group Trainings
{% for training_event in training_events.available %}
{% include "cards_training_event" with training_event %} diff --git a/Custom_Templates/customer_templates/BuilderTrend External/training_events.html.liquid b/Custom_Templates/customer_templates/BuilderTrend External/training_events.html.liquid index a386c1a8..7d8d979d 100644 --- a/Custom_Templates/customer_templates/BuilderTrend External/training_events.html.liquid +++ b/Custom_Templates/customer_templates/BuilderTrend External/training_events.html.liquid @@ -10,12 +10,12 @@ d="M27 5H5C4.46957 5 3.96086 5.21071 3.58579 5.58579C3.21071 5.96086 3 6.46957 3 7V25C3 25.5304 3.21071 26.0391 3.58579 26.4142C3.96086 26.7893 4.46957 27 5 27H27C27.5304 27 28.0391 26.7893 28.4142 26.4142C28.7893 26.0391 29 25.5304 29 25V7C29 6.46957 28.7893 5.96086 28.4142 5.58579C28.0391 5.21071 27.5304 5 27 5ZM27 15H21V7H27V15ZM5 7H19V25H5V7ZM27 25H21V17H27V25ZM22.5 11C22.5 10.7033 22.588 10.4133 22.7528 10.1666C22.9176 9.91997 23.1519 9.72771 23.426 9.61418C23.7001 9.50065 24.0017 9.47094 24.2926 9.52882C24.5836 9.5867 24.8509 9.72956 25.0607 9.93934C25.2704 10.1491 25.4133 10.4164 25.4712 10.7074C25.5291 10.9983 25.4993 11.2999 25.3858 11.574C25.2723 11.8481 25.08 12.0824 24.8334 12.2472C24.5867 12.412 24.2967 12.5 24 12.5C23.6022 12.5 23.2206 12.342 22.9393 12.0607C22.658 11.7794 22.5 11.3978 22.5 11ZM25.5 21C25.5 21.2967 25.412 21.5867 25.2472 21.8334C25.0824 22.08 24.8481 22.2723 24.574 22.3858C24.2999 22.4993 23.9983 22.5291 23.7074 22.4712C23.4164 22.4133 23.1491 22.2704 22.9393 22.0607C22.7296 21.8509 22.5867 21.5836 22.5288 21.2926C22.4709 21.0017 22.5007 20.7001 22.6142 20.426C22.7277 20.1519 22.92 19.9176 23.1666 19.7528C23.4133 19.588 23.7033 19.5 24 19.5C24.3978 19.5 24.7794 19.658 25.0607 19.9393C25.342 20.2206 25.5 20.6022 25.5 21ZM16.9688 20.75C16.6452 19.5418 15.8779 18.5 14.82 17.8325C15.3818 17.274 15.7651 16.5614 15.9214 15.7848C16.0777 15.0082 15.9998 14.2027 15.6978 13.4704C15.3957 12.7381 14.8831 12.112 14.2248 11.6714C13.5664 11.2309 12.7921 10.9957 12 10.9957C11.2079 10.9957 10.4336 11.2309 9.77525 11.6714C9.11693 12.112 8.60426 12.7381 8.30221 13.4704C8.00016 14.2027 7.92234 15.0082 8.07861 15.7848C8.23488 16.5614 8.61821 17.274 9.18 17.8325C8.12282 18.5007 7.35575 19.5422 7.03125 20.75C6.96495 21.0069 7.00342 21.2797 7.13821 21.5082C7.27301 21.7368 7.49307 21.9024 7.75 21.9688C8.00693 22.0351 8.27967 21.9966 8.50823 21.8618C8.73679 21.727 8.90245 21.5069 8.96875 21.25C9.29875 19.9688 10.6013 19 12 19C13.3988 19 14.7025 19.9662 15.0312 21.25C15.0976 21.5069 15.2632 21.727 15.4918 21.8618C15.7203 21.9966 15.9931 22.0351 16.25 21.9688C16.5069 21.9024 16.727 21.7368 16.8618 21.5082C16.9966 21.2797 17.0351 21.0069 16.9688 20.75ZM10 15C10 14.6044 10.1173 14.2178 10.3371 13.8889C10.5568 13.56 10.8692 13.3036 11.2346 13.1522C11.6001 13.0009 12.0022 12.9613 12.3902 13.0384C12.7781 13.1156 13.1345 13.3061 13.4142 13.5858C13.6939 13.8655 13.8844 14.2219 13.9616 14.6098C14.0387 14.9978 13.9991 15.3999 13.8478 15.7654C13.6964 16.1308 13.44 16.4432 13.1111 16.6629C12.7822 16.8827 12.3956 17 12 17C11.4696 17 10.9609 16.7893 10.5858 16.4142C10.2107 16.0391 10 15.5304 10 15Z" fill="black" /> -

Engage in live, dynamic learning alongside experts and peers with Virtual Training.

+

Engage in live, dynamic learning alongside experts and peers with Live Group Trainings.

{% include "training_events_enrolled" %}
- Upcoming Virtual Trainings + Upcoming Live Group Trainings
{% include "training_events_index" %}
diff --git a/Scripts/API_Tests/get_category_ids.py b/Scripts/API_Tests/get_category_ids.py index 0c20f971..a2e6cc39 100644 --- a/Scripts/API_Tests/get_category_ids.py +++ b/Scripts/API_Tests/get_category_ids.py @@ -3,8 +3,8 @@ import os import Apikeys import requests -apikey = Apikeys.WALMARTPROD -cmd = "touch ~/Downloads/Spark_Categories.csv" +apikey = Apikeys.SUPPLIERPROD +cmd = "touch ~/Downloads/Supplier_Categories.csv" os.system(cmd) url = "https://api2.northpass.com/v2/categories?limit=100" @@ -18,12 +18,12 @@ response = response.json() for item in response['data']: id = item['id'] name = item['attributes']['name'] - with open('/Users/normrasmussen/Downloads/Spark_Categories.csv', 'a', newline='') as csvfile: + with open('/Users/normrasmussen/Downloads/Supplier_Categories.csv', 'a', newline='') as csvfile: writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL) writer.writerow([name, id,]) # print(f"Category: {name} and ID: {id}") -with open('/Users/normrasmussen/Downloads/Spark_Categories.csv', 'r') as readfile: +with open('/Users/normrasmussen/Downloads/Supplier_Categories.csv', 'r') as readfile: reader = csv.reader(readfile) for row in reader: print(row) diff --git a/Scripts/API_Tests/get_courses_and_categories.py b/Scripts/API_Tests/get_courses_and_categories.py index 0b254ac0..8dbe5df4 100644 --- a/Scripts/API_Tests/get_courses_and_categories.py +++ b/Scripts/API_Tests/get_courses_and_categories.py @@ -21,22 +21,25 @@ def get_course(): for response in data["data"]: status = response["attributes"]["status"] - uuid = response["id"] - name = response["attributes"]["name"] - course_dict = { - "id": uuid, - "name": name, - "status": status, - # "build_url": build_url - # "url": f"https://walmart.northpass.com/app/courses/{uuid}", - } - courses.append(course_dict) + if status == "live": + uuid = response["id"] + name = response["attributes"]["name"] + course_dict = { + "id": uuid, + "name": name, + "status": status, + # "build_url": build_url + # "url": f"https://walmart.northpass.com/app/courses/{uuid}", + } + courses.append(course_dict) - # FIX: Up until here, each course gets read to the terminal. - # FIX: After this, something is being overwritten. + # FIX: Up until here, each course gets read to the terminal. + # FIX: After this, something is being overwritten. - cat_id = response["relationships"]["categories"]["data"] - get_cat_name(cat_id, course_dict, courses) + cat_id = response["relationships"]["categories"]["data"] + print(name) + print(cat_id) + get_cat_name(cat_id, course_dict, courses) if "next" not in nextlink: break @@ -63,14 +66,16 @@ def get_cat_name(cat_id, course_dict, courses): for item in cat_id: categoryid = item["id"] url = f"https://api2.northpass.com/v2/categories/{categoryid}" + # print(url) cat_resp = requests.get(url, headers=headers) cat_data = cat_resp.json() + # print(cat_data) cat_name = cat_data["data"]["attributes"]["name"] cats.append(cat_name) course_dict.update({"categories": cats}) print(course_dict) - write_to_csv(courses) + # write_to_csv(courses) def write_to_csv(courses):