Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f4a7485
Modified several files across the program
mrosario123 Sep 21, 2021
005bcbc
Merge branch 'master' into MatthewFirstEdit
mrosario123 Sep 22, 2021
4358ab0
Comments added to help for future help
mrosario123 Sep 22, 2021
f8daaad
Added phone
mrosario123 Sep 22, 2021
8734312
Commented out applicationstatus
mrosario123 Sep 22, 2021
d4f0d27
Added phone
mrosario123 Sep 22, 2021
c1e6d5c
Changed multiple things
mrosario123 Sep 22, 2021
c020fab
Added phone for user to update
mrosario123 Sep 22, 2021
b151861
Changed the deadline
mrosario123 Sep 22, 2021
4218ab0
Added placeholders in textboxes
mrosario123 Sep 22, 2021
32fa8c1
Added placeholders in textboxes
mrosario123 Sep 22, 2021
2ff6fd6
Changed regex quantifiers on phone number
mrosario123 Sep 22, 2021
7ecae1c
Removed the email column
mrosario123 Sep 22, 2021
efdc0d4
Applied & Reviewed fixes
mrosario123 Sep 23, 2021
ef6abab
Added photo
mrosario123 Sep 23, 2021
6a1bb76
Added submitted value
mrosario123 Oct 3, 2021
b7c8b76
Added a supportpage, sorted table function, etc.
mrosario123 Oct 20, 2021
9be14f6
Added documents and several other changes
mrosario123 Nov 9, 2021
9e9beee
Synced edit profile number with applicant number
mrosario123 Nov 17, 2021
38084cd
Bio applicant's phone numbers are synced
mrosario123 Nov 17, 2021
4bf316d
Cleaned up the interface
mrosario123 Nov 17, 2021
8404c92
Test
mrosario123 Nov 17, 2021
59672a5
Added Agreement with signatures
mrosario123 Nov 17, 2021
0a2c893
Fixed an error with phone sync across site
mrosario123 Nov 19, 2021
f7804c1
Fixed the filter issue in sites page
mrosario123 Nov 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 34 additions & 16 deletions app/controllers/applications.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ function filterApplications(req, res, cb) {
ID: bioApp.userstudentid,
FirstName: bioApp.userfname,
LastName: bioApp.userlname,
PhoneNumber: bioApp.phonenumber,
'BIO GPA': bioApp.programgpa,
Concentration: bioApp.major,
'Expected Graduation': bioApp.expectedGraduationSemester + ' ' + bioApp.expectedGraduationYear,
Expand All @@ -144,7 +145,7 @@ function filterApplications(req, res, cb) {
appArray.push(bioJson);
});

fields = ['ID', 'FirstName', 'LastName', 'BIO GPA', 'Concentration',
fields = ['ID', 'FirstName', 'LastName', 'PhoneNumber', 'BIO GPA', 'Concentration',
'Expected Graduation', 'Semester', 'Year'];

cb(null, {
Expand All @@ -170,6 +171,7 @@ function filterApplications(req, res, cb) {
ID: itecApp.userstudentid,
FirstName: itecApp.userfname,
LastName: itecApp.userlname,
PhoneNumber: itecApp.phonenumber,
'ITEC GPA': itecApp.itecgpa,
Concentration: itecApp.major,
'Expected Graduation': itecApp.expectedGraduationSemester + ' ' + itecApp.expectedGraduationYear,
Expand All @@ -180,7 +182,7 @@ function filterApplications(req, res, cb) {
appArray.push(itecJson);
});

fields = ['ID', 'FirstName', 'LastName', 'ITEC GPA', 'Concentration',
fields = ['ID', 'FirstName', 'LastName', 'PhoneNumber', 'ITEC GPA', 'Concentration',
'Expected Graduation', 'Programming', 'Semester', 'Year'];

cb(null, {
Expand Down Expand Up @@ -223,6 +225,7 @@ module.exports.filterApplications = function (req, res) {
}
}


function write(fileName, csv, req, res) {
fs.writeFile(fileName, csv, function (err) {
if (err) {
Expand All @@ -234,6 +237,7 @@ function write(fileName, csv, req, res) {
}
});
}
//passes in comma seperated file

function download(csvPath, req, res) {
res.download(csvPath, function (err) {
Expand Down Expand Up @@ -269,13 +273,19 @@ module.exports.getSpecificBioApplication = function (req, res) {
if (err) throw err;
Document.getBioDocumentsForUser(bioApp.useremail, function (incomingDocuments) {
documents = incomingDocuments;
res.render('applicationdetails.ejs', {
application: bioApp,
documents: documents,
user: req.user,
successMessage: req.flash('success'),
failureMessage: req.flash('failure')
});
User.findOne({_id: req.user._id}, function(err, user) {
if (err) {
throw err;
}
res.render('applicationdetails.ejs', {
application: bioApp,
documents: documents,
user: user,
// userPhoneNumber: user.local.phone,
successMessage: req.flash('success'),
failureMessage: req.flash('failure')
});
})
});
});
};
Expand All @@ -293,13 +303,19 @@ module.exports.getSpecificItecApplication = function (req, res) {
if (err) throw err;
Document.getItecDocumentsForUser(itecApp.useremail, function (incomingDocuments) {
documents = incomingDocuments;
res.render('applicationdetails.ejs', {
application: itecApp,
documents: documents,
user: req.user,
successMessage: req.flash('success'),
failureMessage: req.flash('failure')
});
User.findOne({_id: req.user._id}, function(err, user) {
if (err) {
throw err;
}
res.render('applicationdetails.ejs', {
application: itecApp,
documents: documents,
user: user,
// userPhoneNumber: user.local.phone,
successMessage: req.flash('success'),
failureMessage: req.flash('failure')
});
})
});
});
}
Expand Down Expand Up @@ -686,6 +702,7 @@ module.exports.postItecApplication = function (req, res) {
itecapp.userstudentid = req.user.studentid;
itecapp.userfname = req.user.fname;
itecapp.userlname = req.user.lname;
itecapp.userphone = req.user.phone;
itecapp.useraddress = req.user.address;
itecapp.usercity = req.user.city;
itecapp.userstate = req.user.state;
Expand Down Expand Up @@ -718,6 +735,7 @@ module.exports.postBioApplication = function (req, res) {
bioapp.userstudentid = req.user.studentid;
bioapp.userfname = req.user.fname;
bioapp.userlname = req.user.lname;
bioapp.userphone = req.user.phone;
bioapp.useraddress = req.user.address;
bioapp.usercity = req.user.city;
bioapp.userstate = req.user.state;
Expand Down
41 changes: 28 additions & 13 deletions app/controllers/editApplications.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,53 @@
- Logic for routes: getEditBio, getEditItec, updateBioApp, updateItecApp
- Loads the user's submitted bio/itec application and then updates
*/

var User = require('../models/user');
var Bio = require('../models/bio');
var Itec = require('../models/itec');

module.exports.getEditBio = function(req, res) {
Bio.getUsersBioApp(req.user.email, function(foundBioApp) {
res.render('editbio', {
application: foundBioApp,
user : req.user,
successMessage: req.flash('success'),
failureMessage: req.flash('failure')
});
User.findOne({_id: req.user._id}, function(err, user) {
res.render('editbio', {
application: foundBioApp,
user : user,
successMessage: req.flash('success'),
failureMessage: req.flash('failure')
});
})
});
}

module.exports.getEditItec = function(req, res) {
Itec.getUsersItecApp(req.user.email, function(foundItecApp) {
res.render('editItec', {
application: foundItecApp,
user : req.user,
successMessage: req.flash('success'),
failureMessage: req.flash('failure')
});
User.findOne({_id: req.user._id}, function(err, user) {
res.render('editItec', {
application: foundItecApp,
user : user,
successMessage: req.flash('success'),
failureMessage: req.flash('failure')
});
})
});
}


module.exports.updateAppStatusItec = function (req, res){
newItecapp.applicationstatus = oldItecApp.applicationstatusItec;
}

module.exports.updateAppStatusBio = function (req, res){
newBioapp.applicationstatus = oldBioApp.applicationstatusBio;
}

module.exports.updateBioApp = function(req, res) {

var newBioapp = new Bio(req.body);
newBioapp.useremail = req.user.email;
newBioapp.userstudentid = req.user.studentid;
newBioapp.userfname = req.user.fname;
newBioapp.userlname = req.user.lname;
newBioapp.userphone = req.user.phone;
newBioapp.useraddress = req.user.address;
newBioapp.usercity = req.user.city;
newBioapp.userstate = req.user.state;
Expand Down Expand Up @@ -68,6 +82,7 @@ module.exports.updateItecApp = function(req, res) {
newItecapp.userstudentid = req.user.studentid;
newItecapp.userfname = req.user.fname;
newItecapp.userlname = req.user.lname;
newItecapp.userphone = req.user.phone;
newItecapp.useraddress = req.user.address;
newItecapp.usercity = req.user.city;
newItecapp.userstate = req.user.state;
Expand Down
4 changes: 3 additions & 1 deletion app/controllers/editprofile.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module.exports.getEditProfile = function(req, res) {
HTTP Req: POST
URL: '/editprofile'
*/

module.exports.updateProfile = function(req, res) {
User.update({'local.email' : req.user.email}, {
'local.studentid' : req.body.studentid,
Expand All @@ -38,7 +39,8 @@ module.exports.updateProfile = function(req, res) {
'local.city' : req.body.city,
'local.state' : req.body.state,
'local.zipcode' : req.body.zipcode,
'local.discipline' : req.body.discipline
'local.discipline' : req.body.discipline,
'local.phone' : req.body.phone
}, function(err) {
if (err) {
res.flash('failure', 'An error has occured, your profile could not be updated.');
Expand Down
8 changes: 6 additions & 2 deletions app/controllers/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ module.exports.exportExport = function (req, res) {
ID: bioApp.userstudentid,
FirstName: bioApp.userfname,
LastName: bioApp.userlname,
PhoneNumber: bioApp.userphone,
'BIO GPA': bioApp.programgpa,
Concentration: bioApp.major,
'Expected Graduation': bioApp.expectedGraduationSemester + ' ' + bioApp.expectedGraduationYear,
Expand All @@ -133,7 +134,7 @@ module.exports.exportExport = function (req, res) {
appArray.push(bioJson);
});

fields = ['ID', 'FirstName', 'LastName', 'BIO GPA', 'Concentration',
fields = ['ID', 'FirstName', 'LastName', 'PhoneNumber', 'BIO GPA', 'Concentration',
'Expected Graduation', 'Semester', 'Year'];

var csv = json2csv({ data: appArray, fields: fields });
Expand All @@ -155,6 +156,7 @@ module.exports.exportExport = function (req, res) {
ID: itecApp.userstudentid,
FirstName: itecApp.userfname,
LastName: itecApp.userlname,
PhoneNumber: itecApp.userphone,
'ITEC GPA': itecApp.itecgpa,
Concentration: itecApp.major,
'Expected Graduation': itecApp.expectedGraduationSemester + ' ' + itecApp.expectedGraduationYear,
Expand All @@ -165,7 +167,7 @@ module.exports.exportExport = function (req, res) {
appArray.push(itecJson);
});

fields = ['ID', 'FirstName', 'LastName', 'ITEC GPA', 'Concentration',
fields = ['ID', 'FirstName', 'LastName', 'PhoneNumber', 'ITEC GPA', 'Concentration',
'Expected Graduation', 'Programming', 'Semester', 'Year'];

var csv = json2csv({ data: appArray, fields: fields });
Expand Down Expand Up @@ -531,6 +533,7 @@ module.exports.postItecApplication = function (req, res) {
itecapp.userstudentid = req.user.studentid;
itecapp.userfname = req.user.fname;
itecapp.userlname = req.user.lname;
itecapp.userphone = req.user.phone;
itecapp.useraddress = req.user.address;
itecapp.usercity = req.user.city;
itecapp.userstate = req.user.state;
Expand Down Expand Up @@ -563,6 +566,7 @@ module.exports.postBioApplication = function (req, res) {
bioapp.userstudentid = req.user.studentid;
bioapp.userfname = req.user.fname;
bioapp.userlname = req.user.lname;
bioapp.userphone = req.user.phone;
bioapp.useraddress = req.user.address;
bioapp.usercity = req.user.city;
bioapp.userstate = req.user.state;
Expand Down
18 changes: 18 additions & 0 deletions app/controllers/support.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
Controller functions containing the logic for the support routes
Authors : Matthew Rosario
*/

/*
HTTP Req: GET
URL: '/support'
*/
module.exports.getSupport = function(req, res) {
if (req.isAuthenticated()) {
res.render('support.ejs', {
user: req.user
});
} else {
res.render('support.ejs');
}
};
6 changes: 5 additions & 1 deletion app/models/bio.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var bioSchema = mongoose.Schema({
},
phonenumber: {
type: String,
required: false
required: true
},
emergencycontactname: {
type: String,
Expand Down Expand Up @@ -213,6 +213,10 @@ var bioSchema = mongoose.Schema({
type: String,
required: false
},
userphone: {
type: String,
required: false
},
useraddress: {
type: String,
required: false
Expand Down
1 change: 1 addition & 0 deletions app/models/document.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var mongoose = require('mongoose');


var documentSchema = mongoose.Schema({
user: {
user_id : {
Expand Down
6 changes: 5 additions & 1 deletion app/models/itec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var itecSchema = mongoose.Schema({
},
phonenumber: {
type: String,
required: false
required: true
},
classification: {
type: String,
Expand Down Expand Up @@ -175,6 +175,10 @@ var itecSchema = mongoose.Schema({
type: String,
required: false
},
userphone: {
type: String,
required: false
},
useraddress: {
type: String,
required: false
Expand Down
4 changes: 4 additions & 0 deletions app/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ var userSchema = mongoose.Schema({
type: String,
required: true
},
phone: {
type: String,
required: true
},
address: {
type: String,
required: true
Expand Down
11 changes: 8 additions & 3 deletions app/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ var ctrlMongoToCsv = require('../controllers/mongoToCsv');
var ctrlUpload = require('../controllers/documentUpload');
var ctrlDelete = require('../controllers/documentDelete');
var ctrlSiteNotes = require('../controllers/sitenotes');
var ctrlSupport = require('../controllers/support');




Expand Down Expand Up @@ -187,10 +189,10 @@ module.exports = function (app, passport) {
app.get('/site/contacts/:siteid/:documentid', isLoggedIn, isAdminOrInstructor, ctrlSites.deleteSiteContact);
app.get('/site/edit/:siteid', isLoggedIn, isAdminOrInstructor, ctrlSites.getSiteToEdit);
app.get('/site/:siteid', isLoggedIn, isAdminOrInstructor, ctrlSites.getSiteDetails);
app.post('/addSite', isLoggedIn, isAdmin, ctrlSites.postAddSite);
app.post('/addSite', isLoggedIn, isAdminOrInstructor, ctrlSites.postAddSite);
app.post('/site/:siteid', isLoggedIn, isAdminOrInstructor, ctrlSites.addSiteContact);
app.post('/site/edit/:siteid', isLoggedIn, isAdmin, ctrlSites.updateSite);
app.post('/site/delete/:siteid', isLoggedIn, isAdmin, ctrlSites.deleteSite);
app.post('/site/edit/:siteid', isLoggedIn, isAdminOrInstructor, ctrlSites.updateSite);
app.post('/site/delete/:siteid', isLoggedIn, isAdminOrInstructor, ctrlSites.deleteSite);
app.get('/site/:siteId/export/contacts', makeCSVDirectory, isLoggedIn, isAdminOrInstructor, ctrlSites.exportContacts);

/* Promote page */
Expand All @@ -204,6 +206,9 @@ module.exports = function (app, passport) {
/* FAQ page */
app.get('/faq', ctrlFAQ.getFAQ);

/* Support Page */
app.get('/support', ctrlSupport.getSupport);

/* Help page */
app.get('/help', ctrlHelp.getHelp);
app.get('/admininstructorhelp', ctrlHelp.getAdminInstructorHelp);
Expand Down
2 changes: 2 additions & 0 deletions config/passport.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var User = require('../app/models/user');
studentid: user.local.studentid,
fname: user.local.fname,
lname: user.local.lname,
phone: user.local.phone,
address: user.local.address,
city: user.local.city,
state: user.local.state,
Expand Down Expand Up @@ -83,6 +84,7 @@ var User = require('../app/models/user');
newUser.local.studentid = req.body.studentid;
newUser.local.fname = req.body.fname;
newUser.local.lname = req.body.lname;
newUser.local.phone = req.body.phone;
newUser.local.address = req.body.address;
newUser.local.city = req.body.city;
newUser.local.state = req.body.state;
Expand Down
2 changes: 1 addition & 1 deletion development/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ body {
.scrollable {
overflow-y: scroll;
height: 100px;
resize: none; /* Remove this if you want the user to resize the textarea */
resize: none; /*Remove this if you want the user to resize the textarea */
}

.otherLabel {
Expand Down
Binary file modified documentation/fall2021/Client_Requirements.docx
Binary file not shown.
Binary file not shown.
Binary file added documentation/fall2021/~$ient_Requirements.docx
Binary file not shown.
Loading