From 29b4e3b97038e0fc8d6c762385be96602ca25261 Mon Sep 17 00:00:00 2001 From: Michael Q Larson Date: Wed, 8 Apr 2015 14:57:08 -0700 Subject: [PATCH] get seed data seeding and improve application submitted button --- controllers/nonprofits.js | 14 +++++--------- models/Nonprofit.js | 2 +- seed_data/nonprofits.json | 18 +++++++++--------- views/nonprofits/show.jade | 3 ++- ...project-application-has-been-submitted.jade | 2 +- .../nonprofit-application-progress-bar.jade | 4 ++-- 6 files changed, 20 insertions(+), 23 deletions(-) diff --git a/controllers/nonprofits.js b/controllers/nonprofits.js index c6bf824905c..a7871327a37 100644 --- a/controllers/nonprofits.js +++ b/controllers/nonprofits.js @@ -88,16 +88,11 @@ exports.tellUsYourName = 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) { res.render('nonprofits/your-nonprofit-project-application-has-been-submitted', { - title: 'Your Nonprofit Project application has been submitted!' + title: 'Your Nonprofit Project application has been submitted!', + step: 10, + getBackDay: moment().weekday(5).format('dddd') }); }; @@ -163,7 +158,8 @@ exports.returnIndividualNonprofit = function(req, res, next) { whatDoesNonprofitDo: nonprofit.whatDoesNonprofitDo, interestedCampers: nonprofit.interestedCampers, assignedCampers: nonprofit.assignedCampers, - buttonActive: buttonActive + buttonActive: buttonActive, + currentStatus: nonprofit.currentStatus }); }); }; diff --git a/models/Nonprofit.js b/models/Nonprofit.js index 8ea47ddea06..34443461da1 100644 --- a/models/Nonprofit.js +++ b/models/Nonprofit.js @@ -22,7 +22,7 @@ var nonprofitSchema = new mongoose.Schema({ estimatedHours: 0, interestedCampers: [], confirmedCampers: [], - status: "evaluating" //"evaluating", "confirmed", "started", "completed", "aborted" + currentStatus: String // "confirmed", "started", "completed", "aborted" }); module.exports = mongoose.model('Nonprofit', nonprofitSchema); diff --git a/seed_data/nonprofits.json b/seed_data/nonprofits.json index eae8f08236a..f208c4a510c 100644 --- a/seed_data/nonprofits.json +++ b/seed_data/nonprofits.json @@ -25,7 +25,7 @@ "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", "estimatedHours": 200, - "status": "started" + "currentStatus": "started" }, { "id": "bd7158d8c464cbafaeb4bdef", @@ -45,7 +45,7 @@ "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", "estimatedHours": 100, - "status": "completed" + "currentStatus": "completed" }, { "id": "bd6274d8c464cbafaeb4bdef", @@ -65,7 +65,7 @@ "logoUrl": "https://trello-attachments.s3.amazonaws.com/54c1da1ba1fe2e325df5fc34/54c1dd31226b8111794d132f/x/b0402135d9ecce6d4ab45c4b5e5aeaa0/Turning-online-horse-manure-into-strawberry-jam---since-2009.png", "imageUrl": "", "estimatedHours": 200, - "status": "completed" + "currentStatus": "completed" }, { "id": "bd1326d9c245cbafaeb4bdef", @@ -85,7 +85,7 @@ "logoUrl": "https://trello-attachments.s3.amazonaws.com/54d9810307b159a4d9027aa2/54d981bfe5eb145560fbb769/x/cf7f318bfe4aee631b0d0eeef272225c/logo.png", "imageUrl": "http://www.operationbrush.org/images/temp/hands1.png", "estimatedHours": 100, - "status": "started" + "currentStatus": "started" }, { "id": "bd1325d8c464cbafaeb5bdef", @@ -105,7 +105,7 @@ "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", "estimatedHours": 200, - "status": "started" + "currentStatus": "started" }, { "id": "bd1325d8c464cbafaeb6bdef", @@ -125,7 +125,7 @@ "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", "estimatedHours": 100, - "status": "completed" + "currentStatus": "completed" }, { "id": "bd1325d8c464cbafaeb4bdef", @@ -145,7 +145,7 @@ "logoUrl": "https://trello-attachments.s3.amazonaws.com/54ee3c7bf205562680177b59/218x190/1dc460de4edc9fdd4b481b24e93cfb23/logo.png", "imageUrl": "http://www.privatewifi.com/wp-content/uploads/2014/10/Halpert.jpg", "estimatedHours": 200, - "status": "started" + "currentStatus": "started" }, { "id": "bd1325d8c464cbafaeb7bdef", @@ -165,7 +165,7 @@ "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", "estimatedHours": 200, - "status": "started" + "currentStatus": "started" }, { "id": "bd1325d8c464cbafaeb8bdef", @@ -185,6 +185,6 @@ "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", "estimatedHours": 100, - "status": "started" + "currentStatus": "started" } ] diff --git a/views/nonprofits/show.jade b/views/nonprofits/show.jade index 8ef8fc8776c..de4d7358156 100644 --- a/views/nonprofits/show.jade +++ b/views/nonprofits/show.jade @@ -43,6 +43,7 @@ block content .ion-university   E-learning Platform if (approvedOther) .ion-settings   Other tools + h3 Project Status: #{currentStatus} if (interestedCampers && interestedCampers.length > 0) h3 Interested campers: .col-xs-12.text-left @@ -60,7 +61,7 @@ block content .col-xs-12.col-sm-8.col-sm-offset-2 .text-center a.btn.btn-primary.btn-big.btn-block.disabled(href='/nonprofits/interested-in-nonprofit/#{dashedName}') I'm interested in building this project * - p * Complete all our Bonfires, 10 Ziplines, and 3 Basejumps to unlock this. + p * Complete all our Bonfires, Ziplines, and Basejumps to unlock this. #showAllButton.btn.btn-info.btn-big.btn-block Show all Nonprofits Projects if (buttonActive) .col-xs-12.col-sm-8.col-sm-offset-2 diff --git a/views/nonprofits/your-nonprofit-project-application-has-been-submitted.jade b/views/nonprofits/your-nonprofit-project-application-has-been-submitted.jade index 7190fd14ecb..1882ada3bc2 100644 --- a/views/nonprofits/your-nonprofit-project-application-has-been-submitted.jade +++ b/views/nonprofits/your-nonprofit-project-application-has-been-submitted.jade @@ -3,4 +3,4 @@ block content .jumbotron.text-center h1.hug-top Nonprofit Sign Up include ../partials/nonprofit-application-progress-bar - h2 Thank you for reaching out to us. We’ll get back with you before N of next week. \ No newline at end of file + h2 Thank you for reaching out to us. We’ll send you an email no later than #{getBackDay}. diff --git a/views/partials/nonprofit-application-progress-bar.jade b/views/partials/nonprofit-application-progress-bar.jade index 440bb672625..e9ed80c4412 100644 --- a/views/partials/nonprofit-application-progress-bar.jade +++ b/views/partials/nonprofit-application-progress-bar.jade @@ -3,7 +3,7 @@ .progress-bar(role='progressbar', aria-valuenow= (step * 10), aria-valuemin='0', aria-valuemax='100', style="width: #{step * 10}%;") span.sr-only= step * 10 | % Complete -h3.gray-text.text-center Step #{step} of 9 +h3.gray-text.text-center Step #{step} of 10 script. @@ -36,4 +36,4 @@ script. } }); } - $('#preliminary-story-submit').on('click', preliminaryStorySubmit); \ No newline at end of file + $('#preliminary-story-submit').on('click', preliminaryStorySubmit);