From 130d0b8901cfbb02f1eff487b2a134325856b6e1 Mon Sep 17 00:00:00 2001 From: macho-catt Date: Tue, 19 Oct 2021 23:11:45 -0700 Subject: [PATCH] Swap wins from using wins-data to _wins-data --- assets/js/wins.js | 44 ++++++-------------------------------------- 1 file changed, 6 insertions(+), 38 deletions(-) diff --git a/assets/js/wins.js b/assets/js/wins.js index 2ce2865f1a..e08060e66c 100644 --- a/assets/js/wins.js +++ b/assets/js/wins.js @@ -19,23 +19,6 @@ const overview = "Give us a brief overview" const display = "Display?" - const dataKeys = [ - "Timestamp", - "Email Address", - "Full name", - "Linkedin URL (optional)", - "Could we use your Linkedin profile picture next to your story?", - "Github URL (optional)", - "Could we use your Github profile picture next to your story?", - "Select the team(s) you're on", - "Select your role(s) on the team", - "What is/was your specific role? (optional)", - "When did you join Hack for LA? (optional)", - "What do you want to celebrate (select all that apply)?", - "Give us a brief overview", - "Could we use your Linkedin profile picture next to your story?", - "Display?" - ] const otherIcon = `star.svg` const badgeIcons = { "I got a new job": `briefcase.svg`, @@ -56,27 +39,12 @@ } function main() { - {% assign localData = site.data.external.wins-data %} - // Escapes JSON for injections. See: #2134. If this is no longer the case, perform necessary edits, and remove this comment. - let localData = JSON.parse(decodeURIComponent("{{ localData | jsonify | uri_escape }}")); - localData.unshift(dataKeys) - const rawData = localData; - - //creates an array of objects where each question is the key and the answer is the value - //cardData[index][question_str] = answer_str - let cardData = [] - const keys = rawData[0] - rawData.slice(1).forEach(data => { - let cardObj = {} - for (let i = 0; i < keys.length; i++) { - cardObj[keys[i]] = data[i]; - } - cardData.push(cardObj) - }) - - window.localStorage.setItem('data', JSON.stringify(cardData)); - makeCards(cardData); - ifPageEmpty(); + {% assign localData = site.data.external._wins-data %} + // Escapes JSON for injections. See: #2134. If this is no longer the case, perform necessary edits, and remove this comment + const cardData = JSON.parse(decodeURIComponent("{{ localData | jsonify | uri_escape }}")); + window.localStorage.setItem('data', JSON.stringify(cardData)); + makeCards(cardData); + ifPageEmpty(); }