admin panel tabs

This commit is contained in:
Kenneth Jao 2015-01-11 19:29:30 -05:00
parent 0d91daa858
commit e695175b75
4 changed files with 32 additions and 5 deletions

View File

@ -1,5 +1,6 @@
.admintitle { .admintitle {
text-align: center; text-align: center;
margin-top: 0;
} }
.content { .content {
@ -7,7 +8,7 @@
border-radius:15px; border-radius:15px;
margin-left:auto; margin-left:auto;
margin-right:auto; margin-right:auto;
margin-top:13%; margin-top:5%;
margin-bottom:0; margin-bottom:0;
height:auto; height:auto;
max-width:60%; max-width:60%;

View File

@ -1,7 +1,11 @@
<template name="admin"> <template name="admin">
<div id="center"> <div id="center">
<div class="content">
<h5 class="admintitle">Admin Panel</h5> <h5 class="admintitle">Admin Panel</h5>
<div class="content">
{{#teacherTabs tabs=tabs}}
<!-- Single -->
<div>
<div class="Adding"> <div class="Adding">
<h6>Add a Chromebook</h6> <h6>Add a Chromebook</h6>
<form class="new-task"> <form class="new-task">
@ -20,6 +24,12 @@
</div> </div>
{{/each}} {{/each}}
</div> </div>
</div>
<!-- Carts -->
<div>
</div>
{{/teacherTabs}}
</div> </div>
</div> </div>
</template> </template>

View File

@ -4,6 +4,22 @@ Template.admin.helpers({
} }
}); });
ReactiveTabs.createInterface({
template: 'teacherTabs',
onChange: function (slug, template) {
}
});
Template.admin.helpers({
tabs: function () {
// Every tab object MUST have a name and a slug!
return [
{ name: 'Single', slug: 'single' },
{ name: 'Carts', slug: 'carts' }
];
}
});
Template.admin.events({ Template.admin.events({
"submit .add, click .add": function (event) { "submit .add, click .add": function (event) {
event.preventDefault(); event.preventDefault();

View File

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