Unverified Commit 22a7ef83 authored by Mark Stenglein's avatar Mark Stenglein
Browse files

The front end is using the API now

- The school field is populated via api.
- TODO: make the semester selection work
- TODO: make the table populate properly
parent b90d2d89
......@@ -10,6 +10,10 @@ config.mongoDBURL = 'mongodb://localhost/schedules';
config.ReloadDB = false;
config.schoolSlugs = {
'schools': [
'GMU',
'VT'
],
'GMU': {
'longName': 'George Mason University',
'semesters': [
......
var slugs;
$(document).ready(function() {
$('#classSearch').DataTable();
$('#selectSchool').selectpicker({
style: 'btn-info',
size: 5
});
$('#selectSemester').selectpicker({
style: 'btn-info',
size: 5
var schoolSelect = document.getElementById('selectSchool');
$.getJSON('/api/v1/json/schools', function(schoolSlugs) {
var slugs = schoolSlugs;
for (i = 0; i < schoolSlugs.schools.length; i++) {
schoolName = schoolSlugs[schoolSlugs.schools[i]];
schoolSelect.add(new Option(schoolName.longName, i + 1));
}
});
} );
......@@ -31,8 +31,6 @@ block content
label.col-md-4.control-label(for='selectSchool') Select a School
div.col-md-6
select#selectSchool.form-control(name="selectSchool" class="form-control")
option(value="1") George Mason University
option(value="2") Virginia Tech
// Select Basic
div.form-group
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment