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() {
|
Router.route('/teacher', function() {
|
||||||
if (Roles.userIsInRole(Meteor.userId(), ['admin', 'teacher'])) {
|
// if (Roles.userIsInRole(Meteor.userId(), ['admin', 'teacher'])) {
|
||||||
this.render("teacher");
|
this.render("teacher");
|
||||||
} else {
|
/* } else {
|
||||||
this.redirect('/login');
|
this.redirect('/login');
|
||||||
}
|
}*/
|
||||||
});
|
});
|
||||||
@ -1,16 +1,15 @@
|
|||||||
<template name="teacher">
|
<template name="teacher">
|
||||||
<div id="center">
|
<div id="center">
|
||||||
<ul class="nav nav-tabs">
|
{{#basicTabs tabs=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="sign-in" class="tab-pane">
|
<div>
|
||||||
{{> chromebooks }}
|
{{> chromebook}}
|
||||||
</div>d
|
|
||||||
<div id="carts" class="tab-pane">
|
|
||||||
{{> carts }}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
<div>
|
||||||
|
<h2>Bye</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{/basicTabs}}
|
||||||
|
</div>
|
||||||
</template>
|
</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