diff --git a/hourglass/client/main/main.html b/hourglass/client/main/main.html
index 9bc809a..a9a079b 100644
--- a/hourglass/client/main/main.html
+++ b/hourglass/client/main/main.html
@@ -58,7 +58,7 @@
Hour:
Teacher:
-
+ {{> inputAutocomplete settings=teachercomplete class="form-control creInput" type="text" name="teacher" placeholder="Example: Woods" }}
Class Name:
Privacy:
@@ -98,4 +98,8 @@
{{name}}
+
+
+
+ {{teacher}}
\ No newline at end of file
diff --git a/hourglass/client/main/main.js b/hourglass/client/main/main.js
index 0539820..57e2276 100644
--- a/hourglass/client/main/main.js
+++ b/hourglass/client/main/main.js
@@ -115,6 +115,20 @@ Template.main.helpers({
}
]
};
+ },
+ teachercomplete() {
+ return {
+ position: "bottom",
+ limit: 1,
+ rules: [
+ {
+ token: '',
+ collection: classes,
+ field: 'teacher',
+ template: Template.teacherlist
+ }
+ ]
+ };
}
});
diff --git a/hourglass/server/main.js b/hourglass/server/main.js
index 9c0209e..1905c71 100644
--- a/hourglass/server/main.js
+++ b/hourglass/server/main.js
@@ -12,11 +12,6 @@ Meteor.methods({
},
//No Security
'createClass': function(input) {
- var distinctEntries = _.uniq(classes.find({}, {
- sort: {teacher: 1}, fields: {teacher: true}
- }).fetch().map(function(x) {
- return x.teacher;
- }), true);
classes.schema.validate(input);
if(Meteor.user() != null && classes.find({status:false, admin:Meteor.userId()}).fetch().length < 5 &&
schools.find({name:input.school}).fetch().length > 0 && input.status === false) {