From 1d1fe5319fc420f3e23da474c74b87a26f15eee2 Mon Sep 17 00:00:00 2001 From: Kenneth Jao Date: Wed, 10 Aug 2016 14:42:31 -0400 Subject: [PATCH] Added editing class tabs --- hourglass/client/profile/profile.html | 67 ++++++++++++++++++++++++++- hourglass/client/profile/profile.js | 15 +++++- 2 files changed, 78 insertions(+), 4 deletions(-) diff --git a/hourglass/client/profile/profile.html b/hourglass/client/profile/profile.html index b3a4c4b..54253d6 100644 --- a/hourglass/client/profile/profile.html +++ b/hourglass/client/profile/profile.html @@ -32,8 +32,71 @@

Classes

- +
+
+ +

Manage my Classes

+
+
+ +

Join a Class

+
+
+ +

Create a Class

+
+
+
+ {{#if profClassTab "manClass"}} + + {{/if}} + {{#if profClassTab "addClass"}} + + {{/if}} + {{#if profClassTab "creClass"}} + {{/if}} + +
diff --git a/hourglass/client/profile/profile.js b/hourglass/client/profile/profile.js index c985b19..307f1a3 100644 --- a/hourglass/client/profile/profile.js +++ b/hourglass/client/profile/profile.js @@ -1,6 +1,7 @@ import { Template } from 'meteor/templating'; Session.set("profInputOpen",null); +Session.set("profClassTab",null); Session.set("modifying",null); Session.set("radioDiv",null); @@ -48,7 +49,17 @@ Template.profile.helpers({ } }, classes() { - return classes.find( { status: { $eq: true }, privacy: { $eq: false }}).sort({ subscribers: -1 }).fetch(); + return classes.find( { status: { $eq: true }, privacy: { $eq: false }}, {sort: { subscribers: -1 }}).fetch(); + }, + profClassOpen(tab) { + Session.set("profClassTab",tab); + }, + profClassTab(tab) { + if(tab === Session.get("profClassTab")) { + return true; + } else { + return false; + } } }) @@ -57,7 +68,7 @@ Template.profile.events({ var opened = Session.get("profradioDiv"); if(opened !== null && opened !== event.target.getAttribute("op")) { closeDivFade(document.getElementsByClassName("creInputSel")[opened].parentNode.childNodes[4]); - } + }d }, 'click .profInputSel' (event) { Session.set("profradioDiv", event.target.getAttribute("op"));