add status, turn hours into integer, create a directory view of all nonprofits

This commit is contained in:
Michael Q Larson
2015-04-08 14:36:05 -07:00
parent 61e07041a7
commit c02fafa6a9
6 changed files with 60 additions and 19 deletions

6
app.js
View File

@ -329,11 +329,9 @@ app.post('/email-signin', userController.postSignin);
* Nonprofit Project routes. * Nonprofit Project routes.
*/ */
//app.get('/nonprofits', contactController.getNonprofitsForm); app.get('/nonprofits', nonprofitController.nonprofitsHome);
//
//app.post('/nonprofits', contactController.postNonprofitsForm);
app.get('/nonprofits/home', nonprofitController.nonprofitsHome); app.get('/nonprofits/directory', nonprofitController.nonprofitsDirectory);
app.get('/nonprofits/are-you-with-a-registered-nonprofit', nonprofitController.areYouWithARegisteredNonprofit); app.get('/nonprofits/are-you-with-a-registered-nonprofit', nonprofitController.areYouWithARegisteredNonprofit);

View File

@ -12,6 +12,18 @@ exports.nonprofitsHome = function(req, res) {
}); });
}; };
exports.nonprofitsDirectory = function(req, res) {
Nonprofit.find({estimatedHours: { $gt: 0 } }, function(err, nonprofits) {
if (err) {
next(err);
}
res.render('nonprofits/directory', {
title: 'Nonprofits we help',
nonprofits: nonprofits
});
});
};
exports.areYouWithARegisteredNonprofit = function(req, res) { exports.areYouWithARegisteredNonprofit = function(req, res) {
res.render('nonprofits/are-you-with-a-registered-nonprofit', { res.render('nonprofits/are-you-with-a-registered-nonprofit', {
title: 'Are you with a with a registered nonprofit', title: 'Are you with a with a registered nonprofit',
@ -64,7 +76,7 @@ exports.linkUsToYourWebsite = function(req, res) {
exports.tellUsYourEmail = function(req, res) { exports.tellUsYourEmail = function(req, res) {
res.render('nonprofits/tell-us-your-email', { res.render('nonprofits/tell-us-your-email', {
title: 'Tell us your name', title: 'Tell us your email',
step: 8 step: 8
}); });
}; };
@ -77,7 +89,10 @@ exports.tellUsYourName = function(req, res) {
}; };
exports.finishApplication = function(req, res) { exports.finishApplication = function(req, res) {
res.render('nonprofits/you-have-finished-your-application', {
title: "You have finished your application",
step: 10
});
}; };
exports.yourNonprofitProjectApplicationHasBeenSubmitted = function(req, res) { exports.yourNonprofitProjectApplicationHasBeenSubmitted = function(req, res) {

View File

@ -19,9 +19,10 @@ var nonprofitSchema = new mongoose.Schema({
projectDescription: String, projectDescription: String,
logoUrl: String, logoUrl: String,
imageUrl: String, imageUrl: String,
estimatedHours: String, estimatedHours: 0,
interestedCampers: [], interestedCampers: [],
confirmedCampers: [] confirmedCampers: [],
status: "evaluating" //"evaluating", "confirmed", "started", "completed", "aborted"
}); });
module.exports = mongoose.model('Nonprofit', nonprofitSchema); module.exports = mongoose.model('Nonprofit', nonprofitSchema);

View File

@ -24,7 +24,8 @@
"projectDescription": "Campers will create a system will integrate the food inventory, donor and delivery driver management systems as well as replace the current application system with a custom form solution. System will include a more streamlined operations management, with user printable lists of inventory, drivers, and deliveries.", "projectDescription": "Campers will create a system will integrate the food inventory, donor and delivery driver management systems as well as replace the current application system with a custom form solution. System will include a more streamlined operations management, with user printable lists of inventory, drivers, and deliveries.",
"logoUrl": "https://trello-attachments.s3.amazonaws.com/54c7e02f2c173c37015b2f36/604x309/00580a0567a4b3afda29d52b09e7e829/rQQ6zwq31Uya8ie9QHC-MlvfXxqftm9UPPe524JUhmwSEaZjQ7oL7U1tVoHLUj-gVUwM-7uzBGFsAXD_A_cx_JyAZP4Td-GMBJ-AebJNRAQP0m0v253eKMkURp63aG4%3Ds0-d-e1-ft.png", "logoUrl": "https://trello-attachments.s3.amazonaws.com/54c7e02f2c173c37015b2f36/604x309/00580a0567a4b3afda29d52b09e7e829/rQQ6zwq31Uya8ie9QHC-MlvfXxqftm9UPPe524JUhmwSEaZjQ7oL7U1tVoHLUj-gVUwM-7uzBGFsAXD_A_cx_JyAZP4Td-GMBJ-AebJNRAQP0m0v253eKMkURp63aG4%3Ds0-d-e1-ft.png",
"imageUrl": "http://chasdeikaduri.org/images/523455_516325865106850_1885515210_n.jpg", "imageUrl": "http://chasdeikaduri.org/images/523455_516325865106850_1885515210_n.jpg",
"estimatedHours": "200" "estimatedHours": 200,
"status": "started"
}, },
{ {
"id": "bd7158d8c464cbafaeb4bdef", "id": "bd7158d8c464cbafaeb4bdef",
@ -43,7 +44,8 @@
"projectDescription": "Campers will create a Chrome browser extension to preserve sales data from a form, and upload in batches as the internet connection allows.", "projectDescription": "Campers will create a Chrome browser extension to preserve sales data from a form, and upload in batches as the internet connection allows.",
"logoUrl": "https://trello-attachments.s3.amazonaws.com/54d29f1e4c726fd765fa87ef/54d29f6388812dd367a243ab/x/018d9d3be5439870c56cccba5b3aa8bf/kopernik-logo-global.png", "logoUrl": "https://trello-attachments.s3.amazonaws.com/54d29f1e4c726fd765fa87ef/54d29f6388812dd367a243ab/x/018d9d3be5439870c56cccba5b3aa8bf/kopernik-logo-global.png",
"imageUrl": "http://kopernik.info/sites/default/files/updates/Presenting_the_low_carbon_t.jpg", "imageUrl": "http://kopernik.info/sites/default/files/updates/Presenting_the_low_carbon_t.jpg",
"estimatedHours": "100" "estimatedHours": 100,
"status": "completed"
}, },
{ {
"id": "bd6274d8c464cbafaeb4bdef", "id": "bd6274d8c464cbafaeb4bdef",
@ -62,7 +64,8 @@
"projectDescription": "Campers will create a full stack JavaScript solution to allow users to edit captions from YouTube videos.", "projectDescription": "Campers will create a full stack JavaScript solution to allow users to edit captions from YouTube videos.",
"logoUrl": "https://trello-attachments.s3.amazonaws.com/54c1da1ba1fe2e325df5fc34/54c1dd31226b8111794d132f/x/b0402135d9ecce6d4ab45c4b5e5aeaa0/Turning-online-horse-manure-into-strawberry-jam---since-2009.png", "logoUrl": "https://trello-attachments.s3.amazonaws.com/54c1da1ba1fe2e325df5fc34/54c1dd31226b8111794d132f/x/b0402135d9ecce6d4ab45c4b5e5aeaa0/Turning-online-horse-manure-into-strawberry-jam---since-2009.png",
"imageUrl": "", "imageUrl": "",
"estimatedHours": "200" "estimatedHours": 200,
"status": "completed"
}, },
{ {
"id": "bd1326d9c245cbafaeb4bdef", "id": "bd1326d9c245cbafaeb4bdef",
@ -81,7 +84,8 @@
"projectDescription": "Campers will create a mobile responsive website for the organization, with donation capabilities.", "projectDescription": "Campers will create a mobile responsive website for the organization, with donation capabilities.",
"logoUrl": "https://trello-attachments.s3.amazonaws.com/54d9810307b159a4d9027aa2/54d981bfe5eb145560fbb769/x/cf7f318bfe4aee631b0d0eeef272225c/logo.png", "logoUrl": "https://trello-attachments.s3.amazonaws.com/54d9810307b159a4d9027aa2/54d981bfe5eb145560fbb769/x/cf7f318bfe4aee631b0d0eeef272225c/logo.png",
"imageUrl": "http://www.operationbrush.org/images/temp/hands1.png", "imageUrl": "http://www.operationbrush.org/images/temp/hands1.png",
"estimatedHours": "100" "estimatedHours": 100,
"status": "started"
}, },
{ {
"id": "bd1325d8c464cbafaeb5bdef", "id": "bd1325d8c464cbafaeb5bdef",
@ -100,7 +104,8 @@
"projectDescription": "Campers will create a volunteer management system with multi-user access and reporting capabilities.", "projectDescription": "Campers will create a volunteer management system with multi-user access and reporting capabilities.",
"logoUrl": "https://trello-attachments.s3.amazonaws.com/54c1daf2d72d8eb868910b60/54c1dd4ecffcb09fc52b68a1/x/a8148f08769b449217e433bab8f39ddd/RCR-color.jpg", "logoUrl": "https://trello-attachments.s3.amazonaws.com/54c1daf2d72d8eb868910b60/54c1dd4ecffcb09fc52b68a1/x/a8148f08769b449217e433bab8f39ddd/RCR-color.jpg",
"imageUrl": "http://www.rosecityrollers.com/wp-content/uploads/2015/01/BZ7_5923-X3-675x375.jpg", "imageUrl": "http://www.rosecityrollers.com/wp-content/uploads/2015/01/BZ7_5923-X3-675x375.jpg",
"estimatedHours": "200" "estimatedHours": 200,
"status": "started"
}, },
{ {
"id": "bd1325d8c464cbafaeb6bdef", "id": "bd1325d8c464cbafaeb6bdef",
@ -119,7 +124,8 @@
"projectDescription": "Campers will create a single page fundraising website. In exchange for a donation, a user can customize a graphical 'heart' in someone's name or anonymously. The page will display all of the hearts on a 'wall of hearts.'", "projectDescription": "Campers will create a single page fundraising website. In exchange for a donation, a user can customize a graphical 'heart' in someone's name or anonymously. The page will display all of the hearts on a 'wall of hearts.'",
"logoUrl": "https://trello-attachments.s3.amazonaws.com/548b36629137780091a973cc/666x666/6c7a366ffb659649f6377d4a431687cd/country-logos-1-300dpi.jpg", "logoUrl": "https://trello-attachments.s3.amazonaws.com/548b36629137780091a973cc/666x666/6c7a366ffb659649f6377d4a431687cd/country-logos-1-300dpi.jpg",
"imageUrl": "http://www.saveachildsheart.com/wp-content/uploads/2013/10/7.2.5_Internation_Photograohy_Exhibition.jpg", "imageUrl": "http://www.saveachildsheart.com/wp-content/uploads/2013/10/7.2.5_Internation_Photograohy_Exhibition.jpg",
"estimatedHours": "100" "estimatedHours": 100,
"status": "completed"
}, },
{ {
"id": "bd1325d8c464cbafaeb4bdef", "id": "bd1325d8c464cbafaeb4bdef",
@ -138,7 +144,8 @@
"projectDescription": "Campers will create a website where potential donors can view which schools already have the Savvy Cyber Kids books, and donate books to those schools that do not.", "projectDescription": "Campers will create a website where potential donors can view which schools already have the Savvy Cyber Kids books, and donate books to those schools that do not.",
"logoUrl": "https://trello-attachments.s3.amazonaws.com/54ee3c7bf205562680177b59/218x190/1dc460de4edc9fdd4b481b24e93cfb23/logo.png", "logoUrl": "https://trello-attachments.s3.amazonaws.com/54ee3c7bf205562680177b59/218x190/1dc460de4edc9fdd4b481b24e93cfb23/logo.png",
"imageUrl": "http://www.privatewifi.com/wp-content/uploads/2014/10/Halpert.jpg", "imageUrl": "http://www.privatewifi.com/wp-content/uploads/2014/10/Halpert.jpg",
"estimatedHours": "200" "estimatedHours": 200,
"status": "started"
}, },
{ {
"id": "bd1325d8c464cbafaeb7bdef", "id": "bd1325d8c464cbafaeb7bdef",
@ -157,7 +164,8 @@
"projectDescription": "Campers will build a website where medical facilities can list music therapy time slots, and musicians can sign up to fill these slots.", "projectDescription": "Campers will build a website where medical facilities can list music therapy time slots, and musicians can sign up to fill these slots.",
"logoUrl": "http://static1.squarespace.com/static/521b8957e4b024f66a58b214/t/521b8e9de4b093a8696eb9b8/1398718364447/?format=750w", "logoUrl": "http://static1.squarespace.com/static/521b8957e4b024f66a58b214/t/521b8e9de4b093a8696eb9b8/1398718364447/?format=750w",
"imageUrl": "https://trello-attachments.s3.amazonaws.com/54fdb0328917ca64e9e8a79f/54fdc3b710f67caf6da14719/x/49fbe0012179bf254928f3f2a44810b4/Screen_2BShot_2B2013-08-26_2Bat_2B1.32.35_2BPM.png", "imageUrl": "https://trello-attachments.s3.amazonaws.com/54fdb0328917ca64e9e8a79f/54fdc3b710f67caf6da14719/x/49fbe0012179bf254928f3f2a44810b4/Screen_2BShot_2B2013-08-26_2Bat_2B1.32.35_2BPM.png",
"estimatedHours": "200" "estimatedHours": 200,
"status": "started"
}, },
{ {
"id": "bd1325d8c464cbafaeb8bdef", "id": "bd1325d8c464cbafaeb8bdef",
@ -176,6 +184,7 @@
"projectDescription": "Campers will build a mobile responsive web form to allow Timeraiser eventgoers to select which nonprofit organizations they're interested in volunteering with. System will have Salesforce integration and reporting capabilities.", "projectDescription": "Campers will build a mobile responsive web form to allow Timeraiser eventgoers to select which nonprofit organizations they're interested in volunteering with. System will have Salesforce integration and reporting capabilities.",
"logoUrl": "http://www.timeraiser.ca/uploads/5/6/1/4/5614163/1277176.png?480", "logoUrl": "http://www.timeraiser.ca/uploads/5/6/1/4/5614163/1277176.png?480",
"imageUrl": "http://www.timeraiser.ca/uploads/5/6/1/4/5614163/______________4571248_orig.png", "imageUrl": "http://www.timeraiser.ca/uploads/5/6/1/4/5614163/______________4571248_orig.png",
"estimatedHours": "100" "estimatedHours": 100,
"status": "started"
} }
] ]

View File

@ -0,0 +1,19 @@
extends ../layout
block content
script.
var challengeName = 'Nonprofits View';
.col-xs-12.col-sm-12.col-md-12
.panel.panel-info
.panel-heading.text-center Nonprofits We Help
.panel-body
for nonprofit in nonprofits
.spacer
.row
.col-xs-12.col-sm-3
img.img-responsive(src=nonprofit.logoUrl)
.col-xs-12.col-sm-9
h2.negative-15= nonprofit.name
h3.negative-15= nonprofit.whatDoesNonprofitDo
a.text-center.btn.btn-primary.btn-lg(href='/nonprofits/' + nonprofit.name.toLowerCase().replace(/\s/g, '-')) Read more
.spacer
.spacer

View File

@ -4,8 +4,7 @@ block content
var challengeName = 'Nonprofits View'; var challengeName = 'Nonprofits View';
.col-xs-12.col-sm-12.col-md-12 .col-xs-12.col-sm-12.col-md-12
.panel.panel-info .panel.panel-info
.panel-heading.text-center .panel-heading.text-center= title
h1= title
.panel-body .panel-body
.row .row
.col-xs-12.col-sm-10.col-sm-offset-1 .col-xs-12.col-sm-10.col-sm-offset-1