Templates for Zenjob, Mizuno, Artera. Scripts for Wild Health.

This commit is contained in:
Norm Rasmussen
2023-06-06 17:34:32 -04:00
parent 14f713c3af
commit e924fdb040
12 changed files with 146 additions and 36 deletions

Binary file not shown.

View File

@ -36,7 +36,11 @@
{% else %}
<a class="np-button np-button-wide" href="{{ course_path }}">
<span data-lang="DE">{% t shared.view %}</span>
<span data-lang="EN">View</span>
{% if course.progress > 0 and course.progress < 100 %}
<span data-lang="EN">Continue</span>
{% else %}
<span data-lang="EN">View</span>
{% endif %}
</a>
{% endif %}

View File

@ -170,8 +170,8 @@
function filterCourses(selectedItem) {
let selectedFilter = $(selectedItem).text().replace(" ", "-").toLowerCase();
if (selectedFilter == "0%-abgeschlossen") {
selectedFilter = "jetzt-starten"
if (selectedFilter == "0%-abgeschlossen" || selectedFilter == "0%-completed") {
selectedFilter = "not-started"
}
$(".np-catalog-courses").find('.course-column').removeClass('np-hidden')

View File

@ -1,11 +0,0 @@
<div class="english-banner">
<p>
Switch your app to German to find all training and materials (some jobs require a certain level of German).
</p>
</div>
<style>
.english-banner {
height: 80px;
width: 100%;
}
</style>

View File

@ -17,7 +17,7 @@
<select>
<option selected disabled hidden>All Courses</option>
<option value="all">All Courses</option>
<option value="not-started">Not Started</option>
<option value="not-started">0% completed</option>
<option value="in-progress">In progress</option>
<option value="completed">Completed</option>
</select>

View File

@ -0,0 +1,39 @@
{% if current_session.id != session.id %}
{% assign training_session_time = session.time_period | split: " - " %}
{% assign start_time = training_session_time | slice: 0 | join: "" %}
{% if start_time contains "PM" %}
{% assign start_time = start_time | remove: " PM" %}
{% assign split_start_time = start_time | split: ":" %}
{% assign start_time_hour = split_start_time | slice: 0 | join: "" | abs | plus: 12 %}
{% assign start_time_mins = split_start_time | slice: 1 | join: "" %}
{% elsif start_time contains "AM" %}
{% assign start_time = start_time | remove: " AM" %}
{% endif %}
{% assign end_time = training_session_time | slice: 1 | join: "" %}
{% if end_time contains "PM" %}
{% assign end_time = end_time | remove: " PM" %}
{% assign split_end_time = end_time | split: ":" %}
{% assign end_time_hour = split_end_time | slice: 0 | join: "" | abs | plus: 12 %}
{% assign end_time_mins = split_end_time | slice: 1 | join: "" %}
{% elsif end_time contains "AM" %}
{% assign end_time = end_time | remove: " AM" %}
{% endif %}
<a
class="np-training-session-tile"
href="{% route training_session, id: session.id %}"
>
<i class="far fa-calendar-star np-training-session-tile-icon"></i>
<div>
<div class="np-training-session-tile-date">
{{ session.month }} {{ session.day }}, {{ session.year }}
</div>
<div class="np-training-session-tile-time">
{{start_time_hour}}:{{start_time_mins}} - {{end_time_hour}}:{{end_time_mins}} Uhr
</div>
</div>
<i class="fas fa-chevron-right np-training-session-tile-chevron"></i>
</a>
{% endif %}

View File

@ -1,10 +1,12 @@
{% include "header" %}
{% include "english_banner" %}
<main class="np-main np-courses np-subpage-container">
<h1 class="np-resource-title">
<span data-lang="DE">Deine Trainings für mehr Jobauswahl</span>
<span data-lang="EN">Your training for more job choices</span>
</h1>
<div class="np-resource-subtitle">
<span data-lang="EN">Switch your app to German to find all training and materials (some jobs require a certain level of German).</span>
</div>
{% comment %} <br>
{% capture label %}{% t shared.filters.by_category %}{% endcapture %}
{% if courses.in_catalog.any? %}

View File

@ -104,7 +104,7 @@ DONE: Bjorn our data schema. Send him our 3-4 options in an email so he can read
### Content & Uploading
Video Promo URL not embedding correctly? Why? iFrame wasn't working, but she was using embed URL not single http:// url.
Video Promo URL not embedding correctly? Why? iFrame wasn't working, but she was using embed URL not single <http://> url.
## 01/09/2023
@ -193,7 +193,6 @@ Start up weekly meetings with Kaisa for 10am on Tuesday
GetVero is the customer emailing platform they currently use. They wanted to do it via Segment.
Custom email domain needs to be setup first. Waiting on Kaisa to "get through security"
## 04/18/2023
### Weekly Sync - James, Oksana, and Dina
@ -213,7 +212,7 @@ They would want a page per language, so app/en or app/es etc. This is a requirem
Text from Engineers (synopsis):
Lets imagine we redirect the user from page A to B using 301. Later we decided to change the redirect from A to C using
301. The user will be redirected to B because it was cached in their browser. Experience: User visits A > User was
301. The user will be redirected to B because it was cached in their browser. Experience: User visits A > User was
redirected to B > Browser sees its a 301 redirection so it adds this redirect to cache > We change in NP from
A->B to A->C > User visits A > User was redirected to B (because his browser has this redirect in cache).
@ -222,10 +221,9 @@ to app/courses, we will redirect him to sign_in page with 301. The browser will
301 makes sense if the website they are accessing was permanently moved to other location. In this case they are trying to access courses list but are redirected to sign in page because they have to be authenticated before they can access it. If we redirected them from courses to sign in page with 301 the users browser would save the redirect location (sign in page) and whenever the user tried to access courses web page their browser would move them automatically to sign in page making courses page inaccessible for the user. The only way out of it is cleaning browsers cache. However once they cleared the cache they would remove the cookies as well. The cookies keep the information about users identity. This is helpful because with that they dont have to log in each time they visit our platform. But once the cookies are removed they would be again redirected to sign in page keeping them in this vicious circle. The reason to use 301 is to tell the browser “forget about this old location of the page you are accessing, this page is now here, also store this location and use it whenever you try to access this old location”.
## 05/16/2023
Search results - can't click enough Northpass
Only the title can be clicked when search results are returned. We need to be able to click the icon or description as well Not a problem - will get this started ASAP
Search results - can't click enough Northpass
Only the title can be clicked when search results are returned. We need to be able to click the icon or description as well Not a problem - will get this started ASAP
DONE: Directly ask Chloe about the technical complications.

View File

@ -4,15 +4,16 @@ from pathlib import Path
import Apikeys
import os
basefile = "/Users/normrasmussen/Downloads/Recast-learners.csv"
api_key = Apikeys.recast
basefile = "/Users/normrasmussen/Downloads/Mizuno_May.csv"
api_key = Apikeys.mizuno
uuid_url = "https://api.northpass.com/v2/people?filter[email][eq]="
prop_url = "https://api.northpass.com/v2/properties/people/"
headers = {
"accept": "*/*",
"x-api-key": api_key,
"content-type": "application/json",
}
"accept": "*/*",
"x-api-key": api_key,
"content-type": "application/json",
}
def load_file(basefile):
dict_list = []
@ -24,7 +25,7 @@ def load_file(basefile):
print(f"File found! Importing {basefile}")
for email in completions.itertuples():
row_num = email[0]
row_dict = {"row_num":row_num}
row_dict = {"row_num": row_num}
email = email[3]
url = uuid_url + f"{email}"
response = requests.get(url, headers=headers)
@ -42,18 +43,17 @@ def load_file(basefile):
print(e)
finally:
for info in dict_list:
row = info['row_num']
pid = info['pgaid']
row = info["row_num"]
pid = info["pgaid"]
completions.loc[completions.index[row], "PGA ID"] = pid
completions = completions[completions["PGA ID"] != "0"]
#completions = completions.iloc[:, 0:]
# completions = completions.iloc[:, 0:]
print(completions)
completions.to_csv(
"/Users/normrasmussen/Downloads/MizunoCompletions_with_PGAIDs.csv",
index=False
)
"/Users/normrasmussen/Downloads/MizunoCompletions_with_PGAIDs.csv",
index=False,
)
if __name__ == "__main__":
load_file(basefile)

View File

@ -0,0 +1 @@
{"scriptId":"1W9jVjAVjIivO2sj1flvoofftiZ4v0BgAMD_RPBsSTGZBcedPN_DUEW7m","rootDir":"/Users/normrasmussen/Documents/Work/Scripts/GoogleScripts/WildHealth_Assignments"}

View File

@ -0,0 +1,70 @@
/* This function needs to run either once a day OR after a webhook that contains the course name.
Date range: 2/1/23 - 7/31/23
Order of operations:
- Parse Webhook, if course name == Coaching Certification, assignment == Practice Coaching Session 3 (PSA),
Activity name == Step 1: Practice Coaching Session 3 - Recording Upload
- GET List Assignments: https://api.northpass.com/v2/assignments/{assignment_uuid}/submissions
- GET Person https://api.northpass.com/v2/people/{uuid}
Fill in columns: Date Submitted, Person's Name, Email, Assignment Name, Assignment Download Link.
UUIDS:
Activity: a94171bb-0184-433e-a62d-2b8c67ad196e
Course: 03bb0fa0-df1f-4f40-b550-b59b113fd79f
Assignment: a4e082a2-9416-4fdf-9ef6-a817e25d26ee
API Key: HWxj6VTNPwbc3WghFTPzr7SjE
*/
const sheet = SpreadsheetApp.getActiveSheet();
const apiKey = "HWxj6VTNPwbc3WghFTPzr7SjE";
var assign_uid = "a4e082a2-9416-4fdf-9ef6-a817e25d26ee"
let page = 0;
function getAssignment() {
var sheet = SpreadsheetApp.getActiveSheet();
var api_url =
'https://api.northpass.com/v2/assignments/'+assign_uid+'/submissions?page='+page;
const settings = {
async: true,
crossDomain: true,
method: 'GET',
headers: {
accept: 'application/json',
'X-Api-Key': apiKey
}
}
const sendMsg = UrlFetchApp.fetch(api_url, settings);
var apiResponse = sendMsg.getContentText();
var parsedata = JSON.parse(apiResponse);
var data = parsedata["data"];
if (data.length != 0){
let rowArray = []
for (item of data) {
var submit_date = item["attributes"]["created_at"];
var person = item["relationships"]["person"]["data"]["id"];
var download_link = item["links"]["download"];
var person_url = 'https://api.northpass.com/v2/people/'+person;
const settings = {
async: true,
crossDomain: true,
method: 'GET',
headers: {
accept: 'application/json',
'X-Api-Key': apiKey
}
};
const sendMsg = UrlFetchApp.fetch(person_url, settings);
var uuidResponse = sendMsg.getContentText();
var parsing = JSON.parse(uuidResponse);
var info = parsing["data"]
var full_name = info["attributes"]["full_name"];
var email = info["attributes"]["email"];
let rowArray = [submit_date, download_link, person, full_name, email];
Logger.log(rowArray);
};
}
page++;
getAssignment(page);
};

View File

@ -0,0 +1,7 @@
{
"timeZone": "America/New_York",
"dependencies": {
},
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8"
}