Commit 61d8535a authored by Daniel W Bond's avatar Daniel W Bond
Browse files

Merge branch 'master' of git.gmu.edu:srct/advisor

parents 9939d920 3bcee508
......@@ -38,9 +38,9 @@ Type the following commands in your terminal (if you're on Windows, [Cygwin](htt
``virtualenv ~/.virtualenvs/advisor``
``source ~/.virtualenvs/advisor/bin/activate``
``pip install -r requirements.txt``
``create the database``
``python manage.py syncdb`` (the username and password are just for your machine-- you can set it as merely "me" and "password" if you like)
create the database
``python manage.py schemamigration trajectories --initial``
``python manage.py syncdb`` (the username and password are just for your machine-- you can set it as merely "me" and "password" if you like)
``python manage.py runserver``
Next, open your web broswer of choice, and go to http//:127.0.0.1:8000/. You won't see too much. You'll need to add the courses and programs to the database.
......@@ -52,15 +52,27 @@ To-do
**First orders of business**
*Matters of Functionality*
* how do you make coreqs work? right now it assumes that a coreq has to come first, but that's obviously not how they work
* autocomplete js for the course name field (after a user puts in the department abbreviation and the course name
* scraping of catalog.gmu.edu for the database (this also means that with a single command everyone can be working on the same database :3)
* The student models needs to support the Django User Model
* there are going to be some issues if you can name a trajectory, but each sememester is actually a trajectory...
* Display when the student is going to graduate, and accept the semester number for trajectories
* Add support for APs, and fix the "login required" stuff
* Javascript to count the number of credits selected
*Forms and Views*
* some sort of javascript on the comparison page
* Forms on the index and create pages need to submit information
* Forms on index and create pages also need to expand to an additional fields; also needs to take into consideration the max available
* does the create page need to reload in between submissions? I don't really know how that works
* LDAP auth
* Testing testing testing.
* Forms on index and create pages also need to expand to an additional fields; also needs to take into consideration the max available, show alerts
* does the create page need to reload in between submissions? ajax or a new page? **different page for now, that might actually be "better"**
* LDAP auth/login
* comparison page needs some lovely analytics on the compared trajectories for the user
* polishing, like privacy policy
*Database and Webscraping*
* scraping the site to populate the database
* moving over to mysql
* scraping of catalog.gmu.edu for the database (this also means that with a single command everyone can be working on the same database :3)
* autocomplete js for the course name field (after a user puts in the department abbreviation and the course name (note unlike bookshare this information needn't be editable)
**Pipe Dreams**
......@@ -69,6 +81,7 @@ To-do
* Support departments to create sample trajectories for their students.
* Identifying if courses are available in the semester desired, and if so, getting professor information, CRNs, and what have you.
* An integrated "schedulizer"-type app for the classes that you've selected you want for that semester.
* Make sure that the loginrequired works as initially intended, that you only need to sign in in order to save or compare trajectories... this way prospective students can put their potential trajectories together
NOTE: A lot of musings about how the project will work are in a text file alongside the views and models. Please see if you can follow at all what I'm talking about.
......
......@@ -100,5 +100,40 @@ USE_L10N = True
USE_TZ = True
##### LDAP #####
import ldap
# Baseline configuration
# Keep ModelBackend around for per-user permissions and maybe a local
# superuser.
AUTHENTICATION_BACKENDS = (
'django_auth_ldap.backend.LDAPBackend',
'django.contrib.auth.backends.ModelBackend',
)
# GMU LDAP database. This is also accessible at newldap.gmu.edu
AUTH_LDAP_SERVER_URI = "ldaps://directory.gmu.edu:636"
AUTH_LDAP_BIND_DN = "ou=people,o=gmu.edu"
# Since we authenticate by logging into the LDAP server, you need to
# bind to the LDAP server as the authenticating user.
AUTH_LDAP_BIND_AS_AUTHENTICATING_USER = True
# This sticks the "user" plug into the hole in the DN string.
AUTH_LDAP_USER_DN_TEMPLATE = "uid=%(user)s,ou=people,o=gmu.edu"
# Basically this is required to ignore the self-signed GMU cert.
AUTH_LDAP_GLOBAL_OPTIONS = {
ldap.OPT_X_TLS : ldap.OPT_X_TLS_DEMAND,
ldap.OPT_X_TLS_REQUIRE_CERT : ldap.OPT_X_TLS_NEVER,
}
# Populate the Django User model from the LDAP directory.
AUTH_LDAP_USER_ATTR_MAP = {
"first_name": "givenName",
"last_name": "sn",
"email": "mail"
}
AUTH_LDAP_ALWAYS_UPDATE_USER = True
......@@ -19,6 +19,9 @@ urlpatterns = patterns('trajectories.views',
# homepage
url(r'^$', 'index', name = 'homepage'),
# log in
url(r'^login/$', 'login', name = 'login'),
# about page
url(r'^about/$', 'about', name = 'about'),
......@@ -28,12 +31,25 @@ urlpatterns = patterns('trajectories.views',
# student's page
url(r'^user/(?P<username>\w+)/$', 'student', name = 'student'),
# single trajectory page
url(r'^user/(?P<username>\w+)/(?P<trajectoryslug>\w+)$', 'trajectory', name = 'trajectory'),
# creating the trajectory
url(r'^user/(?Pusername>\w+)/create/(?P<trajectoryslug>\w+)/$', 'makeTrajectory', name = 'maketrajectory'),
# url(r'^user/(?P<username>\w+)/create/$', 'create', name = 'create'),
url(r'^create/$', 'create', name = 'create'),
# comparison page
url(r'^user/(?P<username>\w+)/compare/$', 'compare', name = 'compare'),
# url(r'^user/(?P<username>\w+)/compare/$', 'compare', name = 'compare'),
url(r'^compare/$', 'compare', name = 'compare'),
# admin pages
url(r'^admin/', include(admin.site.urls)),
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
)
urlpatterns += patterns('django.contrib.auth.views',
# auth pages
url(r'^login$', 'login', {'template_name': 'login.html'},
name='website_login'),
url(r'^logout$', 'logout', {'next_page': '/'}, name='website_logout'),
)
......@@ -12,10 +12,10 @@ body {
min-height: 100%;
height: auto;
/* Negative indent footer by its height */
margin: 0 auto -60px;
margin: 0 auto -25px;
/* Pad bottom by footer height */
padding: 0 0 60px;
padding-top: 60px;
padding: 0 0 25px;
padding-top: 25px;
}
/* Set the fixed height of the footer here */
......
<!DOCTYPE html>
<html>
<title>404</title>
<style>
body {
text-align: center;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
height: 100%;
}
.container {
margin: auto;
}
h1 {
font-family: "Helvetica Neue", "Helvetica", sans-serif;
margin-top: ;
}
#squirrels {
width: 100%;
}
#acorn {
width: 52px;
position: fixed;
bottom: 10px;
right: 10px;
}
</style>
</head>
<body>
<div class="container">
<h1>404 Error - Page Not Found</h1>
<img id="squirrels" src="/static/img/squirrels.png">
</div>
<a href="/"><img id="acorn" src="/static/img/acorn.png"></a>
</body>
</html>
......@@ -6,12 +6,31 @@ GMU Advisor | About
{% block content %}
<h2>Welcome to GMU Advisor</h2>
<div class="page-header" id="banner">
<div class="row">
<div class="col-md-12 text-center">
<h1>About Advisor</h1>
</div>
</div>
</div>
<p><h4>a project by GMU SRCT</h4></p>
<div class="row">
<div class="col-md-4">
<h2>What is Advisor?</h2>
<p>Advisor automates academic advising.* Build your trajectory to graduation, toy with new ideas, and compare your options.</p>
</div>
<p><h3>Advisor automates academic advising.* Build your trajectory to graduation, toy with new ideas, and compare your options.</h3></p>
<div class="col-md-4">
<h2>A Second Pressing Question</h2>
<p>A warm, supportive answer.</p>
</div>
<p<h6>*Not intended as a replacement for formal academic advising through your department. Currently only supports undergraduate programs.</h6></p>
<div class="col-md-4">
<h2>What is Mason SRCT?</h2>
<p>We rob banks.</p>
</div>
</div>
<p>*Not intended as a replacement for formal academic advising through your department. Currently only supports undergraduate programs.</p>
{% endblock %}
......@@ -6,54 +6,111 @@ GMU Advisor | Compare
{% block content %}
<h3>Compare up to three trajectories.</h4>
<form class="form-horizontal" role="form">
<div class="form-group">
<label for "myTrajectories" class="col-sm-2">My Trajectories</label>
<div class="col-sm-4">
<select class="form-control">
<option>My Trajectory 1</option>
<option>My Trajectory 2</option>
<option>My Trajectory 3</option>
<option>My Trajectory 4</option>
</select>
</div>
<div class="col-sm-1">
<button type="button" class="btn btn-primary">+</button>
</div>
<div class="page-header" id="banner">
<div class="row">
<div class="col-md-12 text-center">
<h2>Compare Trajectories</h2>
</div>
</div>
</div>
<div class="form-group">
<label for "myTrajectories" class="col-sm-2">Public Trajectories</label>
<div class="col-sm-4">
<input type"text" class="form-control" id="Trajectory" placeholder="dbond2">
<div class="row well">
<div class="col-md-12">
<legend>Choose up to three</legend>
<form class="form-vertical" action="" method="post" role="form" enctype="multipart/form-data">
<!-- learn what enctype does when you have internet -->
<div class="form-group">
<label for "myTrajectories" class="col-md-2">My Trajectories</label>
<div class="col-md-3">
<select class="form-control">
<option>My Trajectory 1</option>
<option>My Trajectory 2</option>
<option>My Trajectory 3</option>
<option>My Trajectory 4</option>
</select>
</div>
<div class="col-md-1">
<button type="button" class="btn btn-primary">+</button>
</div>
</div>
<div class="col-sm-1">
<button type="button" class="btn btn-primary">+</button>
<div class="form-group">
<label for "myTrajectories" class="col-md-2">Public Trajectories</label>
<div class="col-md-3">
<input type"text" class="form-control" id="Trajectory" placeholder="dbond2">
</div>
<div class="col-sm-1">
<button type="button" class="btn btn-primary">+</button>
</div>
</div>
<!-- spacing should be fixed -->
<br />
<br />
<div class="form-group">
<div class="col-md-offset-11 col-md-">
<button type="submit" class="btn btn-primary" value="Submit">Submit</button>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-5 col-sm-1">
<button type="submit" class="btn btn-primary" value="Submit">Submit</button>
</div>
</form>
</div>
</div>
<p> This is just what this lower part is going to look like-- it actually needs
to be loaded on submit with JavaScript ;_; </p>
<p> TopTrajectory stuff needed </p>
</form>
<!-- have an if statement that will have the courses in two columns if only
two are selected -->
<div class="row">
<div class="col-md-6">
</div>
<div class="col-md-6">
<div class="col-md-4 well">
<h3>Trajectory One's Name</h3>
<h4><p>Name(s) of the programs</p></h4>
{% for trajectory in previousTrajectories %}
<div class="col-md-4">
{% for course in trajectory %}
{% endfor %}
</div>
{% endfor %}
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="col-md-4 well">
<h3>Trajectory Two's Name</h3>
<h4><p>Name(s) of the programs</p></h4>
{% for trajectory in previousTrajectories %}
<div class="col-md-4">
{% for course in trajectory %}
<div class="col-md-4">
Information about the class
</div>
{% endfor %}
Information about the semester
</div>
{% endfor %}
</div>
<div class="col-md-4">
<div class="col-md-4 well">
<h3>Trajectory Three's Name</h3>
<h4><p>Name(s) of the programs</p></h4>
{% for trajectory in previousTrajectories %}
<div class="col-md-4">
{% for course in trajectory %}
{% endfor %}
</div>
{% endfor %}
</div>
<div class="col-md-4">
</div>
<div class="row well">
<div class="col-md-12">
<legend>Automatic comparisons of your selected trajectories.</legend>
</div>
</div>
......
{% extends 'layouts/base.html' %}
{% block title %}
GMU Advisor | Create
{% endblock %}
{% block content %}
<div class="page-header" id="banner">
<div class="row">
<div class="col-md-12 text-center">
<h2>Daniel's Trajectory for Computer Science, BS, and History, BA</h2>
<p class="lead">Semester Four</p>
<!-- Eventually need to give the graduation dates!
Can't believe I hadn't thought of that! -->
</div>
</div>
</div>
<div class="row well">
<div class="col-md-12">
<h4>See your previous semesters</h4>
<!-- accordian for previously semesters' trajectories -->
{% for trajectory in previousTrajectories %}
<div class="col-md-12">
{% for course in trajectory %}
<div class="col-md-4">
Your courses
</div>
{% endfor %}
</div>
{% endfor %}
</div>
</div>
<div class="row well">
<h4>
<div class="col-md-3">
<p>Semesters ahead</p>
</div>
<div class="col-md-3">
<p>Credits selected this semester</p>
</div>
<div class="col-md-3">
<p>Credits remaining for program</p>
</div>
</h4>
</div>
<div class="row well">
<div class="col-md-12">
<form class="form-horizontal" role="form">
These are the classes you'd be eligible to take this semester. Select the classes you want and hit Submit to continue.
<div id=section-collapse" class="collapse in">
<h4>Majors</h4>
<div class="form-group">
{% for program in programs %}
<div class="col-md-4">
</div>
{% endfor %}
</div>
</div>
<div id=section-collapse" class="collapse in">
<h4>Minors</h4>
<div class="form-group">
{% for minor in minors %}
<div class="col-md-4">
</div>
{% endfor %}
</div>
</div>
<div id=section-collapse" class="collapse in">
<h4>Gen Eds</h4>
<!-- automatically takes into account BA/BS issues-
has both- maybe popover? -->
<div class="form-group">
{% for genEdCollection in genEdCollections %}
<div class="col-md-12">
<!-- information about the gened then loads in an accordian -->
{% for courses in genEdCollection %}
<div class="col-md-4">
</div>
{% endfor %}
</div>
{% endfor %}
</div>
</div>
<!-- some javascript to count the number of credits selected-->
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
Selecting more than 18 credits will require approval of the Dean
</div>
<div class="alert alert-info alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
Full time is considered 12-15 credits.
</div>
<div class="form-group">
<div class="col-sm-offset-11 col-sm-1">
<button type="submit" class="btn btn-primary" value="Submit">Submit</button>
</div>
</form>
</div>
</div>
{% endblock %}
......@@ -6,75 +6,107 @@ GMU Advisor
{% block content %}
<h2>Welcome to GMU Advisor</h2>
<p><h4>a project of SRCT</h4></p>
<div class="page-header" id="banner">
<div class="row">
<div class="col-md-12 text-center">
<h1><strong>GMU</strong>&#8203;ADVISOR</h1>
<p class="lead">Automated Undergraduate Academic Advising*</p>
</div>
</div>
</div>
<p><h3>Advisor automates academic advising.* Build your trajectory to graduation, toy with new ideas, and compare your options. Select the classes you've already taken, and follow the instructions to start visualizing your way to the completion of your degree.</h3></p>
<p><h4>Select the classes you've already taken, and follow the instructions to start visualizing your way to completing your degree.</h4></p>
<p><h4>Sign in with your GMU student username and password at the top to save your progress or compare multiple trajectories.</h4><p>
<div class="row well">
<div class="col-md-12">
<form class="form-horizontal" action="" method="post" role="form" enctype="multipart/form-data">
{% csrf_token %}
<fieldset>
<!--change text if logged it: this is where "create a new trajectory" goes-->
<legend>Select your courses(s).</legend>
<div class="form-group">
<label for "departmentAbbr" class="col-sm-2">Department Abbreviation</label>
<div class="col-sm-1">
<input type="text" class="form-control" id="Program" placeholder="ENGH">
</div>
<label for "courseNumber" class="col-sm-1">Course Number</label>
<div class="col-sm-1">
<input type="text" class="form-control" id="Program" placeholder="302">
</div>
<!-- Name loads automatically -->
<label for "name" class="col-sm-1">Name</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="Program" placeholder="Advanced Composition">
</div>
<div class="col-sm-1">
<button type="button" class="btn btn-primary">+</button>
</div>
<!-- not sure how to have a zillion of these fields keep on appearing -->
</div>
<br />
<legend>Select your program(s).</legend>
<div class="form-group">
<label for "Program" class="col-sm-2">Program</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="Program" placeholder="Government and International Politics">
<!-- autocompletion would be awesome -->
</div>
<div class="col-sm-1">
<button type="button" class="btn btn-primary">+</button>
</div>
</div>
<form class="form-horizontal" role="form">
Select your courses(s).
<div class="form-group">
<label for "departmentAbbr" class="col-sm-2">Department Abbreviation</label>
<div class="col-sm-1">
<input type="text" class="form-control" id="Program" placeholder="ENGH">
<legend>Select your minor(s).</legend>
<div class="form-group">
<label for "Minor" class="col-sm-2">Minor</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="Minors" placeholder="Software Engineering">
</div>
<div class="col-sm-1">
<button type="button" class="btn btn-primary">+</button>
</div>
</div>
<label for "courseNumber" class="col-sm-1">Course Number</label>
<div class="col-sm-1">
<input type="text" class="form-control" id="Program" placeholder="302">
<!-- #cooljsideas for this and select program, have a new field slide out
when one has been entered (2 for degree, 3 for minor)-->
<legend>Are you in the Honors College?</legend>
<div class="form-group">
<label for "honorscollege" class="col-sm-2">Honors</label>
<div class="col-sm-5">
<button type="button" class="btn btn-default">Yes</button>
<button type="button" class="btn btn-primary">No</button>
</div>
</div>
<label for "name" class="col-sm-1">Name</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="Program" placeholder="Advanced Composition">
<legend>What is your current semester?</legend>
<div class="form-group">
<label for "degreeType" class="col-sm-2">Current Semester</label>
<div class="col-sm-3">
<select class="form-control">
<option>First Semester Freshman</option>
<option>Second Semester Freshman </option>
<option>First Semester Sophomore</option>
<option>Second Semester Sophomore</option>
<option>First Semester Junior</option>
<option>Second Semester Junior</option>
<option>First Semester Senior</option>
<option>Second Semester Senior</option>
<option>First Semester SuperSenior</option>
<option>Second Semester SuperSenior</option>
<option>First Semester SuperSuperSenior</option>
<!-- option You Mayyyyy Want to Consider Seeing an Actual Person /option -->
</select>
</div>
</div>
<div class="col-sm-1">
<button type="button" class="btn btn-primary">+</button>
</div>
<!-- not sure how to have a zillion of these fields keep on appearing -->
</div>
Select your program(s).
<div class="form-group">
<label for "Program" class="col-sm-2">Program</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="Program" placeholder="Government and International Politics">
<!-- autocompletion would be awesome -->
</div>
<div class="col-sm-1">
<button type="button" class="btn btn-primary">+</button>
</div>
</div>
Select your minor(s).
<div class="form-group">
<label for "Program" class="col-sm-2">