From d4935d44ded2a753cb3a26dcc46c50e1b1142b1e Mon Sep 17 00:00:00 2001 From: Michael Q Larson Date: Tue, 24 Mar 2015 21:46:42 -0700 Subject: [PATCH] add the routes, controller actions and views for the nonprofit wizard --- app.js | 12 +++- controllers/nonprofits.js | 62 ++++++++++++++++++- public/css/main.less | 5 ++ public/js/application.js | 2 +- ...already-benefiting-from-your-services.jade | 12 ++++ .../are-you-with-a-registered-nonprofit.jade | 12 ++++ views/nonprofits/home.jade | 4 +- .../how-can-free-code-camp-help-you.jade | 42 +++++++++++++ views/nonprofits/in-exchange-we-ask.jade | 16 +++++ views/nonprofits/ok-with-javascript.jade | 12 ++++ views/nonprofits/other-solutions.jade | 12 ++++ .../tell-us-your-name-and-email.jade | 0 .../what-does-your-nonprofit-do.jade | 23 +++++++ ...roject-application-has-been-submitted.jade | 0 14 files changed, 209 insertions(+), 5 deletions(-) create mode 100644 views/nonprofits/are-there-people-that-are-already-benefiting-from-your-services.jade create mode 100644 views/nonprofits/are-you-with-a-registered-nonprofit.jade create mode 100644 views/nonprofits/how-can-free-code-camp-help-you.jade create mode 100644 views/nonprofits/in-exchange-we-ask.jade create mode 100644 views/nonprofits/ok-with-javascript.jade create mode 100644 views/nonprofits/other-solutions.jade create mode 100644 views/nonprofits/tell-us-your-name-and-email.jade create mode 100644 views/nonprofits/what-does-your-nonprofit-do.jade create mode 100644 views/nonprofits/your-nonprofit-project-application-has-been-submitted.jade diff --git a/app.js b/app.js index b843772a06..3de9ae9f85 100644 --- a/app.js +++ b/app.js @@ -98,7 +98,7 @@ app.use(session({ secret: secrets.sessionSecret, store: new MongoStore({ url: secrets.db, - 'auto_reconnect': true + 'autoReconnect': true }) })); app.use(passport.initialize()); @@ -267,6 +267,16 @@ app.post('/email-signin', userController.postSignin); app.get('/nonprofits', contactController.getNonprofitsForm); app.post('/nonprofits', contactController.postNonprofitsForm); app.get('/nonprofits/home', nonprofitController.nonprofitsHome); +app.get('/nonprofits/are-you-with-a-registered-nonprofit', nonprofitController.areYouWithARegisteredNonprofit); +app.get('/nonprofits/how-can-free-code-camp-help-you', nonprofitController.howCanFreeCodeCampHelpYou); +app.get('/nonprofits/are-there-people-already-benefiting-from-your-services', nonprofitController.areTherePeopleAlreadyBenefitingFromYourServices); +app.get('/nonprofits/in-exchange-we-ask', nonprofitController.inExchangeWeAsk); +app.get('/nonprofits/ok-with-javascript', nonprofitController.okWithJavaScript); +app.get('/nonprofits/other-solutions', nonprofitController.otherSolutions); +app.get('/nonprofits/what-does-your-nonprofit-do', nonprofitController.whatDoesYourNonprofitDo); +app.get('/nonprofits/link-us-to-your-website', nonprofitController.linkUsToYourWebsite); +app.get('/nonprofits/tell-us-your-name-and-email', nonprofitController.tellUsYourNameAndEmail); +app.get('/nonprofits/your-nonprofit-project-application-has-been-submitted', nonprofitController.yourNonprofitProjectApplicationHasBeenSubmitted); app.get( '/done-with-first-100-hours', diff --git a/controllers/nonprofits.js b/controllers/nonprofits.js index 24f5c7bdb4..3ac9eb4508 100644 --- a/controllers/nonprofits.js +++ b/controllers/nonprofits.js @@ -18,4 +18,64 @@ exports.nonprofitsHome = function(req, res) { res.render('nonprofits/home', { title: 'A guide to our Nonprofit Projects' }); -}; \ No newline at end of file +}; + +exports.areYouWithARegisteredNonprofit = function(req, res) { + res.render('nonprofits/are-you-with-a-registered-nonprofit', { + title: 'Are you with a with a registered nonprofit' + }); +}; + +exports.howCanFreeCodeCampHelpYou = function(req, res) { + res.render('nonprofits/how-can-free-code-camp-help-you', { + title: 'Are you with a with a registered nonprofit' + }); +}; + +exports.otherSolutions = function(req, res) { + res.render('nonprofits/other-solutions', { + title: 'Here are some other possible solutions for you' + }); +}; + +exports.areTherePeopleAlreadyBenefitingFromYourServices = function(req, res) { + res.render('nonprofits/are-there-people-already-benefiting-from-your-services', { + title: 'Are there people already benefiting from your services' + }); +}; + +exports.inExchangeWeAsk = function(req, res) { + res.render('nonprofits/in-exchange-we-ask', { + title: 'In exchange we ask that you ...' + }); +}; + +exports.okWithJavaScript = function(req, res) { + res.render('nonprofits/ok-with-javascript', { + title: 'Are you OK with us using JavaScript' + }); +}; + +exports.whatDoesYourNonprofitDo = function(req, res) { + res.render('nonprofits/what-does-your-nonprofit-do', { + title: 'What does your nonprofit do?' + }); +}; + +exports.linkUsToYourWebsite = function(req, res) { + res.render('nonprofits/link-us-to-your-website', { + title: 'Link us to your website' + }); +}; + +exports.tellUsYourNameAndEmail = function(req, res) { + res.render('nonprofits/tell-us-your-name-and-email', { + title: 'Tell us your name and email address' + }); +}; + +exports.yourNonprofitProjectApplicationHasBeenSubmitted = function(req, res) { + res.render('nonprofits/your-nonprofit-project-application-has-been-submitted', { + title: 'Your Nonprofit Project application has been submitted!' + }); +}; diff --git a/public/css/main.less b/public/css/main.less index 138c6e2c8b..09ebb557ea 100644 --- a/public/css/main.less +++ b/public/css/main.less @@ -735,6 +735,11 @@ iframe.iphone { } } +.nonprofit-help-select-text-height { + font-size: 40px; + padding-top: 20px; +} + // To adjust right margin, negative values bring the image closer to the edge of the screen .iphone-position { position: absolute; diff --git a/public/js/application.js b/public/js/application.js index eeebfa316b..bf07cd484f 100644 --- a/public/js/application.js +++ b/public/js/application.js @@ -16,4 +16,4 @@ //= require lib/jquery-2.1.1.min //= require lib/bootstrap.min //= require lib/moment/moment -//= require main +//= require main \ No newline at end of file diff --git a/views/nonprofits/are-there-people-that-are-already-benefiting-from-your-services.jade b/views/nonprofits/are-there-people-that-are-already-benefiting-from-your-services.jade new file mode 100644 index 0000000000..63d99b8dd6 --- /dev/null +++ b/views/nonprofits/are-there-people-that-are-already-benefiting-from-your-services.jade @@ -0,0 +1,12 @@ +extends ../layout +block content + .jumbotron.text-center + h1.hug-top Nonprofit Sign Up + .spacer + h2 We build solutions for nonprofits who are already serving a need. Are there people who already benefit from your services? + .spacer + .row + .col-xs-6 + a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/') Yes + .col-xs-6 + a.btn.btn-warning.btn-big.btn-block(href='/nonprofits/') No \ No newline at end of file diff --git a/views/nonprofits/are-you-with-a-registered-nonprofit.jade b/views/nonprofits/are-you-with-a-registered-nonprofit.jade new file mode 100644 index 0000000000..ce778cec2a --- /dev/null +++ b/views/nonprofits/are-you-with-a-registered-nonprofit.jade @@ -0,0 +1,12 @@ +extends ../layout +block content + .jumbotron.text-center + h1.hug-top Nonprofit Sign Up + .spacer + h2 Do you represent a nonprofit organization that is registered with your government? + .spacer + .row + .col-xs-6 + a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/how-can-free-code-camp-help-you') Yes + .col-xs-6 + a.btn.btn-warning.btn-big.btn-block(href='/nonprofits/other-solutions') No \ No newline at end of file diff --git a/views/nonprofits/home.jade b/views/nonprofits/home.jade index 832895e45e..b76a306f25 100644 --- a/views/nonprofits/home.jade +++ b/views/nonprofits/home.jade @@ -19,7 +19,7 @@ block content .testimonial-copy I'm currently working through Free Code Camp to improve my JavaScript. The community is very welcoming! h3 - @cynthialanel .big-break - a.btn.btn-cta.signup-btn(href="/with-a-nonprofit") Get pro bono help for my nonprofit + a.btn.btn-cta.signup-btn(href="/nonprofits/are-you-with-a-registered-nonprofit") Get pro bono help for my nonprofit .big-break h2 Our process .row @@ -78,6 +78,6 @@ block content li.ion-code   You can get help in real time from our community chat rooms and forum li.ion-code   We all share one common goal: to boost our careers with code .big-break - a.btn.btn-cta.signup-btn(href="/with-a-nonprofit") I'm with a nonprofit and want help coding something + a.btn.btn-cta.signup-btn(href="/nonprofits/are-you-with-a-registered-nonprofit") Get pro bono help for my nonprofit script. challengeName = 'Home' \ No newline at end of file diff --git a/views/nonprofits/how-can-free-code-camp-help-you.jade b/views/nonprofits/how-can-free-code-camp-help-you.jade new file mode 100644 index 0000000000..6fac5ad44e --- /dev/null +++ b/views/nonprofits/how-can-free-code-camp-help-you.jade @@ -0,0 +1,42 @@ +extends ../layout +block content + .jumbotron.text-center + h1.hug-top Nonprofit Sign Up + .spacer + h2 How can Free Code Camp help you? + .spacer + .row.text-center.negative-35 + .col-xs-12.col-sm-12.col-md-3 + .landing-skill-icon.ion-android-globe + label.black-text.nonprofit-help-select-text-height Websites + input#websites-help.checkbox(type='checkbox') + .col-xs-12.col-sm-12.col-md-3 + .landing-skill-icon.ion-card + h2.black-text.nonprofit-help-select-text-height Donation Systems + input#websites-help.checkbox(type='checkbox') + .col-xs-12.col-sm-12.col-md-3 + .landing-skill-icon.ion-android-calendar + h2.black-text.nonprofit-help-select-text-height Volunteer Systems + input#websites-help.inline.checkbox(type='checkbox') + .col-xs-12.col-sm-12.col-md-3 + .landing-skill-icon.ion-ios-box + h2.black-text.nonprofit-help-select-text-height Inventory Systems + input#websites-help.inline.checkbox(type='checkbox') + .col-xs-12.col-sm-12.col-md-3 + .landing-skill-icon.ion-university + h2.black-text.nonprofit-help-select-text-height E-learning Platforms + input#websites-help.inline.checkbox(type='checkbox') + .col-xs-12.col-sm-12.col-md-3 + .landing-skill-icon.ion-ios-list + h2.black-text.nonprofit-help-select-text-height Web Forms + input#websites-help.inline.checkbox(type='checkbox') + .col-xs-12.col-sm-12.col-md-3 + .landing-skill-icon.ion-ios-people + h2.black-text.nonprofit-help-select-text-height Community Tools + input#websites-help.inline.checkbox(type='checkbox') + .col-xs-12.col-sm-12.col-md-3 + .landing-skill-icon.ion-settings + h2.black-text.nonprofit-help-select-text-height ...and other tools + input#websites-help.inline.checkbox(type='checkbox') + .spacer + a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/') I've selected all that apply and am ready to move on \ No newline at end of file diff --git a/views/nonprofits/in-exchange-we-ask.jade b/views/nonprofits/in-exchange-we-ask.jade new file mode 100644 index 0000000000..0dcb363d0c --- /dev/null +++ b/views/nonprofits/in-exchange-we-ask.jade @@ -0,0 +1,16 @@ +extends ../layout +block content + .jumbotron.text-left + h1.hug-top Nonprofit Sign Up + .spacer + h2 Great! In exchange for our help, we ask only that you: + ol + li Appoint one principal stakeholder to serve on behalf of your organization. + li Communicate with our campers on a regular basis, to answer questions and provide them with direction. + li Commit to using the solution that our campers build for your nonprofit. + .spacer + .row + .col-xs-6 + a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/how-can-free-code-camp-help-you') Sounds good! + .col-xs-6 + a.btn.btn-warning.btn-big.btn-block(href='/nonprofits/other-solutions') This might not be for us. \ No newline at end of file diff --git a/views/nonprofits/ok-with-javascript.jade b/views/nonprofits/ok-with-javascript.jade new file mode 100644 index 0000000000..10c1dc9841 --- /dev/null +++ b/views/nonprofits/ok-with-javascript.jade @@ -0,0 +1,12 @@ +extends ../layout +block content + .jumbotron.text-center + h1.hug-top Nonprofit Sign Up + .spacer + h2 Our campers are learning to code using modern full stack JavaScript technologies (MongoDB, Express, Angular, Node.js). We do not build or maintain Wordpress, Drupal, or other non-JavaScript based frameworks. + .spacer + .row + .col-xs-6 + a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/how-can-free-code-camp-help-you') Sounds good! + .col-xs-6 + a.btn.btn-warning.btn-big.btn-block(href='/nonprofits/other-solutions') This might not be for us. \ No newline at end of file diff --git a/views/nonprofits/other-solutions.jade b/views/nonprofits/other-solutions.jade new file mode 100644 index 0000000000..4f58b76668 --- /dev/null +++ b/views/nonprofits/other-solutions.jade @@ -0,0 +1,12 @@ +extends ../layout +block content + .jumbotron.text-center + h1.hug-top Nonprofit Sign Up + .spacer + h2 Do you represent a nonprofit organization that is registered with your government? + .spacer + .row + .col-xs-6 + a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/how-can-free-code-camp-help-you') Yes + .col-xs-6 + a.btn.btn-warning.btn-big.btn-block(href='/nonprofits/other-solutions') No \ No newline at end of file diff --git a/views/nonprofits/tell-us-your-name-and-email.jade b/views/nonprofits/tell-us-your-name-and-email.jade new file mode 100644 index 0000000000..e69de29bb2 diff --git a/views/nonprofits/what-does-your-nonprofit-do.jade b/views/nonprofits/what-does-your-nonprofit-do.jade new file mode 100644 index 0000000000..3718e46170 --- /dev/null +++ b/views/nonprofits/what-does-your-nonprofit-do.jade @@ -0,0 +1,23 @@ +extends ../layout +block content + .jumbotron.text-center + h1.hug-top Nonprofit Sign Up + .spacer + h2 In 140 characters or less, what does your nonprofit do? For whom? + .spacer + .input-group + input.form-control.big-text-field.field-responsive(type='text', maxlength='140', autofocus='') + span.input-group-btn + button.btn.btn-big.btn-primary.btn-responsive Submit + #textarea-comment-feedback +script. + var text_max = 140; + $('#textarea-comment-feedback').html(text_max + ' characters remaining'); + $('#comment-to-comment-textinput').keyup(function (e) { + if (e.which === 13 || e === 13) { + $('#submit-comment-to-comment').click(); + } + var text_length = $('#comment-to-comment-textinput').val().length; + var text_remaining = text_max - text_length; + $('#textarea-comment-feedback').html(text_remaining + ' characters remaining'); + }); \ No newline at end of file diff --git a/views/nonprofits/your-nonprofit-project-application-has-been-submitted.jade b/views/nonprofits/your-nonprofit-project-application-has-been-submitted.jade new file mode 100644 index 0000000000..e69de29bb2