comment router, added teacher page
This commit is contained in:
parent
f0ffa72862
commit
99103a76d3
@ -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');
|
||||
}*/
|
||||
});
|
||||
@ -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>
|
||||
19
chromebook-checkout-meteor/client/teacher.js
Normal file
19
chromebook-checkout-meteor/client/teacher.js
Normal 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' }
|
||||
];
|
||||
}
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user