got show all nonprofits button working and improved nonprofit show view

This commit is contained in:
Michael Q Larson
2015-03-31 17:38:33 -07:00
parent f72774d412
commit fa74a1b454
6 changed files with 101 additions and 70 deletions

15
app.js
View File

@ -323,9 +323,9 @@ app.post('/email-signin', userController.postSignin);
* Nonprofit Project routes. * Nonprofit Project routes.
*/ */
app.get('/nonprofits', contactController.getNonprofitsForm); //app.get('/nonprofits', contactController.getNonprofitsForm);
//
app.post('/nonprofits', contactController.postNonprofitsForm); //app.post('/nonprofits', contactController.postNonprofitsForm);
app.get('/nonprofits/home', nonprofitController.nonprofitsHome); app.get('/nonprofits/home', nonprofitController.nonprofitsHome);
@ -351,18 +351,13 @@ app.get('/nonprofits/your-nonprofit-project-application-has-been-submitted', non
app.get('/nonprofits/other-solutions', nonprofitController.otherSolutions); app.get('/nonprofits/other-solutions', nonprofitController.otherSolutions);
app.get('/nonprofits/getNonprofitList', nonprofitController.showAllNonprofits);
app.get( app.get(
'/nonprofits/:nonprofitName', '/nonprofits/:nonprofitName',
nonprofitController.returnIndividualNonprofit nonprofitController.returnIndividualNonprofit
); );
app.get(
'/nonprofits',
nonprofitController.showAllNonprofits
);
app.get('/nonprofits/getNonprofitsList', nonprofitController.showAllNonprofits);
app.get( app.get(
'/done-with-first-100-hours', '/done-with-first-100-hours',
passportConf.isAuthenticated, passportConf.isAuthenticated,

View File

@ -1,6 +1,6 @@
var async = require('async'), var async = require('async'),
Nonprofit = require('./../models/Nonprofit'), Nonprofit = require('./../models/Nonprofit'),
resources = require('./resources.json'), resources = require('./resources'),
secrets = require('./../config/secrets'), secrets = require('./../config/secrets'),
moment = require('moment'), moment = require('moment'),
debug = require('debug')('freecc:cntr:resources'), debug = require('debug')('freecc:cntr:resources'),
@ -118,8 +118,16 @@ exports.returnIndividualNonprofit = function(req, res, next) {
res.render('nonprofits/show', { res.render('nonprofits/show', {
title: nonprofit.name, title: nonprofit.name,
logoUrl: nonprofit.logoUrl, logoUrl: nonprofit.logoUrl,
estimatedHours: nonprofit.estimatedHours,
projectDescription: nonprofit.projectDescription, projectDescription: nonprofit.projectDescription,
approvedDeliverables: nonprofit.approvedDeliverables, approvedOther: nonprofit.approvedDeliverables.indexOf('other') > -1,
approvedWebsite: nonprofit.approvedDeliverables.indexOf('website') > -1,
approvedDonor: nonprofit.approvedDeliverables.indexOf('donor') > -1,
approvedInventory: nonprofit.approvedDeliverables.indexOf('inventory') > -1,
approvedVolunteer: nonprofit.approvedDeliverables.indexOf('volunteer') > -1,
approvedForm: nonprofit.approvedDeliverables.indexOf('form') > -1,
approvedCommunity: nonprofit.approvedDeliverables.indexOf('community') > -1,
approvedELearning: nonprofit.approvedDeliverables.indexOf('eLearning') > -1,
websiteLink: nonprofit.websiteLink, websiteLink: nonprofit.websiteLink,
imageUrl: nonprofit.imageUrl, imageUrl: nonprofit.imageUrl,
whatDoesNonprofitDo: nonprofit.whatDoesNonprofitDo whatDoesNonprofitDo: nonprofit.whatDoesNonprofitDo
@ -130,6 +138,5 @@ exports.returnIndividualNonprofit = function(req, res, next) {
exports.showAllNonprofits = function(req, res) { exports.showAllNonprofits = function(req, res) {
var data = {}; var data = {};
data.nonprofitsList = resources.allNonprofitNames(); data.nonprofitsList = resources.allNonprofitNames();
console.log('here I am rock you like a hurricane', data);
res.send(data); res.send(data);
}; };

View File

@ -2,11 +2,11 @@
{ {
"id": "bd7157d8c441cbafaeb5bdef", "id": "bd7157d8c441cbafaeb5bdef",
"requestedDeliverables": [ "requestedDeliverables": [
"Website", "website",
"Donor Managment System", "donor",
"Inventory Management System", "inventory",
"Volunteer Management System", "volunteer",
"Forms" "form"
], ],
"whatDoesNonprofitDo": "We help the many less-fortunate Jewish families in our community, by providing them with nutritious food and energy to grow, learn, work, and give them hope for a better and brighter future.", "whatDoesNonprofitDo": "We help the many less-fortunate Jewish families in our community, by providing them with nutritious food and energy to grow, learn, work, and give them hope for a better and brighter future.",
"websiteLink": "http://chasdeikaduri.org/", "websiteLink": "http://chasdeikaduri.org/",
@ -15,7 +15,11 @@
"name": "Chasdei Kaduri", "name": "Chasdei Kaduri",
"endUser": "Clients, donors, and admin.", "endUser": "Clients, donors, and admin.",
"approvedDeliverables": [ "approvedDeliverables": [
"Website, Donor Management System, Inventory Management System, Volunteer Management System, Forms" "website",
"donor",
"inventory",
"volunteer",
"form"
], ],
"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",
@ -25,7 +29,7 @@
{ {
"id": "bd7158d8c464cbafaeb4bdef", "id": "bd7158d8c464cbafaeb4bdef",
"requestedDeliverables": [ "requestedDeliverables": [
"Other" "other"
], ],
"whatDoesNonprofitDo": "We connect simple technology with last mile communities to reduce poverty.", "whatDoesNonprofitDo": "We connect simple technology with last mile communities to reduce poverty.",
"websiteLink": "http://kopernik.info/", "websiteLink": "http://kopernik.info/",
@ -34,7 +38,7 @@
"name": "Kopernik", "name": "Kopernik",
"endUser": "Women in rural Indonesia.", "endUser": "Women in rural Indonesia.",
"approvedDeliverables": [ "approvedDeliverables": [
"Other" "other"
], ],
"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",
@ -44,7 +48,7 @@
{ {
"id": "bd6274d8c464cbafaeb4bdef", "id": "bd6274d8c464cbafaeb4bdef",
"requestedDeliverables": [ "requestedDeliverables": [
"Other" "other"
], ],
"whatDoesNonprofitDo": "No More Craptions seeks to improve upon automatic captioning on YouTube videos, by allowing users to edit captions to videos, even if they do not own the content.", "whatDoesNonprofitDo": "No More Craptions seeks to improve upon automatic captioning on YouTube videos, by allowing users to edit captions to videos, even if they do not own the content.",
"websiteLink": "http://nomorecraptions.com/", "websiteLink": "http://nomorecraptions.com/",
@ -53,7 +57,7 @@
"name": "No More Craptions", "name": "No More Craptions",
"endUser": "Hearing impaired users, and those who want to correct poor captions.", "endUser": "Hearing impaired users, and those who want to correct poor captions.",
"approvedDeliverables": [ "approvedDeliverables": [
"Other" "other"
], ],
"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",
@ -63,7 +67,7 @@
{ {
"id": "bd1326d9c245cbafaeb4bdef", "id": "bd1326d9c245cbafaeb4bdef",
"requestedDeliverables": [ "requestedDeliverables": [
"Website" "website"
], ],
"whatDoesNonprofitDo": "We distribute biodegradable toothbrushes globally to children in need.", "whatDoesNonprofitDo": "We distribute biodegradable toothbrushes globally to children in need.",
"websiteLink": "http://www.operationbrush.org/", "websiteLink": "http://www.operationbrush.org/",
@ -72,7 +76,7 @@
"name": "Operation Brush", "name": "Operation Brush",
"endUser": "Donors", "endUser": "Donors",
"approvedDeliverables": [ "approvedDeliverables": [
"Website" "website"
], ],
"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",
@ -82,7 +86,7 @@
{ {
"id": "bd1325d8c464cbafaeb5bdef", "id": "bd1325d8c464cbafaeb5bdef",
"requestedDeliverables": [ "requestedDeliverables": [
"Community Management Tool" "community"
], ],
"whatDoesNonprofitDo": "We are the largest roller derby league in the world with around 250 adults and 150 junior skater members plus 500+ volunteers.", "whatDoesNonprofitDo": "We are the largest roller derby league in the world with around 250 adults and 150 junior skater members plus 500+ volunteers.",
"websiteLink": "http://www.rosecityrollers.com/about/our-charities/", "websiteLink": "http://www.rosecityrollers.com/about/our-charities/",
@ -91,7 +95,7 @@
"name": "Rose City Rollers", "name": "Rose City Rollers",
"endUser": "Administrators, Coaches, and Volunteers", "endUser": "Administrators, Coaches, and Volunteers",
"approvedDeliverables": [ "approvedDeliverables": [
"Community Management Tool" "community"
], ],
"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",
@ -101,7 +105,7 @@
{ {
"id": "bd1325d8c464cbafaeb6bdef", "id": "bd1325d8c464cbafaeb6bdef",
"requestedDeliverables": [ "requestedDeliverables": [
"Website" "website"
], ],
"whatDoesNonprofitDo": "Save a Child's Heart provides urgently needed pediatric heart surgery and follow-up care for indigent children from developing countries", "whatDoesNonprofitDo": "Save a Child's Heart provides urgently needed pediatric heart surgery and follow-up care for indigent children from developing countries",
"websiteLink": "http://www.saveachildsheart.com/global/young-leadership-program/", "websiteLink": "http://www.saveachildsheart.com/global/young-leadership-program/",
@ -110,7 +114,7 @@
"name": "Save a Child's Heart", "name": "Save a Child's Heart",
"endUser": "Donors", "endUser": "Donors",
"approvedDeliverables": [ "approvedDeliverables": [
"Website" "website"
], ],
"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",
@ -120,7 +124,7 @@
{ {
"id": "bd1325d8c464cbafaeb4bdef", "id": "bd1325d8c464cbafaeb4bdef",
"requestedDeliverables": [ "requestedDeliverables": [
"Website" "website"
], ],
"whatDoesNonprofitDo": "Savvy Cyber Kids enables youth to be empowered with technology by providing age appropriate resources and education.", "whatDoesNonprofitDo": "Savvy Cyber Kids enables youth to be empowered with technology by providing age appropriate resources and education.",
"websiteLink": "http://savvycyberkids.org/", "websiteLink": "http://savvycyberkids.org/",
@ -129,7 +133,7 @@
"name": "Savvy Cyber Kids", "name": "Savvy Cyber Kids",
"endUser": "Donors", "endUser": "Donors",
"approvedDeliverables": [ "approvedDeliverables": [
"Website" "website"
], ],
"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",
@ -139,7 +143,7 @@
{ {
"id": "bd1325d8c464cbafaeb7bdef", "id": "bd1325d8c464cbafaeb7bdef",
"requestedDeliverables": [ "requestedDeliverables": [
"Other" "other"
], ],
"whatDoesNonprofitDo": "Transcendent Pathways", "whatDoesNonprofitDo": "Transcendent Pathways",
"websiteLink": "http://transcendentpathways.org/", "websiteLink": "http://transcendentpathways.org/",
@ -148,7 +152,7 @@
"name": "Transcendent Pathways", "name": "Transcendent Pathways",
"endUser": "Medical Facilities, Musicians", "endUser": "Medical Facilities, Musicians",
"approvedDeliverables": [ "approvedDeliverables": [
"Other" "other"
], ],
"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",
@ -158,7 +162,7 @@
{ {
"id": "bd1325d8c464cbafaeb8bdef", "id": "bd1325d8c464cbafaeb8bdef",
"requestedDeliverables": [ "requestedDeliverables": [
"Other" "other"
], ],
"whatDoesNonprofitDo": "Timeraiser is a volunteer matching fair, a silent art auction, and a night out on the town. The big Timeraiser twist is rather than bid money on artwork, participants bid volunteer hours. ", "whatDoesNonprofitDo": "Timeraiser is a volunteer matching fair, a silent art auction, and a night out on the town. The big Timeraiser twist is rather than bid money on artwork, participants bid volunteer hours. ",
"websiteLink": "http://www.timeraiser.ca/", "websiteLink": "http://www.timeraiser.ca/",
@ -167,7 +171,7 @@
"name": "Timeraiser", "name": "Timeraiser",
"endUser": "Eventgoers", "endUser": "Eventgoers",
"approvedDeliverables": [ "approvedDeliverables": [
"Other" "other"
], ],
"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",

View File

@ -7,27 +7,27 @@ block content
.text-left.form-inline .text-left.form-inline
h3.col-xs-12.col-sm-offset-5.checkbox-table h3.col-xs-12.col-sm-offset-5.checkbox-table
.col-xs-12 .col-xs-12
input.checkbox(type='checkbox', id='websites') input.checkbox(type='checkbox', id='website')
label.ion-android-globe   Websites label.ion-android-globe   Websites
.col-xs-12 .col-xs-12
input.checkbox(type='checkbox', id='donationSystems') input.checkbox(type='checkbox', id='donation')
label.ion-card   Donation Systems label.ion-card   Donation Systems
.col-xs-12 .col-xs-12
input.checkbox(type='checkbox', id='volunteerSystems') input.checkbox(type='checkbox', id='volunteer')
label.ion-android-calendar   Volunteer Systems label.ion-android-calendar   Volunteer Systems
.col-xs-12 .col-xs-12
input.checkbox(type='checkbox', id='inventorySystems') input.checkbox(type='checkbox', id='inventory')
label.ion-ios-box   Inventory Systems label.ion-ios-box   Inventory Systems
.col-xs-12 .col-xs-12
input.checkbox(type='checkbox', id='eLearningPlatforms') input.checkbox(type='checkbox', id='eLearning')
label.ion-university   E-learning Platforms label.ion-university   E-learning Platforms
.col-xs-12 .col-xs-12
input.checkbox(type='checkbox', id='webForms') input.checkbox(type='checkbox', id='form')
label.ion-ios-list   Web Forms label.ion-ios-list   Web Forms
.col-xs-12 .col-xs-12
input.checkbox(type='checkbox', id='communityTools') input.checkbox(type='checkbox', id='community')
label.ion-ios-people   Community Tools label.ion-ios-people   Community Tools
.col-xs-12 .col-xs-12
input.checkbox(type='checkbox', id='otherTools') input.checkbox(type='checkbox', id='other')
label.ion-settings   Other tools label.ion-settings   Other tools
button#next-step.btn.btn-primary.btn-big.btn-block(type='submit') I've selected all that apply and am ready to move on button#next-step.btn.btn-primary.btn-big.btn-block(type='submit') I've selected all that apply and am ready to move on

View File

@ -7,21 +7,46 @@ block content
.panel-heading.text-center .panel-heading.text-center
h1= title h1= title
.panel-body .panel-body
h3= whatDoesNonprofitDo .col-xs-12.col-sm-10.col-sm-offset-1
for deliverable in approvedDeliverables .row
p= deliverable .col-xs-12
p Website: img.img-center.img-responsive(src=imageUrl)
a(href=websiteLink)= websiteLink .spacer
p Project Description: .row
= projectDescription .col-xs-12.col-sm-4
p Estimated Hours Per Camper
= estimatedHours
img.img-responsive(src=imageUrl)
img.img-responsive(src=logoUrl) img.img-responsive(src=logoUrl)
.col-xs-12.col-sm-8
h4= whatDoesNonprofitDo
h4
a(href=websiteLink)= websiteLink
.col-xs-12.col-sm-10.col-sm-offset-1
.row
h4 #{projectDescription} (About #{estimatedHours} hours per camper)
.col-xs-12.col-sm-10.col-sm-offset-1
.row.text-center
h3 This project involves building:
if (approvedWebsite)
.ion-android-globe   Website
if (approvedDonor)
.ion-card   Donor Management System
if (approvedInventory)
.ion-ios-box   Inventory Management System
if (approvedVolunteer)
.ion-android-calendar   Volunteer Management System
if (approvedForm)
.ion-ios-list   Webform
if (approvedCommunity)
.ion-ios-people   Community Management System
if (approvedELearning)
.ion-university   E-learning Platform
if (approvedOther)
.ion-settings   Other tools
.spacer .spacer
.col-xs-12.col-sm-8.col-sm-offset-2
.text-center .text-center
#showAllButton.btn.btn-info.btn-big Show all Nonprofits Projects #interestedInProject.btn.btn-primary.btn-big.btn-block I'm interested in building this project
.spacer #showAllButton.btn.btn-info.btn-big.btn-block Show all Nonprofits Projects
.row .row
.col-xs-12.text-center .col-xs-12.text-center
if !user if !user

View File

@ -8,7 +8,7 @@ h3
return name.toLowerCase().replace(/\s/g, '-'); return name.toLowerCase().replace(/\s/g, '-');
} }
$.ajax({ $.ajax({
url: '/nonprofits/getNonprofitsList', url: '/nonprofits/getNonprofitList',
type: 'GET' type: 'GET'
}) })
.success( .success(