From f9523beb2934b82337f4b1a713368263fc8ead8a Mon Sep 17 00:00:00 2001 From: Michael Q Larson Date: Sun, 22 Mar 2015 18:22:07 -0700 Subject: [PATCH 1/9] update copy on show all bonfires button --- views/bonfire/show.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bonfire/show.jade b/views/bonfire/show.jade index da09c0a208..8ea9007701 100644 --- a/views/bonfire/show.jade +++ b/views/bonfire/show.jade @@ -77,7 +77,7 @@ block content span.ion-arrow-up-b | Less information #submitButton.btn.btn-primary.btn-big.btn-block Run code (ctrl + enter) - #showAllButton.btn.btn-info.btn-big.btn-block Show all coding challenges + #showAllButton.btn.btn-info.btn-big.btn-block Show all bonfires br form.code .form-group.codeMirrorView From 1facf532f3a1993c3589d3b02ec6f9ec82e5eed4 Mon Sep 17 00:00:00 2001 From: Michael Q Larson Date: Mon, 23 Mar 2015 10:42:59 -0700 Subject: [PATCH 2/9] start building the nonprofit project flow --- views/nonprofits/home.jade | 86 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 views/nonprofits/home.jade diff --git a/views/nonprofits/home.jade b/views/nonprofits/home.jade new file mode 100644 index 0000000000..41f080b21a --- /dev/null +++ b/views/nonprofits/home.jade @@ -0,0 +1,86 @@ +extends layout +block content + .jumbotron + .text-center + h1.hug-top We code for a cause + h2 We'll code software solutions for your nonprofit, for free! + .row + .col-xs-12.col-sm-12.col-md-3 + h3.nowrap Get Connected + img.img-responsive.landing-icon.img-center(src= 'https://s3.amazonaws.com/freecodecamp/landingIcons_connect.svg.gz', title='Get great references and connections to help you get a job') + p.landing-p Join a community of busy, motivated professionals. + .col-xs-12.col-sm-12.col-md-3 + h3.nowrap Learn JavaScript + img.img-responsive.landing-icon.img-center(src= 'https://s3.amazonaws.com/freecodecamp/landingIcons_learn.svg.gz', title='Learn to code') + p.landing-p Work together on Full Stack JavaScript coding challenges. + .col-xs-12.col-sm-12.col-md-3 + h3.nowrap Build your Portfolio + img.img-responsive.landing-icon.img-center(src= 'https://s3.amazonaws.com/freecodecamp/landingIcons_portfolio.svg.gz', title='Build a portfolio of apps for nonprofits') + p.landing-p Build apps that solve real problems for real people. + .col-xs-12.col-sm-12.col-md-3 + h3.nowrap Help Nonprofits + img.img-responsive.landing-icon.img-center(src= 'https://s3.amazonaws.com/freecodecamp/landingIcons_nonprofits.svg.gz', title='Help nonprofits') + p.landing-p Give nonprofits a boost by empowering them with code. + .big-break + a.btn.btn-cta.signup-btn(href="/with-a-nonprofit") I'm with a nonprofit and want help coding something + .big-break + h2 Nonprofits we've helped + .row + .col-xs-12.col-sm-12.col-md-4 + img.img-responsive.testimonial-image.img-center(src="https://s3.amazonaws.com/freecodecamp/testimonial-jen.jpg", alt="@jenthebest's testimonial image") + .testimonial-copy Getting back on track with Free Code Camp and committing to a new career in 2015! + h3 - @jenbestyoga + .col-xs-12.col-sm-12.col-md-4 + img.img-responsive.testimonial-image.img-center(src="https://s3.amazonaws.com/freecodecamp/testimonial-tate.jpg", alt="@TateThurston's testimonial image") + .testimonial-copy Just built my company's website with skills I've learned from Free Code Camp! + h3 - @TateThurston + .col-xs-12.col-sm-12.col-md-4 + img.img-responsive.testimonial-image.img-center(src="https://s3.amazonaws.com/freecodecamp/testimonial-cynthia.jpg", alt="@cynthialanel's testimonial image") + .testimonial-copy I'm currently working through Free Code Camp to improve my JavaScript. The community is very welcoming! + h3 - @cynthialanel + .big-break + h2 Solutions we can help you build: + .text-center.negative-35 + .col-xs-12.col-sm-12.col-md-3 + .landing-skill-icon.ion-android-globe + h2.black-text Websites + .col-xs-12.col-sm-12.col-md-3 + .landing-skill-icon.ion-card + h2.black-text Donation Systems + .col-xs-12.col-sm-12.col-md-3 + .landing-skill-icon.ion-android-calendar + h2.black-text Volunteer Systems + .col-xs-12.col-sm-12.col-md-3 + .landing-skill-icon.ion-ios-box + h2.black-text Inventory Systems + .col-xs-12.col-sm-12.col-md-3 + .landing-skill-icon.ion-university + h2.black-text E-learning Platforms + .col-xs-12.col-sm-12.col-md-3 + .landing-skill-icon.ion-ios-list + h2.black-text Web Forms + .col-xs-12.col-sm-12.col-md-3 + .landing-skill-icon.ion-ios-people + h2.black-text Community Tools + .col-xs-12.col-sm-12.col-md-3 + .landing-skill-icon.ion-settings + h2.black-text ...and other tools + br + br + .big-break + h2 Why you should join our community right now: + h3.col-xs-offset-0.col-sm-offset-1 + ul.text-left + li.ion-code   We're thousands of professionals, all learning to code together + li.ion-code   We're building projects for dozens of nonprofits + li.ion-code   Our community is 100% free and open source + li.ion-code   You'll learn Full Stack JavaScript and become a Software Engineer + li.ion-code   You'll work through our focused, interactive courses and tutorials + li.ion-code   You'll learn to code at your own pace, in your browser or on your phone + li.ion-code   You'll become qualified for thousands of jobs currently going unfilled + 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 + script. + challengeName = 'Home' \ No newline at end of file From bcec96e427462c5069d72bc2d900c375b15717df Mon Sep 17 00:00:00 2001 From: Michael Q Larson Date: Tue, 24 Mar 2015 19:08:26 -0700 Subject: [PATCH 3/9] half way done with the initial views and controllers --- app.js | 5 ++++- controllers/basejumps.js | 21 +++++++++++++++++++ controllers/nonprofits.js | 21 +++++++++++++++++++ controllers/ziplines.js | 21 +++++++++++++++++++ public/css/main.less | 4 ++++ views/home.jade | 2 +- views/nonprofits/home.jade | 43 ++++++++++++++++++-------------------- 7 files changed, 92 insertions(+), 25 deletions(-) create mode 100644 controllers/basejumps.js create mode 100644 controllers/nonprofits.js create mode 100644 controllers/ziplines.js diff --git a/app.js b/app.js index 7f15966228..b843772a06 100644 --- a/app.js +++ b/app.js @@ -27,10 +27,12 @@ var express = require('express'), * Controllers (route handlers). */ homeController = require('./controllers/home'), - challengesController = require('./controllers/challenges'), resourcesController = require('./controllers/resources'), userController = require('./controllers/user'), contactController = require('./controllers/contact'), + ziplineController = require('./controllers/ziplines'), + basejumpController = require('./controllers/basejumps'), + nonprofitController = require('./controllers/nonprofits'), bonfireController = require('./controllers/bonfire'), coursewareController = require('./controllers/courseware'), @@ -264,6 +266,7 @@ app.post('/email-signup', userController.postEmailSignup); app.post('/email-signin', userController.postSignin); app.get('/nonprofits', contactController.getNonprofitsForm); app.post('/nonprofits', contactController.postNonprofitsForm); +app.get('/nonprofits/home', nonprofitController.nonprofitsHome); app.get( '/done-with-first-100-hours', diff --git a/controllers/basejumps.js b/controllers/basejumps.js new file mode 100644 index 0000000000..e9687201a6 --- /dev/null +++ b/controllers/basejumps.js @@ -0,0 +1,21 @@ +var async = require('async'), + User = require('../models/User'), + Challenge = require('./../models/Challenge'), + Bonfire = require('./../models/Bonfire'), + Story = require('./../models/Story'), + Comment = require('./../models/Comment'), + resources = require('./resources.json'), + steps = resources.steps, + secrets = require('./../config/secrets'), + moment = require('moment'), + https = require('https'), + debug = require('debug')('freecc:cntr:resources'), + cheerio = require('cheerio'), + request = require('request'), + R = require('ramda'); + +nonprofitHome: function nonprofitHome(req, res) { + res.render('nonprofits/home', { + title: 'A guide to our Nonprofit Projects' + }); +} \ No newline at end of file diff --git a/controllers/nonprofits.js b/controllers/nonprofits.js new file mode 100644 index 0000000000..24f5c7bdb4 --- /dev/null +++ b/controllers/nonprofits.js @@ -0,0 +1,21 @@ +var async = require('async'), + User = require('../models/User'), + Challenge = require('./../models/Challenge'), + Bonfire = require('./../models/Bonfire'), + Story = require('./../models/Story'), + Comment = require('./../models/Comment'), + resources = require('./resources.json'), + steps = resources.steps, + secrets = require('./../config/secrets'), + moment = require('moment'), + https = require('https'), + debug = require('debug')('freecc:cntr:resources'), + cheerio = require('cheerio'), + request = require('request'), + R = require('ramda'); + +exports.nonprofitsHome = function(req, res) { + res.render('nonprofits/home', { + title: 'A guide to our Nonprofit Projects' + }); +}; \ No newline at end of file diff --git a/controllers/ziplines.js b/controllers/ziplines.js new file mode 100644 index 0000000000..e9687201a6 --- /dev/null +++ b/controllers/ziplines.js @@ -0,0 +1,21 @@ +var async = require('async'), + User = require('../models/User'), + Challenge = require('./../models/Challenge'), + Bonfire = require('./../models/Bonfire'), + Story = require('./../models/Story'), + Comment = require('./../models/Comment'), + resources = require('./resources.json'), + steps = resources.steps, + secrets = require('./../config/secrets'), + moment = require('moment'), + https = require('https'), + debug = require('debug')('freecc:cntr:resources'), + cheerio = require('cheerio'), + request = require('request'), + R = require('ramda'); + +nonprofitHome: function nonprofitHome(req, res) { + res.render('nonprofits/home', { + title: 'A guide to our Nonprofit Projects' + }); +} \ No newline at end of file diff --git a/public/css/main.less b/public/css/main.less index 5b136853e5..138c6e2c8b 100644 --- a/public/css/main.less +++ b/public/css/main.less @@ -335,6 +335,10 @@ ul { margin-bottom: -10px; } +.nonprofit-landing { + font-size: 50px; +} + .big-text { font-size: 63px; } diff --git a/views/home.jade b/views/home.jade index 70da30cc7e..cb76c768f1 100644 --- a/views/home.jade +++ b/views/home.jade @@ -25,7 +25,7 @@ block content a.btn.btn-cta.signup-btn(href="/login") Start learning to code (it's free) br br - a.btn.nonprofit-cta.btn-success(href="/nonprofits") I'm with a nonprofit and want help coding something + a.btn.nonprofit-cta.btn-success(href="/nonprofits") Get pro bono help for my nonprofit .big-break h2 Campers you'll hang out with: .row diff --git a/views/nonprofits/home.jade b/views/nonprofits/home.jade index 41f080b21a..832895e45e 100644 --- a/views/nonprofits/home.jade +++ b/views/nonprofits/home.jade @@ -1,30 +1,10 @@ -extends layout +extends ../layout block content .jumbotron .text-center - h1.hug-top We code for a cause - h2 We'll code software solutions for your nonprofit, for free! - .row - .col-xs-12.col-sm-12.col-md-3 - h3.nowrap Get Connected - img.img-responsive.landing-icon.img-center(src= 'https://s3.amazonaws.com/freecodecamp/landingIcons_connect.svg.gz', title='Get great references and connections to help you get a job') - p.landing-p Join a community of busy, motivated professionals. - .col-xs-12.col-sm-12.col-md-3 - h3.nowrap Learn JavaScript - img.img-responsive.landing-icon.img-center(src= 'https://s3.amazonaws.com/freecodecamp/landingIcons_learn.svg.gz', title='Learn to code') - p.landing-p Work together on Full Stack JavaScript coding challenges. - .col-xs-12.col-sm-12.col-md-3 - h3.nowrap Build your Portfolio - img.img-responsive.landing-icon.img-center(src= 'https://s3.amazonaws.com/freecodecamp/landingIcons_portfolio.svg.gz', title='Build a portfolio of apps for nonprofits') - p.landing-p Build apps that solve real problems for real people. - .col-xs-12.col-sm-12.col-md-3 - h3.nowrap Help Nonprofits - img.img-responsive.landing-icon.img-center(src= 'https://s3.amazonaws.com/freecodecamp/landingIcons_nonprofits.svg.gz', title='Help nonprofits') - p.landing-p Give nonprofits a boost by empowering them with code. + h2.nonprofit-landing.hug-top We'll code for your nonprofit, pro bono .big-break - a.btn.btn-cta.signup-btn(href="/with-a-nonprofit") I'm with a nonprofit and want help coding something - .big-break - h2 Nonprofits we've helped + h2 Some of our success stories .row .col-xs-12.col-sm-12.col-md-4 img.img-responsive.testimonial-image.img-center(src="https://s3.amazonaws.com/freecodecamp/testimonial-jen.jpg", alt="@jenthebest's testimonial image") @@ -39,6 +19,23 @@ 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 + .big-break + h2 Our process + .row + .col-xs-12.col-sm-12.col-md-4 + h3.nowrap Your idea + img.img-responsive.landing-icon.img-center(src= 'https://s3.amazonaws.com/freecodecamp/landingIcons_portfolio.svg.gz', title='Get great references and connections to help you get a job') + p.landing-p You tell us how we can help you. + .col-xs-12.col-sm-12.col-md-4 + h3.nowrap Our team + img.img-responsive.landing-icon.img-center(src= 'https://s3.amazonaws.com/freecodecamp/landingIcons_nonprofits.svg.gz', title='Build a portfolio of apps for nonprofits') + p.landing-p We'll hand pick developers and a project manager. + .col-xs-12.col-sm-12.col-md-4 + h3.nowrap Your solution + img.img-responsive.landing-icon.img-center(src= 'https://s3.amazonaws.com/freecodecamp/landingIcons_connect.svg.gz', title='Help nonprofits') + p.landing-p Together we'll set milestones and complete your project. + .big-break h2 Solutions we can help you build: .text-center.negative-35 .col-xs-12.col-sm-12.col-md-3 From d4935d44ded2a753cb3a26dcc46c50e1b1142b1e Mon Sep 17 00:00:00 2001 From: Michael Q Larson Date: Tue, 24 Mar 2015 21:46:42 -0700 Subject: [PATCH 4/9] 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 From 6e4067ee0034dd0bf5026f5b5177b1a146810dae Mon Sep 17 00:00:00 2001 From: Michael Q Larson Date: Tue, 24 Mar 2015 22:12:16 -0700 Subject: [PATCH 5/9] most views are now in place --- app.js | 2 +- controllers/nonprofits.js | 4 +-- ...already-benefiting-from-your-services.jade | 4 +-- .../how-can-free-code-camp-help-you.jade | 2 +- views/nonprofits/in-exchange-we-ask.jade | 15 ++++---- views/nonprofits/link-us-to-your-website.jade | 10 ++++++ views/nonprofits/ok-with-javascript.jade | 2 +- views/nonprofits/other-solutions.jade | 11 ++---- .../what-does-your-nonprofit-do.jade | 35 ++++++++++--------- 9 files changed, 46 insertions(+), 39 deletions(-) create mode 100644 views/nonprofits/link-us-to-your-website.jade diff --git a/app.js b/app.js index 3de9ae9f85..b4b047c80d 100644 --- a/app.js +++ b/app.js @@ -269,7 +269,7 @@ 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/are-there-people-that-are-already-benefiting-from-your-services', nonprofitController.areTherePeopleThatAreAlreadyBenefitingFromYourServices); app.get('/nonprofits/in-exchange-we-ask', nonprofitController.inExchangeWeAsk); app.get('/nonprofits/ok-with-javascript', nonprofitController.okWithJavaScript); app.get('/nonprofits/other-solutions', nonprofitController.otherSolutions); diff --git a/controllers/nonprofits.js b/controllers/nonprofits.js index 3ac9eb4508..8ea6a0f295 100644 --- a/controllers/nonprofits.js +++ b/controllers/nonprofits.js @@ -38,8 +38,8 @@ exports.otherSolutions = function(req, res) { }); }; -exports.areTherePeopleAlreadyBenefitingFromYourServices = function(req, res) { - res.render('nonprofits/are-there-people-already-benefiting-from-your-services', { +exports.areTherePeopleThatAreAlreadyBenefitingFromYourServices = function(req, res) { + res.render('nonprofits/are-there-people-that-are-already-benefiting-from-your-services', { title: 'Are there people already benefiting from your services' }); }; 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 index 63d99b8dd6..e9e18c1b3b 100644 --- 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 @@ -7,6 +7,6 @@ block content .spacer .row .col-xs-6 - a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/') Yes + a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/ok-with-javascript') Yes .col-xs-6 - a.btn.btn-warning.btn-big.btn-block(href='/nonprofits/') No \ No newline at end of file + a.btn.btn-warning.btn-big.btn-block(href='/nonprofits/other-solutions') No \ 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 index 6fac5ad44e..deb2ad8f77 100644 --- a/views/nonprofits/how-can-free-code-camp-help-you.jade +++ b/views/nonprofits/how-can-free-code-camp-help-you.jade @@ -39,4 +39,4 @@ block content 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 + a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/are-there-people-that-are-already-benefiting-from-your-services') 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 index 0dcb363d0c..87e6a90181 100644 --- a/views/nonprofits/in-exchange-we-ask.jade +++ b/views/nonprofits/in-exchange-we-ask.jade @@ -1,16 +1,17 @@ extends ../layout block content - .jumbotron.text-left - h1.hug-top Nonprofit Sign Up + .jumbotron + h1.hug-top.text-center 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. + h3 + 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! + a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/what-does-your-nonprofit-do') 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/link-us-to-your-website.jade b/views/nonprofits/link-us-to-your-website.jade new file mode 100644 index 0000000000..481f527141 --- /dev/null +++ b/views/nonprofits/link-us-to-your-website.jade @@ -0,0 +1,10 @@ +.jumbotron.text-center + h1.hug-top Nonprofit Sign Up + .spacer + h2 In 140 characters or less, what does your nonprofit do? For whom? + .spacer + .formgroup + .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(href='/nonprofits/tell-us-your-name') Submit \ No newline at end of file diff --git a/views/nonprofits/ok-with-javascript.jade b/views/nonprofits/ok-with-javascript.jade index 10c1dc9841..adeee64a43 100644 --- a/views/nonprofits/ok-with-javascript.jade +++ b/views/nonprofits/ok-with-javascript.jade @@ -7,6 +7,6 @@ block content .spacer .row .col-xs-6 - a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/how-can-free-code-camp-help-you') Sounds good! + a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/in-exchange-we-ask') 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 index 4f58b76668..b9a19a3b36 100644 --- a/views/nonprofits/other-solutions.jade +++ b/views/nonprofits/other-solutions.jade @@ -1,12 +1,5 @@ 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 + h1.hug-top Here are some other solutions we recommend + .spacer \ No newline at end of file diff --git a/views/nonprofits/what-does-your-nonprofit-do.jade b/views/nonprofits/what-does-your-nonprofit-do.jade index 3718e46170..92b65b17f4 100644 --- a/views/nonprofits/what-does-your-nonprofit-do.jade +++ b/views/nonprofits/what-does-your-nonprofit-do.jade @@ -5,19 +5,22 @@ block content .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 + .formgroup + .input-group + input.form-control.big-text-field.field-responsive#what-does-the-nonprofit-do(type='text', maxlength='140', autofocus='') + span.input-group-btn + button.btn.btn-big.btn-primary.btn-responsive(href='/nonprofits/link-us-to-your-website') Submit + .text-left + span#what-does-the-nonprofit-do-feedback + + script. + var text_max = 140; + $('#what-does-the-nonprofit-do-feedback').html(text_max + ' characters remaining'); + $('#what-does-the-nonprofit-do').keyup(function (e) { + if (e.which === 13 || e === 13) { + $('#submit-comment-to-comment').click(); + } + var text_length = $('#what-does-the-nonprofit-do').val().length; + var text_remaining = text_max - text_length; + $('#what-does-the-nonprofit-do-feedback').html(text_remaining + ' characters remaining'); + }); \ No newline at end of file From 7d4c30c502c28d56aa1e96166071184e2bab0784 Mon Sep 17 00:00:00 2001 From: Michael Q Larson Date: Wed, 25 Mar 2015 14:18:27 -0700 Subject: [PATCH 6/9] start adding progress bar to nonprofit onboarding --- public/css/main.less | 3 +++ views/nonprofits/ok-with-javascript.jade | 6 +++++- ...ur-nonprofit-project-application-has-been-submitted.jade | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/public/css/main.less b/public/css/main.less index 09ebb557ea..3e8267ed57 100644 --- a/public/css/main.less +++ b/public/css/main.less @@ -880,6 +880,9 @@ iframe.iphone { background-color: #EEEEEE; } +.gray-text { + color: gray; +} //uncomment this to see the dimensions of all elements outlined in red //* { // border-color: red; diff --git a/views/nonprofits/ok-with-javascript.jade b/views/nonprofits/ok-with-javascript.jade index adeee64a43..9a3b65d8c7 100644 --- a/views/nonprofits/ok-with-javascript.jade +++ b/views/nonprofits/ok-with-javascript.jade @@ -3,7 +3,11 @@ 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. + .progress + .progress-bar(role='progressbar', aria-valuenow='60', aria-valuemin='0', aria-valuemax='100', style='width: 60%;') + span.sr-only 60% Complete + h3.gray-text Step 4 of 9 + h2 Our campers are learning to code using modern full stack JavaScript technologies like Node.js. We do not build or maintain Wordpress, Drupal, or other non-JavaScript based frameworks. .spacer .row .col-xs-6 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 e69de29bb2..fcc8c17a87 100644 --- a/views/nonprofits/your-nonprofit-project-application-has-been-submitted.jade +++ b/views/nonprofits/your-nonprofit-project-application-has-been-submitted.jade @@ -0,0 +1,4 @@ +.jumbotron.text-center + h1.hug-top Nonprofit Sign Up + .spacer + 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 From d64b5c571863918551953a214417d8e17e483fcf Mon Sep 17 00:00:00 2001 From: Michael Q Larson Date: Wed, 25 Mar 2015 15:25:19 -0700 Subject: [PATCH 7/9] add progress bar to nonprofit project proposal wizard --- app.js | 5 +- controllers/nonprofits.js | 56 ++++++++++++------- ...already-benefiting-from-your-services.jade | 2 +- .../are-you-with-a-registered-nonprofit.jade | 18 +++--- .../how-can-free-code-camp-help-you.jade | 2 +- views/nonprofits/in-exchange-we-ask.jade | 2 +- views/nonprofits/link-us-to-your-website.jade | 2 +- views/nonprofits/ok-with-javascript.jade | 6 +- views/nonprofits/tell-us-your-email.jade | 12 ++++ .../tell-us-your-name-and-email.jade | 0 views/nonprofits/tell-us-your-name.jade | 12 ++++ .../what-does-your-nonprofit-do.jade | 2 +- ...roject-application-has-been-submitted.jade | 10 ++-- .../nonprofit-application-progress-bar.jade | 6 ++ 14 files changed, 90 insertions(+), 45 deletions(-) create mode 100644 views/nonprofits/tell-us-your-email.jade delete mode 100644 views/nonprofits/tell-us-your-name-and-email.jade create mode 100644 views/nonprofits/tell-us-your-name.jade create mode 100644 views/partials/nonprofit-application-progress-bar.jade diff --git a/app.js b/app.js index def618a07c..65c8218c65 100644 --- a/app.js +++ b/app.js @@ -15,7 +15,7 @@ process.on('uncaughtException', function (err) { }); var express = require('express'), - accepts = require('accepts'), + //accepts = require('accepts'), cookieParser = require('cookie-parser'), compress = require('compression'), session = require('express-session'), @@ -284,7 +284,8 @@ 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/tell-us-your-name', nonprofitController.tellUsYourName); +app.get('/nonprofits/tell-us-your-email', nonprofitController.tellUsYourEmail); app.get('/nonprofits/your-nonprofit-project-application-has-been-submitted', nonprofitController.yourNonprofitProjectApplicationHasBeenSubmitted); app.get( diff --git a/controllers/nonprofits.js b/controllers/nonprofits.js index 8ea6a0f295..144c5258ef 100644 --- a/controllers/nonprofits.js +++ b/controllers/nonprofits.js @@ -22,55 +22,65 @@ exports.nonprofitsHome = function(req, res) { exports.areYouWithARegisteredNonprofit = function(req, res) { 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', + step: 1 }); }; exports.howCanFreeCodeCampHelpYou = function(req, res) { res.render('nonprofits/how-can-free-code-camp-help-you', { - title: 'Are you with a with a registered nonprofit' + title: 'Are you with a with a registered nonprofit', + step: 2 }); }; -exports.otherSolutions = function(req, res) { - res.render('nonprofits/other-solutions', { - title: 'Here are some other possible solutions for you' - }); -}; exports.areTherePeopleThatAreAlreadyBenefitingFromYourServices = function(req, res) { res.render('nonprofits/are-there-people-that-are-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 ...' + title: 'Are there people already benefiting from your services', + step: 3 }); }; exports.okWithJavaScript = function(req, res) { res.render('nonprofits/ok-with-javascript', { - title: 'Are you OK with us using JavaScript' + title: 'Are you OK with us using JavaScript', + step: 4 + }); +}; + +exports.inExchangeWeAsk = function(req, res) { + res.render('nonprofits/in-exchange-we-ask', { + title: 'In exchange we ask that you ...', + step: 5 }); }; exports.whatDoesYourNonprofitDo = function(req, res) { res.render('nonprofits/what-does-your-nonprofit-do', { - title: 'What does your nonprofit do?' + title: 'What does your nonprofit do?', + step: 6 }); }; exports.linkUsToYourWebsite = function(req, res) { res.render('nonprofits/link-us-to-your-website', { - title: 'Link us to your website' + title: 'Link us to your website', + step: 7 }); }; -exports.tellUsYourNameAndEmail = function(req, res) { - res.render('nonprofits/tell-us-your-name-and-email', { - title: 'Tell us your name and email address' +exports.tellUsYourEmail = function(req, res) { + res.render('nonprofits/tell-us-your-email', { + title: 'Tell us your name', + step: 8 + }); +}; + +exports.tellUsYourName = function(req, res) { + res.render('nonprofits/tell-us-your-name', { + title: 'Tell us your name', + step: 9 }); }; @@ -79,3 +89,9 @@ exports.yourNonprofitProjectApplicationHasBeenSubmitted = function(req, res) { title: 'Your Nonprofit Project application has been submitted!' }); }; + +exports.otherSolutions = function(req, res) { + res.render('nonprofits/other-solutions', { + title: 'Here are some other possible solutions for you' + }); +}; 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 index e9e18c1b3b..5f82c3c82b 100644 --- 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 @@ -2,7 +2,7 @@ extends ../layout block content .jumbotron.text-center h1.hug-top Nonprofit Sign Up - .spacer + include ../partials/nonprofit-application-progress-bar h2 We build solutions for nonprofits who are already serving a need. Are there people who already benefit from your services? .spacer .row diff --git a/views/nonprofits/are-you-with-a-registered-nonprofit.jade b/views/nonprofits/are-you-with-a-registered-nonprofit.jade index ce778cec2a..c901d7dbbb 100644 --- a/views/nonprofits/are-you-with-a-registered-nonprofit.jade +++ b/views/nonprofits/are-you-with-a-registered-nonprofit.jade @@ -1,12 +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 + h1.hug-top Nonprofit Sign Up + include ../partials/nonprofit-application-progress-bar + 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/how-can-free-code-camp-help-you.jade b/views/nonprofits/how-can-free-code-camp-help-you.jade index deb2ad8f77..4c0dab17b4 100644 --- a/views/nonprofits/how-can-free-code-camp-help-you.jade +++ b/views/nonprofits/how-can-free-code-camp-help-you.jade @@ -2,7 +2,7 @@ extends ../layout block content .jumbotron.text-center h1.hug-top Nonprofit Sign Up - .spacer + include ../partials/nonprofit-application-progress-bar h2 How can Free Code Camp help you? .spacer .row.text-center.negative-35 diff --git a/views/nonprofits/in-exchange-we-ask.jade b/views/nonprofits/in-exchange-we-ask.jade index 87e6a90181..beb4b20da5 100644 --- a/views/nonprofits/in-exchange-we-ask.jade +++ b/views/nonprofits/in-exchange-we-ask.jade @@ -2,7 +2,7 @@ extends ../layout block content .jumbotron h1.hug-top.text-center Nonprofit Sign Up - .spacer + include ../partials/nonprofit-application-progress-bar h2 Great! In exchange for our help, we ask only that you: h3 ol diff --git a/views/nonprofits/link-us-to-your-website.jade b/views/nonprofits/link-us-to-your-website.jade index 481f527141..720aa6f338 100644 --- a/views/nonprofits/link-us-to-your-website.jade +++ b/views/nonprofits/link-us-to-your-website.jade @@ -1,6 +1,6 @@ .jumbotron.text-center h1.hug-top Nonprofit Sign Up - .spacer + include ../partials/nonprofit-application-progress-bar h2 In 140 characters or less, what does your nonprofit do? For whom? .spacer .formgroup diff --git a/views/nonprofits/ok-with-javascript.jade b/views/nonprofits/ok-with-javascript.jade index 9a3b65d8c7..1835218868 100644 --- a/views/nonprofits/ok-with-javascript.jade +++ b/views/nonprofits/ok-with-javascript.jade @@ -2,11 +2,7 @@ extends ../layout block content .jumbotron.text-center h1.hug-top Nonprofit Sign Up - .spacer - .progress - .progress-bar(role='progressbar', aria-valuenow='60', aria-valuemin='0', aria-valuemax='100', style='width: 60%;') - span.sr-only 60% Complete - h3.gray-text Step 4 of 9 + include ../partials/nonprofit-application-progress-bar h2 Our campers are learning to code using modern full stack JavaScript technologies like Node.js. We do not build or maintain Wordpress, Drupal, or other non-JavaScript based frameworks. .spacer .row diff --git a/views/nonprofits/tell-us-your-email.jade b/views/nonprofits/tell-us-your-email.jade new file mode 100644 index 0000000000..95318faf3e --- /dev/null +++ b/views/nonprofits/tell-us-your-email.jade @@ -0,0 +1,12 @@ +extends ../layout +block content + .jumbotron.text-center + h1.hug-top Nonprofit Sign Up + include ../partials/nonprofit-application-progress-bar + h2 Please tell us your email + .spacer + .formgroup + .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(href='/nonprofits/your-nonprofit-project-application-has-been-submitted') Submit \ 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 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/views/nonprofits/tell-us-your-name.jade b/views/nonprofits/tell-us-your-name.jade new file mode 100644 index 0000000000..a440d89247 --- /dev/null +++ b/views/nonprofits/tell-us-your-name.jade @@ -0,0 +1,12 @@ +extends ../layout +block content + .jumbotron.text-center + h1.hug-top Nonprofit Sign Up + include ../partials/nonprofit-application-progress-bar + h2 Please tell us your name + .spacer + .formgroup + .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(href='/nonprofits/tell-us-your-email') Submit \ No newline at end of file diff --git a/views/nonprofits/what-does-your-nonprofit-do.jade b/views/nonprofits/what-does-your-nonprofit-do.jade index 92b65b17f4..8220e78f08 100644 --- a/views/nonprofits/what-does-your-nonprofit-do.jade +++ b/views/nonprofits/what-does-your-nonprofit-do.jade @@ -2,7 +2,7 @@ extends ../layout block content .jumbotron.text-center h1.hug-top Nonprofit Sign Up - .spacer + include ../partials/nonprofit-application-progress-bar h2 In 140 characters or less, what does your nonprofit do? For whom? .spacer .formgroup 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 fcc8c17a87..7190fd14ec 100644 --- a/views/nonprofits/your-nonprofit-project-application-has-been-submitted.jade +++ b/views/nonprofits/your-nonprofit-project-application-has-been-submitted.jade @@ -1,4 +1,6 @@ -.jumbotron.text-center - h1.hug-top Nonprofit Sign Up - .spacer - 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 +extends ../layout +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 diff --git a/views/partials/nonprofit-application-progress-bar.jade b/views/partials/nonprofit-application-progress-bar.jade new file mode 100644 index 0000000000..283da6db44 --- /dev/null +++ b/views/partials/nonprofit-application-progress-bar.jade @@ -0,0 +1,6 @@ +.spacer +.progress + .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 \ No newline at end of file From e78609171dfa443744044c310d5b3b9de1ecfa1e Mon Sep 17 00:00:00 2001 From: Michael Q Larson Date: Thu, 26 Mar 2015 23:33:52 -0700 Subject: [PATCH 8/9] continue work on the param-based funnel --- app.js | 5 +- controllers/nonprofits.js | 48 +++++++++++--- public/css/main.less | 5 +- .../are-you-with-a-registered-nonprofit.jade | 2 +- .../how-can-free-code-camp-help-you.jade | 64 ++++++++----------- views/nonprofits/in-exchange-we-ask.jade | 2 +- views/nonprofits/tell-us-your-name.jade | 11 ++-- 7 files changed, 80 insertions(+), 57 deletions(-) diff --git a/app.js b/app.js index 65c8218c65..83d758bb10 100644 --- a/app.js +++ b/app.js @@ -277,16 +277,17 @@ 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-that-are-already-benefiting-from-your-services', nonprofitController.areTherePeopleThatAreAlreadyBenefitingFromYourServices); 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/how-can-free-code-camp-help-you', nonprofitController.howCanFreeCodeCampHelpYou); +app.post('/nonprofits/how-can-free-code-camp-help-you', nonprofitController.howCanFreeCodeCampHelpYouPost); 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', nonprofitController.tellUsYourName); app.get('/nonprofits/tell-us-your-email', nonprofitController.tellUsYourEmail); app.get('/nonprofits/your-nonprofit-project-application-has-been-submitted', nonprofitController.yourNonprofitProjectApplicationHasBeenSubmitted); +app.get('/nonprofits/other-solutions', nonprofitController.otherSolutions); app.get( '/done-with-first-100-hours', diff --git a/controllers/nonprofits.js b/controllers/nonprofits.js index 144c5258ef..1b0b745b1d 100644 --- a/controllers/nonprofits.js +++ b/controllers/nonprofits.js @@ -27,35 +27,47 @@ exports.areYouWithARegisteredNonprofit = function(req, res) { }); }; -exports.howCanFreeCodeCampHelpYou = function(req, res) { - res.render('nonprofits/how-can-free-code-camp-help-you', { - title: 'Are you with a with a registered nonprofit', - step: 2 - }); -}; - - exports.areTherePeopleThatAreAlreadyBenefitingFromYourServices = function(req, res) { res.render('nonprofits/are-there-people-that-are-already-benefiting-from-your-services', { title: 'Are there people already benefiting from your services', - step: 3 + step: 2 }); }; exports.okWithJavaScript = function(req, res) { res.render('nonprofits/ok-with-javascript', { title: 'Are you OK with us using JavaScript', - step: 4 + step: 3 }); }; exports.inExchangeWeAsk = function(req, res) { res.render('nonprofits/in-exchange-we-ask', { title: 'In exchange we ask that you ...', + step: 4 + }); +}; + +exports.howCanFreeCodeCampHelpYou = function(req, res) { + res.render('nonprofits/how-can-free-code-camp-help-you', { + title: 'Are you with a with a registered nonprofit', step: 5 }); }; +exports.howCanFreeCodeCampHelpYouPost = function(req, res) { + var queryString = ''; + if (req.body.websites) { queryString += 'websites&'} + if (req.body.websites) { queryString += 'websites&'} + if (req.body.websites) { queryString += 'websites&'} + if (req.body.websites) { queryString += 'websites&'} + if (req.body.websites) { queryString += 'websites&'} + if (req.body.websites) { queryString += 'websites&'} + if (req.body.websites) { queryString += 'websites&'} + if (req.body.websites) { queryString += 'websites&'} + res.redirect('/nonprofits/tell-us-your-name?' + encodeURIComponent(queryString)); +}; + exports.whatDoesYourNonprofitDo = function(req, res) { res.render('nonprofits/what-does-your-nonprofit-do', { title: 'What does your nonprofit do?', @@ -63,6 +75,10 @@ exports.whatDoesYourNonprofitDo = function(req, res) { }); }; +exports.whatDoesYourNonprofitDoPost = function(req, res) { + res.redirect('nonprofits/link-us-to-your-website?' + req.params); +}; + exports.linkUsToYourWebsite = function(req, res) { res.render('nonprofits/link-us-to-your-website', { title: 'Link us to your website', @@ -70,6 +86,10 @@ exports.linkUsToYourWebsite = function(req, res) { }); }; +exports.linkUsToYourWebsitePost = function(req, res) { + res.redirect('nonprofits/tell-us-your-email?' + req.params); +}; + exports.tellUsYourEmail = function(req, res) { res.render('nonprofits/tell-us-your-email', { title: 'Tell us your name', @@ -77,6 +97,10 @@ exports.tellUsYourEmail = function(req, res) { }); }; +exports.tellUsYourEmailPost = function(req, res) { + res.redirect('nonprofits/tell-us-your-name?' + req.params); +}; + exports.tellUsYourName = function(req, res) { res.render('nonprofits/tell-us-your-name', { title: 'Tell us your name', @@ -84,6 +108,10 @@ exports.tellUsYourName = function(req, res) { }); }; +exports.tellUsYourNamePost = function(req, res) { +}; + + 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 3e8267ed57..ad76627718 100644 --- a/public/css/main.less +++ b/public/css/main.less @@ -880,9 +880,10 @@ iframe.iphone { background-color: #EEEEEE; } -.gray-text { - color: gray; +.checkbox-table label { + margin-left: 10px; } + //uncomment this to see the dimensions of all elements outlined in red //* { // border-color: red; diff --git a/views/nonprofits/are-you-with-a-registered-nonprofit.jade b/views/nonprofits/are-you-with-a-registered-nonprofit.jade index c901d7dbbb..4dc9a6e639 100644 --- a/views/nonprofits/are-you-with-a-registered-nonprofit.jade +++ b/views/nonprofits/are-you-with-a-registered-nonprofit.jade @@ -7,6 +7,6 @@ block content .spacer .row .col-xs-6 - a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/how-can-free-code-camp-help-you') Yes + a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/are-there-people-that-are-already-benefiting-from-your-services') 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/how-can-free-code-camp-help-you.jade b/views/nonprofits/how-can-free-code-camp-help-you.jade index 4c0dab17b4..5f2c95f4c1 100644 --- a/views/nonprofits/how-can-free-code-camp-help-you.jade +++ b/views/nonprofits/how-can-free-code-camp-help-you.jade @@ -4,39 +4,31 @@ block content h1.hug-top Nonprofit Sign Up include ../partials/nonprofit-application-progress-bar 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/are-there-people-that-are-already-benefiting-from-your-services') I've selected all that apply and am ready to move on \ No newline at end of file + form.text-left.form-inline(role='form', method='POST', action="/nonprofits/how-can-free-code-camp-help-you/") + input(type='hidden', name='_csrf', value=_csrf) + h3.col-xs-12.col-sm-offset-5.checkbox-table + .col-xs-12 + input.checkbox(type='checkbox', name='websites') + label.ion-android-globe   Websites + .col-xs-12 + input.checkbox(type='checkbox', name='donation-systems') + label.ion-card   Donation Systems + .col-xs-12 + input.checkbox(type='checkbox', name='volunteer-systems') + label.ion-android-calendar   Volunteer Systems + .col-xs-12 + input.checkbox(type='checkbox', name='inventory-systems') + label.ion-ios-box   Inventory Systems + .col-xs-12 + input.checkbox(type='checkbox', name='e-learning-platforms') + label.ion-university   E-learning Platforms + .col-xs-12 + input.checkbox(type='checkbox', name='web-forms') + label.ion-ios-list   Web Forms + .col-xs-12 + input.checkbox(type='checkbox', name='community-tools') + label.ion-ios-people   Community Tools + .col-xs-12 + input.checkbox(type='checkbox', name='other-tools') + label.ion-settings   Other tools + button.btn.btn-primary.btn-big.btn-block(type='submit') 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 index beb4b20da5..e6b02c0877 100644 --- a/views/nonprofits/in-exchange-we-ask.jade +++ b/views/nonprofits/in-exchange-we-ask.jade @@ -12,6 +12,6 @@ block content .spacer .row .col-xs-6 - a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/what-does-your-nonprofit-do') Sounds good! + 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/tell-us-your-name.jade b/views/nonprofits/tell-us-your-name.jade index a440d89247..fe0d063e61 100644 --- a/views/nonprofits/tell-us-your-name.jade +++ b/views/nonprofits/tell-us-your-name.jade @@ -5,8 +5,9 @@ block content include ../partials/nonprofit-application-progress-bar h2 Please tell us your name .spacer - .formgroup - .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(href='/nonprofits/tell-us-your-email') Submit \ No newline at end of file + form(role='form', action="/nonprofits/tell-us-your-name-post", method='POST', novalidate='novalidate', name='nonprofitForm') + .formgroup + .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 \ No newline at end of file From 94b6cae3ece95cd7bfebc6954da55e004299f6c2 Mon Sep 17 00:00:00 2001 From: Michael Q Larson Date: Fri, 27 Mar 2015 12:36:21 -0700 Subject: [PATCH 9/9] apply Nathan's insights into multistep form' --- app.js | 1 - controllers/nonprofits.js | 30 ++-------------- .../how-can-free-code-camp-help-you.jade | 21 ++++++----- views/nonprofits/link-us-to-your-website.jade | 24 +++++++------ views/nonprofits/tell-us-your-email.jade | 12 ++++--- views/nonprofits/tell-us-your-name.jade | 4 +-- .../what-does-your-nonprofit-do.jade | 16 +++++---- .../nonprofit-application-progress-bar.jade | 35 ++++++++++++++++++- views/stories/preliminary-submit.jade | 10 +++++- 9 files changed, 88 insertions(+), 65 deletions(-) diff --git a/app.js b/app.js index 52af8dea7b..ff745098db 100644 --- a/app.js +++ b/app.js @@ -281,7 +281,6 @@ app.get('/nonprofits/are-there-people-that-are-already-benefiting-from-your-serv app.get('/nonprofits/in-exchange-we-ask', nonprofitController.inExchangeWeAsk); app.get('/nonprofits/ok-with-javascript', nonprofitController.okWithJavaScript); app.get('/nonprofits/how-can-free-code-camp-help-you', nonprofitController.howCanFreeCodeCampHelpYou); -app.post('/nonprofits/how-can-free-code-camp-help-you', nonprofitController.howCanFreeCodeCampHelpYouPost); 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', nonprofitController.tellUsYourName); diff --git a/controllers/nonprofits.js b/controllers/nonprofits.js index 1b0b745b1d..4ceda4de1e 100644 --- a/controllers/nonprofits.js +++ b/controllers/nonprofits.js @@ -55,30 +55,14 @@ exports.howCanFreeCodeCampHelpYou = function(req, res) { }); }; -exports.howCanFreeCodeCampHelpYouPost = function(req, res) { - var queryString = ''; - if (req.body.websites) { queryString += 'websites&'} - if (req.body.websites) { queryString += 'websites&'} - if (req.body.websites) { queryString += 'websites&'} - if (req.body.websites) { queryString += 'websites&'} - if (req.body.websites) { queryString += 'websites&'} - if (req.body.websites) { queryString += 'websites&'} - if (req.body.websites) { queryString += 'websites&'} - if (req.body.websites) { queryString += 'websites&'} - res.redirect('/nonprofits/tell-us-your-name?' + encodeURIComponent(queryString)); -}; - exports.whatDoesYourNonprofitDo = function(req, res) { res.render('nonprofits/what-does-your-nonprofit-do', { + existingParams: req.params, title: 'What does your nonprofit do?', step: 6 }); }; -exports.whatDoesYourNonprofitDoPost = function(req, res) { - res.redirect('nonprofits/link-us-to-your-website?' + req.params); -}; - exports.linkUsToYourWebsite = function(req, res) { res.render('nonprofits/link-us-to-your-website', { title: 'Link us to your website', @@ -86,10 +70,6 @@ exports.linkUsToYourWebsite = function(req, res) { }); }; -exports.linkUsToYourWebsitePost = function(req, res) { - res.redirect('nonprofits/tell-us-your-email?' + req.params); -}; - exports.tellUsYourEmail = function(req, res) { res.render('nonprofits/tell-us-your-email', { title: 'Tell us your name', @@ -97,10 +77,6 @@ exports.tellUsYourEmail = function(req, res) { }); }; -exports.tellUsYourEmailPost = function(req, res) { - res.redirect('nonprofits/tell-us-your-name?' + req.params); -}; - exports.tellUsYourName = function(req, res) { res.render('nonprofits/tell-us-your-name', { title: 'Tell us your name', @@ -108,9 +84,9 @@ exports.tellUsYourName = function(req, res) { }); }; -exports.tellUsYourNamePost = function(req, res) { -}; +exports.finishApplication = function(req, res) { +}; exports.yourNonprofitProjectApplicationHasBeenSubmitted = function(req, res) { res.render('nonprofits/your-nonprofit-project-application-has-been-submitted', { diff --git a/views/nonprofits/how-can-free-code-camp-help-you.jade b/views/nonprofits/how-can-free-code-camp-help-you.jade index 5f2c95f4c1..3aeec6490a 100644 --- a/views/nonprofits/how-can-free-code-camp-help-you.jade +++ b/views/nonprofits/how-can-free-code-camp-help-you.jade @@ -4,31 +4,30 @@ block content h1.hug-top Nonprofit Sign Up include ../partials/nonprofit-application-progress-bar h2 How can Free Code Camp help you? - form.text-left.form-inline(role='form', method='POST', action="/nonprofits/how-can-free-code-camp-help-you/") - input(type='hidden', name='_csrf', value=_csrf) + .text-left.form-inline h3.col-xs-12.col-sm-offset-5.checkbox-table .col-xs-12 - input.checkbox(type='checkbox', name='websites') + input.checkbox(type='checkbox', id='websites') label.ion-android-globe   Websites .col-xs-12 - input.checkbox(type='checkbox', name='donation-systems') + input.checkbox(type='checkbox', id='donationSystems') label.ion-card   Donation Systems .col-xs-12 - input.checkbox(type='checkbox', name='volunteer-systems') + input.checkbox(type='checkbox', id='volunteerSystems') label.ion-android-calendar   Volunteer Systems .col-xs-12 - input.checkbox(type='checkbox', name='inventory-systems') + input.checkbox(type='checkbox', id='inventorySystems') label.ion-ios-box   Inventory Systems .col-xs-12 - input.checkbox(type='checkbox', name='e-learning-platforms') + input.checkbox(type='checkbox', id='eLearningPlatforms') label.ion-university   E-learning Platforms .col-xs-12 - input.checkbox(type='checkbox', name='web-forms') + input.checkbox(type='checkbox', id='webForms') label.ion-ios-list   Web Forms .col-xs-12 - input.checkbox(type='checkbox', name='community-tools') + input.checkbox(type='checkbox', id='communityTools') label.ion-ios-people   Community Tools .col-xs-12 - input.checkbox(type='checkbox', name='other-tools') + input.checkbox(type='checkbox', id='otherTools') label.ion-settings   Other tools - button.btn.btn-primary.btn-big.btn-block(type='submit') I've selected all that apply and am ready to move on \ No newline at end of file + button#next-step.btn.btn-primary.btn-big.btn-block(type='submit') I've selected all that apply and am ready to move on \ No newline at end of file diff --git a/views/nonprofits/link-us-to-your-website.jade b/views/nonprofits/link-us-to-your-website.jade index 720aa6f338..bdb59455ad 100644 --- a/views/nonprofits/link-us-to-your-website.jade +++ b/views/nonprofits/link-us-to-your-website.jade @@ -1,10 +1,14 @@ -.jumbotron.text-center - h1.hug-top Nonprofit Sign Up - include ../partials/nonprofit-application-progress-bar - h2 In 140 characters or less, what does your nonprofit do? For whom? - .spacer - .formgroup - .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(href='/nonprofits/tell-us-your-name') Submit \ No newline at end of file +extends ../layout +block content + .jumbotron.text-center + h1.hug-top Nonprofit Sign Up + include ../partials/nonprofit-application-progress-bar + h2 Link us to the website, blog, or social media page that best represents your organization. + .spacer + form(role='form', method='GET', action="/nonprofits/tell-us-your-email/?" + existingParams) + input(type='hidden', name='_csrf', value=_csrf) + .formgroup + .input-group + input.form-control.big-text-field.field-responsive(type='text', name='link', autocomplete='off', maxlength='500', autofocus='') + span.input-group-btn + button.btn.btn-big.btn-primary.btn-responsive Submit \ No newline at end of file diff --git a/views/nonprofits/tell-us-your-email.jade b/views/nonprofits/tell-us-your-email.jade index 95318faf3e..3bd8918f6b 100644 --- a/views/nonprofits/tell-us-your-email.jade +++ b/views/nonprofits/tell-us-your-email.jade @@ -5,8 +5,10 @@ block content include ../partials/nonprofit-application-progress-bar h2 Please tell us your email .spacer - .formgroup - .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(href='/nonprofits/your-nonprofit-project-application-has-been-submitted') Submit \ No newline at end of file + form(role='form', method='GET', novalidate='novalidate', name='nonprofitForm', action="/nonprofits/tell-us-your-name/") + input(type='hidden', name='_csrf', value=_csrf) + .formgroup + .input-group + input.form-control.big-text-field.field-responsive(type='text', name='email', autocomplete='off', maxlength='500', autofocus='') + span.input-group-btn + button.btn.btn-big.btn-primary.btn-responsive Submit \ No newline at end of file diff --git a/views/nonprofits/tell-us-your-name.jade b/views/nonprofits/tell-us-your-name.jade index fe0d063e61..915c0b3258 100644 --- a/views/nonprofits/tell-us-your-name.jade +++ b/views/nonprofits/tell-us-your-name.jade @@ -5,9 +5,9 @@ block content include ../partials/nonprofit-application-progress-bar h2 Please tell us your name .spacer - form(role='form', action="/nonprofits/tell-us-your-name-post", method='POST', novalidate='novalidate', name='nonprofitForm') + form(role='form', method='POST', novalidate='novalidate', name='nonprofitForm', action="/nonprofits/finish-application/") .formgroup .input-group - input.form-control.big-text-field.field-responsive(type='text', maxlength='140', autofocus='') + input.form-control.big-text-field.field-responsive(type='text', name='name', autocomplete='off', maxlength='140', autofocus='') span.input-group-btn button.btn.btn-big.btn-primary.btn-responsive Submit \ No newline at end of file diff --git a/views/nonprofits/what-does-your-nonprofit-do.jade b/views/nonprofits/what-does-your-nonprofit-do.jade index 8220e78f08..166cb71418 100644 --- a/views/nonprofits/what-does-your-nonprofit-do.jade +++ b/views/nonprofits/what-does-your-nonprofit-do.jade @@ -5,13 +5,15 @@ block content include ../partials/nonprofit-application-progress-bar h2 In 140 characters or less, what does your nonprofit do? For whom? .spacer - .formgroup - .input-group - input.form-control.big-text-field.field-responsive#what-does-the-nonprofit-do(type='text', maxlength='140', autofocus='') - span.input-group-btn - button.btn.btn-big.btn-primary.btn-responsive(href='/nonprofits/link-us-to-your-website') Submit - .text-left - span#what-does-the-nonprofit-do-feedback + form(role='form', method='GET', action="/nonprofits/link-us-to-your-website/") + input(type='hidden', name='_csrf', value=_csrf) + .formgroup + .input-group + input.form-control.big-text-field.field-responsive#what-does-the-nonprofit-do(type='text', maxlength='140', autofocus='', autocomplete='off', name='mission') + span.input-group-btn + button.btn.btn-big.btn-primary.btn-responsive(href='/nonprofits/link-us-to-your-website') Submit + .text-left + span#what-does-the-nonprofit-do-feedback script. var text_max = 140; diff --git a/views/partials/nonprofit-application-progress-bar.jade b/views/partials/nonprofit-application-progress-bar.jade index 283da6db44..440bb67262 100644 --- a/views/partials/nonprofit-application-progress-bar.jade +++ b/views/partials/nonprofit-application-progress-bar.jade @@ -3,4 +3,37 @@ .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 \ No newline at end of file +h3.gray-text.text-center Step #{step} of 9 + + +script. + $('#story-url').on('keypress', function (e) { + if (e.which === 13 || e === 13) { + $('#preliminary-story-submit').click(); + } + }); + var preliminaryStorySubmit = function preliminaryStorySubmit() { + var storyURL = $('#story-url').val(); + $('#preliminary-story-submit').attr('disabled', 'disabled'); + $.post('/stories/preliminary', + { + data: { + url: storyURL + } + }) + .fail(function (xhr, textStatus, errorThrown) { + $('#preliminary-story-submit').attr('disabled', false); + }) + .done(function (data, textStatus, xhr) { + if (data.alreadyPosted) { + window.location = data.storyURL; + } else { + window.location = '/stories/submit/new-story?url=' + + encodeURIComponent(data.storyURL) + + '&title=' + encodeURIComponent(data.storyTitle) + + '&image=' + encodeURIComponent(data.storyImage) + + '&description=' + encodeURIComponent(data.storyMetaDescription); + } + }); + } + $('#preliminary-story-submit').on('click', preliminaryStorySubmit); \ No newline at end of file diff --git a/views/stories/preliminary-submit.jade b/views/stories/preliminary-submit.jade index 31ef779fcd..4bc8ba873c 100644 --- a/views/stories/preliminary-submit.jade +++ b/views/stories/preliminary-submit.jade @@ -44,4 +44,12 @@ } }); } - $('#preliminary-story-submit').on('click', preliminaryStorySubmit); \ No newline at end of file + $('#preliminary-story-submit').on('click', preliminaryStorySubmit); + + + arr = $( "h3 input:checked" ) + .map(function() { + return this.id; + }) + .get() + .join('&'); \ No newline at end of file