Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mattias J Duffy
schedules
Commits
91c35e8f
Unverified
Commit
91c35e8f
authored
Jul 26, 2016
by
Mark Stenglein
Browse files
Added better form to the front page
parent
a7e0812e
Changes
4
Hide whitespace changes
Inline
Side-by-side
schedules/public/javascripts/mainApp.js
View file @
91c35e8f
$
(
document
).
ready
(
function
()
{
$
(
'
#classSearch
'
).
DataTable
();
$
(
'
#selectSchool
'
).
selectpicker
({
style
:
'
btn-info
'
,
size
:
5
});
$
(
'
#selectSemester
'
).
selectpicker
({
style
:
'
btn-info
'
,
size
:
5
});
}
);
schedules/routes/index.js
View file @
91c35e8f
...
...
@@ -6,12 +6,13 @@ var Semester = require('../models/Semester');
// Load site wide configurations
var
config
=
require
(
'
../config
'
);
router
.
get
(
'
/docs
'
,
function
(
req
,
res
,
next
)
{
res
.
render
(
'
docs
'
,
{
config
});
})
router
.
get
(
'
/api/json/classes/:SEMSLUG/:CRNS
'
,
function
(
req
,
res
,
next
)
{
var
slug
=
req
.
params
[
'
SEMSLUG
'
];
var
crns
=
req
.
params
[
'
CRNS
'
].
split
(
'
,
'
);
});
// GET ical file
var
jsonSlugCache
=
{
slugs
:
[]
};
// GET entire semester
router
.
get
(
'
/api/json/classes/:SEMSLUG
'
,
function
(
req
,
res
,
next
)
{
var
slug
=
req
.
params
[
'
SEMSLUG
'
];
if
(
jsonSlugCache
[
slug
])
...
...
@@ -27,7 +28,7 @@ router.get('/api/json/classes/:SEMSLUG', function(req, res, next) {
query
.
lean
().
exec
(
function
(
err
,
semester
)
{
if
(
err
||
(
!
semester
))
{
res
.
json
({
'
results
'
:
'
error, try something different
'
'
error
'
:
'
semester not found
'
})
}
else
{
res
.
json
(
semester
);}
...
...
@@ -35,7 +36,11 @@ router.get('/api/json/classes/:SEMSLUG', function(req, res, next) {
}
});
// TODO: Actually learn how to make this function set be passed around properly
// END API SECTION
router
.
get
(
'
/docs
'
,
function
(
req
,
res
,
next
)
{
res
.
render
(
'
docs
'
,
{
config
});
})
/* GET home page. */
router
.
get
(
'
/
'
,
function
(
req
,
res
,
next
)
{
...
...
schedules/views/head.jade
View file @
91c35e8f
...
...
@@ -13,6 +13,6 @@ head
// Datatables
link(rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs/dt-1.10.12/datatables.min.css")
script(type="text/javascript" src="https://cdn.datatables.net/v/bs/dt-1.10.12/datatables.min.js")
// Favicon
link(rel='shortcut icon', href='/favicon.ico?', type='image/x-icon')
schedules/views/index.jade
View file @
91c35e8f
...
...
@@ -19,10 +19,37 @@ block content
div.col-md-2
div.col-md-8
br
div.input-group
span.input-group-btn
button.btn.btn-info(type="button") Import CRN's
input.form-control(type="text" placeholder="Enter CRN's separated by commas...")
form.form-horizontal
fieldset
// Form Name
legend Enter Your Schedule's Details Here
// Select Basic
div.form-group
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
label.col-md-4.control-label(for="selectSemester") Select a Semester
div.col-md-6
select#selectSemester.form-control(name="selectSemester")
option(value="1") Option one
option(value="2") Option two
// Text input
div.form-group
label.col-md-4.control-label(for="crnInput") Enter Courses
div.col-md-6
input#crnInput.form-control.input-md(name="crnInput" placeholder="Enter CRN's" type="text")
span.help-block Enter course numbers separated by commas to batch import your classes.
// br
// div.input-group
// span.input-group-btn
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment