classes on profile page
This commit is contained in:
parent
f1d7e180f0
commit
5b575922b3
@ -35,15 +35,15 @@
|
|||||||
<div id="profFunctions">
|
<div id="profFunctions">
|
||||||
<div class="profFunction manageClass">
|
<div class="profFunction manageClass">
|
||||||
<i class="fa fa-tasks" aria-hidden="true"></i>
|
<i class="fa fa-tasks" aria-hidden="true"></i>
|
||||||
<h4 style="color:{{profClassTab 'manClass'}}">Manage my Classes</h4>
|
<h4 style="color:{{profClassTabColor 'manClass'}}">Manage my Classes</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="profFunction addClass">
|
<div class="profFunction addClass">
|
||||||
<i class="fa fa-plus" aria-hidden="true"></i>
|
<i class="fa fa-plus" aria-hidden="true"></i>
|
||||||
<h4 style="color:{{profClassTab 'addClass'}}">Join a Class</h4>
|
<h4 style="color:{{profClassTabColor 'addClass'}}">Join a Class</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="profFunction createClass">
|
<div class="profFunction createClass">
|
||||||
<i class="fa fa-graduation-cap" aria-hidden="true"></i>
|
<i class="fa fa-graduation-cap" aria-hidden="true"></i>
|
||||||
<h4 style="color:{{profClassTab 'creClass'}}">Create a Class</h4>
|
<h4 style="color:{{profClassTabColor 'creClass'}}">Create a Class</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="profClassInfoHolder">
|
<div id="profClassInfoHolder">
|
||||||
@ -51,7 +51,7 @@
|
|||||||
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if profClassTab "addClass"}}
|
{{#if profClassTab "addClass"}}
|
||||||
<!-- put autocomplete stuff here -->
|
{{> inputAutocomplete settings=classsettings placeholder="Search..."}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if profClassTab "creClass"}}
|
{{#if profClassTab "creClass"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
@ -102,4 +102,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template name="classdisplay">
|
||||||
|
{{name}}
|
||||||
</template>
|
</template>
|
||||||
@ -6,6 +6,21 @@ Session.set("modifying",null);
|
|||||||
Session.set("radioDiv",null);
|
Session.set("radioDiv",null);
|
||||||
|
|
||||||
Template.profile.helpers({
|
Template.profile.helpers({
|
||||||
|
classsettings: function() {
|
||||||
|
return {
|
||||||
|
position: "bottom",
|
||||||
|
limit: 6,
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
token: '',
|
||||||
|
collection: classes,
|
||||||
|
field: "name",
|
||||||
|
template: Template.classdisplay,
|
||||||
|
// filter:
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
},
|
||||||
mainCenter() {
|
mainCenter() {
|
||||||
var width = window.innerWidth * 1600/1920 + 10;
|
var width = window.innerWidth * 1600/1920 + 10;
|
||||||
return "width:"+width.toString()+"px;margin-left:"+-.5*width.toString()+"px";
|
return "width:"+width.toString()+"px;margin-left:"+-.5*width.toString()+"px";
|
||||||
@ -51,9 +66,13 @@ Template.profile.helpers({
|
|||||||
classes() {
|
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) {
|
profClassTabColor(tab) {
|
||||||
Session.set("profClassTab",tab);
|
if(status === Session.get("profClassTab")) {
|
||||||
},
|
return themeColors[Cookie.get("theme")].highlightText;
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
},
|
||||||
profClassTab(tab) {
|
profClassTab(tab) {
|
||||||
if(tab === Session.get("profClassTab")) {
|
if(tab === Session.get("profClassTab")) {
|
||||||
return true;
|
return true;
|
||||||
@ -143,7 +162,35 @@ Template.profile.events({
|
|||||||
closeDivFade(p.parentNode);
|
closeDivFade(p.parentNode);
|
||||||
input.focus();
|
input.focus();
|
||||||
Session.set("radioDiv",null)
|
Session.set("radioDiv",null)
|
||||||
}
|
},
|
||||||
|
'click .addClass' () {
|
||||||
|
//var functionHolder = document.getElementById("functionHolder")
|
||||||
|
//closeDivFade(functionHolder);
|
||||||
|
//setTimeout(function() {
|
||||||
|
Session.set("function","addClass");
|
||||||
|
// openDivFade(functionHolder);
|
||||||
|
//},300);
|
||||||
|
},
|
||||||
|
'click .manageClass' () {
|
||||||
|
//var functionHolder = document.getElementById("functionHolder")
|
||||||
|
//closeDivFade(functionHolder);
|
||||||
|
//setTimeout(function() {
|
||||||
|
Session.set("function","manClass");
|
||||||
|
// openDivFade(functionHolder);
|
||||||
|
//},300);
|
||||||
|
},
|
||||||
|
'click .createClass' () {
|
||||||
|
//var functionHolder = document.getElementById("functionHolder")
|
||||||
|
//closeDivFade(functionHolder);
|
||||||
|
//setTimeout(function() {
|
||||||
|
Session.set("function","creClass");
|
||||||
|
// openDivFade(functionHolder);
|
||||||
|
//},300);
|
||||||
|
},
|
||||||
|
'click .profFunction' (event) {
|
||||||
|
var name = event.target.className.substring(13);
|
||||||
|
Session.set("profClassTab",name);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
function openDivFade(div) {
|
function openDivFade(div) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user