diff --git a/app.js b/app.js index 18a6516ce4..ecc99cd09b 100644 --- a/app.js +++ b/app.js @@ -228,16 +228,22 @@ app.post('/email-signup', userController.postEmailSignup); app.post('/email-signin', userController.postLogin); app.get('/nonprofits', contactController.getNonprofitsForm); app.post('/nonprofits', contactController.postNonprofitsForm); + app.get( '/done-with-first-100-hours', + passportConf.isAuthenticated, contactController.getDoneWithFirst100Hours ); app.post( '/done-with-first-100-hours', + passportConf.isAuthenticated, contactController.postDoneWithFirst100Hours ); - -// # Protected routes, user must be logged in. +app.get( + '/nonprofit-project-instructions', + passportConf.isAuthenticated, + resourcesController.nonprofitProjectInstructions +); app.post( '/update-progress', passportConf.isAuthenticated, diff --git a/controllers/challenges.js b/controllers/challenges.js index 96170f433b..9d3b325df6 100644 --- a/controllers/challenges.js +++ b/controllers/challenges.js @@ -24,6 +24,25 @@ exports.returnChallenge = function(req, res, next) { 'ANNIHILATED', 'NUKED' ]; + var compliments = [ + "You've got the power!", + "Nicely done!", + "Rock and roll!", + "High five!", + "Bravo!", + "Encore!", + "Challenge destroyed!", + "Power level 9000!", + "Most efficient!", + "Party on Wayne!", + "You've got the touch!", + "You're on fire!", + "Don't hurt 'em, Hammer!", + "The town is now red", + "To the nines!", + "Nothing but net!", + "Even grumpy cat is impressed" + ]; var phrases = [ "Shout it from on top of a mountain", "Tell everyone and their dogs", diff --git a/controllers/contact.js b/controllers/contact.js index 5406c5cda1..63af8ab765 100644 --- a/controllers/contact.js +++ b/controllers/contact.js @@ -47,10 +47,15 @@ module.exports = { }, getDoneWithFirst100Hours: function(req, res) { - res.render('contact/done-with-first-100-hours', { - title: - 'Congratulations on finishing the first 100 hours of Free Code Camp!' - }); + console.log(req.user.points) + if (req.user.points >= 53) { + res.render('contact/done-with-first-100-hours', { + title: 'Congratulations on finishing the first 100 hours of Free Code Camp!' + }); + } else { + req.flash('errors', {msg: 'Hm... have you finished all the challenges?'}); + res.redirect('/'); + } }, postDoneWithFirst100Hours: function(req, res) { @@ -68,7 +73,7 @@ module.exports = { return res.redirect('/done-with-first-100-hours'); } req.flash('success', {msg: 'Email has been sent successfully!'}); - res.redirect('/'); + res.redirect('/nonprofit-project-instructions'); }); } -}; +}; \ No newline at end of file diff --git a/controllers/resources.js b/controllers/resources.js index 9e2394f267..f073188bca 100644 --- a/controllers/resources.js +++ b/controllers/resources.js @@ -52,6 +52,12 @@ module.exports = { }); }, + nonprofitProjectInstructions: function nonprofitProjectInstructions(req, res) { + res.render('resources/nonprofit-project-instructions', { + title: 'Nonprofit Project Instructions' + }); + }, + gmailShortcuts: function gmailShortcuts(req, res) { res.render('resources/gmail-shortcuts', { title: 'These Gmail Shortcuts will save you Hours' diff --git a/controllers/user.js b/controllers/user.js index 07edf0e9f5..2421bdcbed 100644 --- a/controllers/user.js +++ b/controllers/user.js @@ -255,7 +255,7 @@ exports.returnUser = function(req, res, next) { }); } else { req.flash('errors', { - msg: "We couldn't find a Code Camper with that username." + msg: "404: We couldn't find a page with that url. Please double check the link." }); return res.redirect('/'); } diff --git a/views/contact/done-with-first-100-hours.jade b/views/contact/done-with-first-100-hours.jade index e4cc37079b..82406a6fee 100644 --- a/views/contact/done-with-first-100-hours.jade +++ b/views/contact/done-with-first-100-hours.jade @@ -5,7 +5,8 @@ block content .animated.fadeIn.delay-2 h2 You've completed the first 100 hours of Free Code Camp! .animated.fadeIn.delay-4 - h3 Now you're ready to continue your learning by building solutions for nonprofits! If you've completed all the Free Code Camp challenges and the Easy and Medium CoderByte challenges, enter your email below. We'll send you an email with the next steps. + h3 Now you're ready to continue your learning by building solutions for nonprofits! + h3 First, please enter your email below. br form.form-horizontal(role='form', action="/done-with-first-100-hours/", method='POST', novalidate='novalidate', name='doneWithFirst100HoursForm') input(type='hidden', name='_csrf', value=_csrf) diff --git a/views/partials/challenges.jade b/views/partials/challenges.jade index cef62c9d57..1257d4b388 100644 --- a/views/partials/challenges.jade +++ b/views/partials/challenges.jade @@ -5,4 +5,4 @@ h3 a(href="/challenges/#{challenge.challengeNumber}", class="#{ (cc && cc[challenge.challengeNumber] > 0) ? 'strikethrough' : '' }") #{challenge.name} |   (#{challenge.time} mins) -a.btn.btn-lg.btn-primary.btn-block(href="/done-with-first-100-hours", class="#{ ((cc && cc[53] === 0) || (!cc)) ? 'disabled' : '' }") I'm done with all the challenges! \ No newline at end of file +a.btn.btn-lg.btn-primary.btn-block(href="/done-with-first-100-hours", class="#{ ((points && points < 54) || (!points)) ? 'disabled' : '' }") I'm done with all the challenges! \ No newline at end of file diff --git a/views/resources/nonprofit-project-instructions.jade b/views/resources/nonprofit-project-instructions.jade new file mode 100644 index 0000000000..e121b5b817 --- /dev/null +++ b/views/resources/nonprofit-project-instructions.jade @@ -0,0 +1,21 @@ +extends ../layout +block content + .jumbotron + .col-sm-offset-1 + h1 Nonprofit projects + h3 It's time to apply what you've learned here at Free Code Camp. + h3 By the end of this process, you'll have a portfolio of live apps being used by real people. + h3 Please do the following immediately: + h4 + ol + li Complete this form:   + a(href="http://goo.gl/forms/f61dLt67t8" target="_blank") http://goo.gl/forms/f61dLt67t8 + | . + li Read this document, which will answer many questions you may have about our nonprofit projects:   + a(href="http://forum.freecodecamp.com/t/an-introduction-to-our-nonprofit-projects/856" target="_blank") http://forum.freecodecamp.com/t/an-introduction-to-our-nonprofit-projects/856 + | . + li We'll send you an invite to our Nonprofit Projects Trello board. Once we do, go there and add yourself to each of the nonprofit projects that interests you. + li Finish any unfinished easy and medium coderbyte challenges. These challenges serve as the Free Code Camp "exit test". You must be complete these before you can start working on nonprofit projects. + h4 Please email us if you have further questions:   + a(href="mailto:team@freecodecamp.com") team@freecodecamp.com + | . \ No newline at end of file