comment router, added teacher page

This commit is contained in:
Kenneth Jao 2015-01-11 15:02:46 -05:00
parent f0ffa72862
commit 99103a76d3
3 changed files with 34 additions and 16 deletions

View File

@ -27,9 +27,9 @@ Router.route('/admin', function() {
});
Router.route('/teacher', function() {
if (Roles.userIsInRole(Meteor.userId(), ['admin', 'teacher'])) {
// if (Roles.userIsInRole(Meteor.userId(), ['admin', 'teacher'])) {
this.render("teacher");
} else {
this.redirect('/login');
}
/* } else {
this.redirect('/login');
}*/
});

View File

@ -1,16 +1,15 @@
<template name="teacher">
<div id="center">
<ul class="nav nav-tabs">
<li><a href="#single" role="tab" data-toggle="tab">First</a></li>
<li><a href="#carts" role="tab" data-toggle="tab">Second</a></li>
</ul>
<div id="center">
{{#basicTabs tabs=tabs}}
<div id="sign-in" class="tab-pane">
{{> chromebooks }}
</div>d
<div id="carts" class="tab-pane">
{{> carts }}
<div>
{{> chromebook}}
</div>
</div>
<div>
<h2>Bye</h2>
</div>
{{/basicTabs}}
</div>
</template>

View File

@ -0,0 +1,19 @@
ReactiveTabs.createInterface({
template: 'basicTabs',
onChange: function (slug, template) {
// This callback runs every time a tab changes.
// The `template` instance is unique per {{#basicTabs}} block.
console.log('[tabs] Tab has changed! Current tab:', slug);
console.log('[tabs] Template instance calling onChange:', template);
}
});
Template.teacher.helpers({
tabs: function () {
// Every tab object MUST have a name and a slug!
return [
{ name: 'Single', slug: 'single' },
{ name: 'Carts', slug: 'carts' }
];
}
});