Added editing class tabs
This commit is contained in:
parent
dfdaadf68e
commit
1d1fe5319f
@ -32,8 +32,71 @@
|
||||
<div id="profClasses" class="card" style="background-color:{{divColor 'cards'}}">
|
||||
<h3 class="profHea">Classes</h3>
|
||||
<div id="classes">
|
||||
<!-- {{#each classes}}
|
||||
{{/each}} -->
|
||||
<div id="profFunctions">
|
||||
<div class="profFunction manageClass">
|
||||
<i class="fa fa-tasks" aria-hidden="true"></i>
|
||||
<h4 style="color:{{profClassTab 'manClass'}}">Manage my Classes</h4>
|
||||
</div>
|
||||
<div class="profFunction addClass">
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>
|
||||
<h4 style="color:{{profClassTab 'addClass'}}">Join a Class</h4>
|
||||
</div>
|
||||
<div class="profFunction createClass">
|
||||
<i class="fa fa-graduation-cap" aria-hidden="true"></i>
|
||||
<h4 style="color:{{profClassTab 'creClass'}}">Create a Class</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div id="profClassInfoHolder">
|
||||
{{#if profClassTab "manClass"}}
|
||||
|
||||
{{/if}}
|
||||
{{#if profClassTab "addClass"}}
|
||||
<!-- put autocomplete stuff here -->
|
||||
{{/if}}
|
||||
{{#if profClassTab "creClass"}}
|
||||
{{/if}}
|
||||
<!-- {{#if currFunction "addClass"}}
|
||||
<p>Add a Class</p>
|
||||
{{/if}}
|
||||
|
||||
{{#if currFunction "manClass"}}
|
||||
<p>Manage Classes</p>
|
||||
{{/if}}
|
||||
|
||||
{{#if currFunction "creClass"}}
|
||||
<h2>Create a Class</h2>
|
||||
<form id="create">
|
||||
<p class="input">School:</p><br>
|
||||
{{> inputAutocomplete settings=schoolcomplete class="form-control creInput" type="text" name="school" placeholder="Example: International Academy" }}
|
||||
<p class="input">Hour:</p><br>
|
||||
<input class="creInput" type="text" name="hour"><br>
|
||||
<p class="input">Teacher:</p><br>
|
||||
{{> inputAutocomplete settings=teachercomplete class="form-control creInput" type="text" name="teacher" placeholder="Example: Woods" }}
|
||||
<p class="input">Class Name:</p><br>
|
||||
<input class="creInput" type="text" name="classname"><br>
|
||||
<p class="input">Privacy:</p><br>
|
||||
<div class="select">
|
||||
<input class="creInputSel creInput" type="text" name="privacy" op="0" readonly><br>
|
||||
<div class="creOptions" style="background-color:{{divColor 'header'}}">
|
||||
<p>Public</p>
|
||||
<p>Private</p>
|
||||
</div>
|
||||
</div>
|
||||
<p class="input">Category:</p><br>
|
||||
<div class="select">
|
||||
<input class="creInputSel creInput" type="text" name="category" op="1" readonly><br>
|
||||
<div class="creOptions" style="background-color:{{divColor 'header'}}">
|
||||
<p>Class</p>
|
||||
<p>Club</p>
|
||||
<p>Other</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="creSubmit">Submit Request</div>
|
||||
</form>
|
||||
{{/if}}
|
||||
{{#each classes}}
|
||||
{{/each}} -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -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"));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user