From b3b6b4afea8fbdeb18e6d70c9a1a030c01ecaed8 Mon Sep 17 00:00:00 2001 From: Norm Rasmussen Date: Tue, 15 Oct 2024 17:02:33 -0400 Subject: [PATCH] Skuid templates were changed on a demo. Williams-Sonoma improvements. Script was updated slightly. --- .../Skuid/homepage.html.liquid | 11 ++- .../Skuid/styles.css.liquid | 3 +- .../WSGC - New Hire/homepage.html.liquid | 14 +++- Scripts/all_default_class_names.py | 73 +++++++++++-------- 4 files changed, 63 insertions(+), 38 deletions(-) diff --git a/Custom_Templates/customer_templates/Skuid/homepage.html.liquid b/Custom_Templates/customer_templates/Skuid/homepage.html.liquid index 631d310e..d3d4cc72 100644 --- a/Custom_Templates/customer_templates/Skuid/homepage.html.liquid +++ b/Custom_Templates/customer_templates/Skuid/homepage.html.liquid @@ -92,6 +92,9 @@ {% endif%} {% endfor %} + {{ school.custom_properties.banner_text}} + + {% if view_more_counter >= 4%} {% endif %} @@ -296,11 +299,11 @@ margin: auto; } - [data-controls="prev"] { + [data-controls="prev"] { margin-left: -3%; } - [data-controls="next"] { + [data-controls="next"] { margin-right: -3%; } @@ -389,7 +392,7 @@ @media (min-width: 1025px) and (max-width: 2500px) { .recent-view-header { padding-top: 1%; - + } } @@ -481,4 +484,4 @@ .np-card-text-wrapper { display: flex; } - \ No newline at end of file + diff --git a/Custom_Templates/customer_templates/Skuid/styles.css.liquid b/Custom_Templates/customer_templates/Skuid/styles.css.liquid index ca93a9b4..8f52bf1c 100644 --- a/Custom_Templates/customer_templates/Skuid/styles.css.liquid +++ b/Custom_Templates/customer_templates/Skuid/styles.css.liquid @@ -8,7 +8,6 @@ /* 4.3 Overview */ /* 4.4 Dashboard filter */ /* 5. Course */ - /* 1. Global */ @media (min-width: 769px) and (max-width: 1600px) { @@ -1022,4 +1021,4 @@ footer { .np-top-cta-progress-content{ margin-bottom: 0.5rem; } -} \ No newline at end of file +} diff --git a/Custom_Templates/customer_templates/WSGC - New Hire/homepage.html.liquid b/Custom_Templates/customer_templates/WSGC - New Hire/homepage.html.liquid index 8529e3a2..af81b36f 100644 --- a/Custom_Templates/customer_templates/WSGC - New Hire/homepage.html.liquid +++ b/Custom_Templates/customer_templates/WSGC - New Hire/homepage.html.liquid @@ -2,6 +2,7 @@ {% assign new_hire_progress = 0 %} {% assign day_offset_in_seconds = 864000 %} {% assign zoom_url = "NULL" %} +{% assign in_center_group = false %} {% for learning_path in learning_paths.enrolled %} {% for category in learning_path.categories %} @@ -26,6 +27,15 @@ {% endfor %} {% endif %} +{% for group in current_person.groups %} + {% if group.name contains " IC " %} + {% assign in_center_group = true %} + {% else %} + {% assign in_center_group = false %} + {% endif %} +{% endfor %} + + {% include "header" %}
@@ -45,7 +55,7 @@ {% include "new_hire_homepage" , zoom_url: zoom_url %} {% else %} - {% if is_enrolled_in_new_hire_lp == true %} + {% if is_enrolled_in_new_hire_lp == true or in_center_group == true %} {% if new_hire_progress == 100 %} diff --git a/Scripts/all_default_class_names.py b/Scripts/all_default_class_names.py index 592161b1..d3b48508 100644 --- a/Scripts/all_default_class_names.py +++ b/Scripts/all_default_class_names.py @@ -1,7 +1,8 @@ import re from html.parser import HTMLParser from pathlib import Path -import pandas as pd +# import pandas as pd +from bs4 import BeautifulSoup # MASDICT = {'file': "", 'attributes' : { 'id': [], 'class': [] } } MASLIST = [] @@ -11,38 +12,50 @@ x = list(p.glob('**/*.html.liquid')) for posfile in x: file = str(posfile) htmlfile = open(file, 'r', encoding='utf-8') - finfile = file.split('/')[-1] - code = htmlfile.readlines() - ids = [] - classes = [] + file2 = open(file, 'r', encoding='utf-8') + # finfile = file.split('/')[-1] + code = file2.readlines() + inclst = [include for include in code if '{% include' in include] + print(inclst) for lines in code: - if "class=" in lines: - tmpline = lines - if "id=" not in tmpline: - try: - htmlclass = re.search('class="(.*)"', tmpline) - classes.append(htmlclass.group(1)) - except AttributeError as t: - print("Class: ", t) - pass - finally: - pass - elif "id=" in lines: - try: - id = re.search('id="(.*)"', lines) - ids.append(id.group(1)) - except AttributeError as t: - print("ID: ", t) - pass - finally: - pass - else: + if '{% include' in lines: pass - seconddict = { 'file': finfile, 'attributes': { 'id' : ids, 'class': classes } } - MASLIST.append(seconddict) -df = pd.json_normalize(MASLIST) -print(df) + soup = BeautifulSoup(htmlfile, 'html.parser') + clst = [node['class'] for node in soup.find_all() if node.has_attr('class')] + # print(clst) + ilst = [node['id'] for node in soup.find_all() if node.has_attr('id')] + # print(ilst) + + # ids = [] + # classes = [] + # if "class=" in lines: + # tmpline = lines + # if "id=" not in tmpline: + # try: + # htmlclass = re.search('class="(.*)"', tmpline) + # classes.append(htmlclass.group(1)) + # except AttributeError as t: + # print("Class: ", t) + # pass + # finally: + # pass + # elif "id=" in lines: + # try: + # id = re.search('id="(.*)"', lines) + # ids.append(id.group(1)) + # except AttributeError as t: + # print("ID: ", t) + # pass + # finally: + # pass + # else: + # pass + # seconddict = { 'file': finfile, 'attributes': { 'id' : ids, 'class': classes } } + # MASLIST.append(seconddict) + # +# df = pd.json_normalize(MASLIST) +# print(df) # kp = (df.set_index('file').apply(lambda x: x.str.split(",").explode()).reset_index()) # ksp = df.set_index('file').apply(lambda x: df['attributes.class']([x.split(',') ])) # print(ksp)