Merge branch 'staging' of https://github.com/freecodecamp/freecodecamp into staging
This commit is contained in:
		@@ -242,7 +242,7 @@
 | 
				
			|||||||
        [
 | 
					        [
 | 
				
			||||||
          "",
 | 
					          "",
 | 
				
			||||||
          "",
 | 
					          "",
 | 
				
			||||||
          "Free Code Camp will always be free. If you want to feel more motivated to earn our certificates faster, we encourage you to instead donate each month to a nonprofit.",
 | 
					          "Free Code Camp will always be free. If you want to feel more motivated to earn our certificates faster, we encourage you to instead pledge to donate to a nonprofit each day.",
 | 
				
			||||||
          ""
 | 
					          ""
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
      ],
 | 
					      ],
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -180,9 +180,9 @@ module.exports = function(app) {
 | 
				
			|||||||
                'could not find challenge block for ' + challenge.block
 | 
					                'could not find challenge block for ' + challenge.block
 | 
				
			||||||
              );
 | 
					              );
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            const nextBlock$ = blocks$.elementAt(blockIndex + 1);
 | 
					            const firstChallengeOfNextBlock$ = blocks$
 | 
				
			||||||
            const firstChallengeOfNextBlock$ = nextBlock$
 | 
					              .elementAtOrDefault(blockIndex + 1, {})
 | 
				
			||||||
              .map(block => block.challenges[0]);
 | 
					              .map(({ challenges = [] }) => challenges[0]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return blocks$
 | 
					            return blocks$
 | 
				
			||||||
              .elementAt(blockIndex)
 | 
					              .elementAt(blockIndex)
 | 
				
			||||||
@@ -211,6 +211,9 @@ module.exports = function(app) {
 | 
				
			|||||||
          });
 | 
					          });
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
      .map(nextChallenge => {
 | 
					      .map(nextChallenge => {
 | 
				
			||||||
 | 
					        if (!nextChallenge) {
 | 
				
			||||||
 | 
					          return null;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        nextChallengeName = nextChallenge.dashedName;
 | 
					        nextChallengeName = nextChallenge.dashedName;
 | 
				
			||||||
        return nextChallengeName;
 | 
					        return nextChallengeName;
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
@@ -267,12 +270,13 @@ module.exports = function(app) {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (dasherize(challenge.name) !== origChallengeName) {
 | 
					        if (dasherize(challenge.name) !== origChallengeName) {
 | 
				
			||||||
          return Observable.just(
 | 
					          let redirectUrl = `/challenges/${dasherize(challenge.name)}`;
 | 
				
			||||||
            '/challenges/' +
 | 
					
 | 
				
			||||||
            dasherize(challenge.name) +
 | 
					          if (solutionCode) {
 | 
				
			||||||
            '?solution=' +
 | 
					            redirectUrl += `?solution=${encodeURIComponent(solutionCode)}`;
 | 
				
			||||||
            encodeURIComponent(solutionCode)
 | 
					          }
 | 
				
			||||||
          );
 | 
					
 | 
				
			||||||
 | 
					          return Observable.just(redirectUrl);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // save user does nothing if user does not exist
 | 
					        // save user does nothing if user does not exist
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										15
									
								
								server/boot/commit.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								server/boot/commit.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					export default function commit(app) {
 | 
				
			||||||
 | 
					  const router = app.loopback.Router();
 | 
				
			||||||
 | 
					  router.get(
 | 
				
			||||||
 | 
					    '/commit',
 | 
				
			||||||
 | 
					    commitToNonprofit
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  app.use(router);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  function commitToNonprofit(req, res) {
 | 
				
			||||||
 | 
					    res.render('commit/', {
 | 
				
			||||||
 | 
					      title: 'Commit to a nonprofit. Commit to your goal.'
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										54
									
								
								server/views/commit/index.jade
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								server/views/commit/index.jade
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,54 @@
 | 
				
			|||||||
 | 
					extends ../layout
 | 
				
			||||||
 | 
					block content
 | 
				
			||||||
 | 
					    .panel.panel-info
 | 
				
			||||||
 | 
					        .panel-body
 | 
				
			||||||
 | 
					            h3.text-center Commit to yourself. Commit to a nonprofit.
 | 
				
			||||||
 | 
					            .col-xs-12.col-sm-6.col-sm-offset-3
 | 
				
			||||||
 | 
					                p Are you looking for a burst of motivation? Do you want to help nonprofits before you’re ready to code for them? You can do both by pledging a monthly donation to a nonprofit until you've earned either your Front End or Full Stack Development certificate. Join Commit below or click "maybe later".
 | 
				
			||||||
 | 
					            .col-xs-12.col-sm-6.col-sm-offset-3
 | 
				
			||||||
 | 
					                h4 Step 1: Choose your goal
 | 
				
			||||||
 | 
					                .radio
 | 
				
			||||||
 | 
					                    label
 | 
				
			||||||
 | 
					                        input(type='radio' id='front-end-development-certificate' name='goal')
 | 
				
			||||||
 | 
					                        | Front End Development Certificate (takes about 400 hours)
 | 
				
			||||||
 | 
					                .radio
 | 
				
			||||||
 | 
					                    label
 | 
				
			||||||
 | 
					                        input(type='radio' id='full-stack-development-certificate' name='goal')
 | 
				
			||||||
 | 
					                        | Full Stack Development Certificate (takes about 800 hours)
 | 
				
			||||||
 | 
					                .spacer
 | 
				
			||||||
 | 
					                h4 Step 2: Choose one of our nonprofits
 | 
				
			||||||
 | 
					                .row
 | 
				
			||||||
 | 
					                    .col-xs-12.col-sm-6
 | 
				
			||||||
 | 
					                        a(href="http://i.imgur.com/U1CyEuA.jpg" data-lightbox="img-enlarge")
 | 
				
			||||||
 | 
					                            img.img-responsive(src='http://i.imgur.com/U1CyEuA.jpg' alt="Girl Develop It participants coding at tables.")
 | 
				
			||||||
 | 
					                        .radio
 | 
				
			||||||
 | 
					                            label
 | 
				
			||||||
 | 
					                                input(type='radio' id='girl-develop-it' name='nonprofit')
 | 
				
			||||||
 | 
					                                | Girl Develop It is a nonprofit that provides in-person classes for women to learn to code.
 | 
				
			||||||
 | 
					                    .col-xs-12.col-sm-6
 | 
				
			||||||
 | 
					                        a(href="http://i.imgur.com/NERytFF.jpg" data-lightbox="img-enlarge")
 | 
				
			||||||
 | 
					                            img.img-responsive(src='http://i.imgur.com/NERytFF.jpg' alt="Vets in Tech participants standing together at a conference.")
 | 
				
			||||||
 | 
					                        .radio
 | 
				
			||||||
 | 
					                            label
 | 
				
			||||||
 | 
					                                input(type='radio' id='vets-in-tech' name='nonprofit')
 | 
				
			||||||
 | 
					                                | Vets in Tech is a nonprofit that helps veterans prepare for tech jobs.
 | 
				
			||||||
 | 
					                .spacer
 | 
				
			||||||
 | 
					                h4 Step 3: Choose your monthly pledge
 | 
				
			||||||
 | 
					                .radio
 | 
				
			||||||
 | 
					                    label
 | 
				
			||||||
 | 
					                        input(type='radio' id='5-dollar-pledge' name='pledge-amount')
 | 
				
			||||||
 | 
					                        | $5 per month
 | 
				
			||||||
 | 
					                .radio
 | 
				
			||||||
 | 
					                    label
 | 
				
			||||||
 | 
					                        input(type='radio' id='10-dollar-pledge' name='pledge-amount')
 | 
				
			||||||
 | 
					                        | $10 per month
 | 
				
			||||||
 | 
					                .radio
 | 
				
			||||||
 | 
					                    label
 | 
				
			||||||
 | 
					                        input(type='radio' id='50-dollar-pledge' name='pledge-amount')
 | 
				
			||||||
 | 
					                        | $50 per month
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                .spacer
 | 
				
			||||||
 | 
					                a.button.btn.btn-block.btn-primary(href='https://www.paypal.com/us/cgi-bin/webscr?cmd=_flow&SESSION=T3x0DY-bLMFXuhmjYZXs-BhmDoiXfuNh5BWad5VBcMomkkDSZY0b_-_W3HS&dispatch=5885d80a13c0db1f8e263663d3faee8d0b9dcb01a9b6dc564e45f62871326a5e') Commit
 | 
				
			||||||
 | 
					                .button-spacer
 | 
				
			||||||
 | 
					                a.button.btn.btn-block.btn-warning(href='/') Maybe later
 | 
				
			||||||
 | 
					                .spacer
 | 
				
			||||||
		Reference in New Issue
	
	Block a user