aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/actions/firebaseAdmin.js7
-rw-r--r--src/components/mao-account.js2
-rw-r--r--src/components/mao-admin.js3
-rw-r--r--src/components/mao-forums.js3
-rw-r--r--src/components/mao-tutoring.js2
-rw-r--r--src/components/registry-element.js24
6 files changed, 19 insertions, 22 deletions
diff --git a/src/actions/firebaseAdmin.js b/src/actions/firebaseAdmin.js
index 0171fc3..549c93c 100644
--- a/src/actions/firebaseAdmin.js
+++ b/src/actions/firebaseAdmin.js
@@ -61,17 +61,16 @@ export const snapshotAdminCompList = () => (dispatch) => {
docRef.onSnapshot((querySnapshot) => {
var compList = [];
querySnapshot.forEach((doc) => {
- var divisonData = [];
+ var userData = [];
for(var i = 0; i < doc.data().uids.length; i++) {
var docRefDivison = firestore.collection('users').doc(doc.data().uids[i]);
docRefDivison.get().then((docUser) => {
- divisonData.push(docUser.data().divison);
+ userData.push([docUser.data().username, docUser.data().divison]);
});
}
compList.push({
- ...doc.data(),
name: doc.id,
- divisons: divisonData
+ divisons: userData
});
});
dispatch(updateAdminCompList(compList));
diff --git a/src/components/mao-account.js b/src/components/mao-account.js
index 3b47f66..75a54f1 100644
--- a/src/components/mao-account.js
+++ b/src/components/mao-account.js
@@ -190,7 +190,7 @@ class MaoAccount extends connect(store)(PageViewElement) {
for(var i = 0; i < comps.length; i++) {
var competitionElement = document.createElement('p');
- competitionElement.innerHTML = comps[i];
+ competitionElement.innerHTML = comps[i].replace('_', ' ');
competitionElement.class = "center";
mainDiv.appendChild( competitionElement);
}
diff --git a/src/components/mao-admin.js b/src/components/mao-admin.js
index 0873e75..70b84be 100644
--- a/src/components/mao-admin.js
+++ b/src/components/mao-admin.js
@@ -212,11 +212,10 @@ class MaoAdmin extends connect(store)(PageViewElement) {
var registryGrid = this.shadowRoot.getElementById('registry-grid');
registryGrid.innerHTML = "";
- for(var i = 0; i<this.registry.length; i++) {
+ for(var i = 0; i < this.registry.length; i++) {
var registryElement = document.createElement('registry-element');
registryElement.name = this.registry[i].name;
- registryElement.emails = this.registry[i].emails;
registryElement.divisons = this.registry[i].divisons;
registryGrid.appendChild(registryElement);
diff --git a/src/components/mao-forums.js b/src/components/mao-forums.js
index cf58bc4..b6ed193 100644
--- a/src/components/mao-forums.js
+++ b/src/components/mao-forums.js
@@ -151,9 +151,6 @@ class MaoForums extends connect(store)(PageViewElement) {
}
}
- _firstRendered() {
- }
-
submitForum() {
if(this.shadowRoot) {
var subjectElement = this.shadowRoot.getElementById('subject-field');
diff --git a/src/components/mao-tutoring.js b/src/components/mao-tutoring.js
index 61a2104..6293c38 100644
--- a/src/components/mao-tutoring.js
+++ b/src/components/mao-tutoring.js
@@ -266,7 +266,7 @@ class MaoTutoring extends connect(store)(PageViewElement) {
<paper-card class="hopeCard">
<div class="card-actions">
- <h3>Need Help Findiding A Tutor?</h3>
+ <h3>Need Help Finding A Tutor?</h3>
<p>Please meet with your friends to create tutring sessions.</p>
<p>Also, you can try the forum page.</p>
<p>Otherwise, contact our tutoring coordinator <em>Mike Binkowski</em>.</p>
diff --git a/src/components/registry-element.js b/src/components/registry-element.js
index c54bd43..cbca5bf 100644
--- a/src/components/registry-element.js
+++ b/src/components/registry-element.js
@@ -103,14 +103,16 @@ class RegistryElement extends LitElement {
super();
this.name = "";
- this.emails = [];
this.divisons = [];
this.infoTabOpen = false;
}
+ _firstRendered() {
+ this.fillNames();
+ }
+
toggleTabOpen() {
- this.sortNames();
this.infoTabOpen = true;
}
@@ -118,7 +120,7 @@ class RegistryElement extends LitElement {
this.infoTabOpen = false;
}
- sortNames() {
+ fillNames() {
var thetas = this.shadowRoot.getElementById('name-list-theta');
var alphas = this.shadowRoot.getElementById('name-list-alpha');
var mus = this.shadowRoot.getElementById('name-list-mu');
@@ -131,21 +133,21 @@ class RegistryElement extends LitElement {
stats .innerHTML = "";
other .innerHTML = "";
- for(var i=0; i<this.emails.length; i++) {
- var listElement = document .createElement('li');
- listElement.innerHTML = this.emails[i] .replace('@communityschoolnaples.org', '');
- if (this.divisons[i].includes('Mu')) {
+ this.divisons.forEach((d) => {
+ var listElement = document .createElement('li');
+ listElement.innerHTML = d[0];
+ if (d[1].includes('Mu')) {
mus .appendChild(listElement);
- } else if (this.divisons[i].includes('Alpha')) {
+ } else if (d[1].includes('Alpha')) {
alphas .appendChild(listElement)
- } else if (this.divisons[i].includes('Theta')) {
+ } else if (d[1].includes('Theta')) {
thetas .appendChild(listElement)
- } else if (this.divisons[i].includes('Stats')) {
+ } else if (d[1].includes('Stats')) {
stats .appendChild(listElement)
} else {
other .appendChild(listElement);
}
- }
+ });
}