diff --git a/app.js b/app.js index d8034bacac..5310c51b83 100644 --- a/app.js +++ b/app.js @@ -122,14 +122,14 @@ app.use(express.static(path.join(__dirname, 'public'), { maxAge: week })); app.get('/', homeController.index); app.get('/curriculum', curriculumController.index); -app.get('/courses/:id', courseController.view); +app.get('/course/:id', courseController.view); app.get('/courses', courseController.index); -app.get('/challenges/:id', challengeController.view); -app.get('/challenges', challengeController.index); -//app.get('/challenges/first_website', challengeController.firstWebsite) -app.get('/challenges/first_pair_programming_session', challengeController.firstPairProgrammingSession) -//app.get('/challenges/first_dynamic_website', challengeController.firstDynamicWebsite) -//app.get('/challenges/first_codepen', challengeController.firstCodePen) +//app.get('/challenges/:id', challengeController.view); +//app.get('/challenges', challengeController.index); +app.get('/challenges/create-and-deploy-a-website', challengeController.createAndDeployAWebsite) +app.get('/challenges/challenges/add-dynamic-content-to-your-website', challengeController.experimentWithHtmlAndCssInCodepen) +app.get('/challenges/experiment-with-html-and-css-in-codepen', challengeController.addDynamicContentToYourWebsite) +app.get('/challenges/start-a-pair-programming-session', challengeController.startAPairProgrammingSession) app.get('/login', userController.getLogin); app.post('/login', userController.postLogin); app.get('/logout', userController.logout); @@ -179,27 +179,27 @@ app.get('/api/yahoo', apiController.getYahoo); */ app.get('/auth/instagram', passport.authenticate('instagram')); -app.get('/auth/instagram/callback', passport.authenticate('instagram', { failureRedirect: '/login' }), function(req, res) { +app.get('/auth/instagram/callback', passport.authenticate('instagram', { successRedirect: '/curriculum',failureRedirect: '/login' }), function(req, res) { res.redirect(req.session.returnTo || '/'); }); app.get('/auth/facebook', passport.authenticate('facebook', { scope: ['email', 'user_location'] })); -app.get('/auth/facebook/callback', passport.authenticate('facebook', { failureRedirect: '/login' }), function(req, res) { +app.get('/auth/facebook/callback', passport.authenticate('facebook', { successRedirect: '/curriculum',failureRedirect: '/login' }), function(req, res) { res.redirect(req.session.returnTo || '/'); }); app.get('/auth/github', passport.authenticate('github')); -app.get('/auth/github/callback', passport.authenticate('github', { failureRedirect: '/login' }), function(req, res) { +app.get('/auth/github/callback', passport.authenticate('github', { successRedirect: '/curriculum',failureRedirect: '/login' }), function(req, res) { res.redirect(req.session.returnTo || '/'); }); app.get('/auth/google', passport.authenticate('google', { scope: 'profile email' })); -app.get('/auth/google/callback', passport.authenticate('google', { failureRedirect: '/login' }), function(req, res) { +app.get('/auth/google/callback', passport.authenticate('google', { successRedirect: '/curriculum',failureRedirect: '/login' }), function(req, res) { res.redirect(req.session.returnTo || '/'); }); app.get('/auth/twitter', passport.authenticate('twitter')); -app.get('/auth/twitter/callback', passport.authenticate('twitter', { failureRedirect: '/login' }), function(req, res) { +app.get('/auth/twitter/callback', passport.authenticate('twitter', { successRedirect: '/curriculum',failureRedirect: '/login' }), function(req, res) { res.redirect(req.session.returnTo || '/'); }); app.get('/auth/linkedin', passport.authenticate('linkedin', { state: 'SOME STATE' })); -app.get('/auth/linkedin/callback', passport.authenticate('linkedin', { failureRedirect: '/login' }), function(req, res) { +app.get('/auth/linkedin/callback', passport.authenticate('linkedin', { successRedirect: '/curriculum',failureRedirect: '/login' }), function(req, res) { res.redirect(req.session.returnTo || '/'); }); diff --git a/controllers/challenge.js b/controllers/challenge.js index f58922793f..134a3abd29 100644 --- a/controllers/challenge.js +++ b/controllers/challenge.js @@ -1,7 +1,7 @@ /** - * GET / - * Home page. - */ +* GET / +* Home page. +*/ var Challenge = require('./../models/Challenge') exports.index = function(req, res) { @@ -20,16 +20,30 @@ exports.view = function(req, res) { }); }); }; -exports.firstPairProgrammingSession = function(req, res) { - Challenge.findOne({ name: "Start Your First Pair Programming Session" }).exec (function(err, challenge) { - res.render('challenge/first_pair_programming_session', { - title: 'Challenge', - challenge: challenge - }); +exports.createAndDeployAWebsite = function(req, res) { + res.render('challenge/create-and-deploy-a-website', { + name: 'Create and Deploy a Website', + image: 'http://startbootstrap.com/assets/img/templates/landing-page.jpg', + video: '', + directions: "In the next 5 minutes, you'll create a website and deploy it to the internet!", + links: ["http://startbootstrap.com/template-overviews/freelancer/", "www.bitballoon.com", "https://atom.io/"] }); }; -//firstPairProgrammingSession -//firstCodePen -//firstDynamicWebsite -//firstWebsite \ No newline at end of file +exports.addDynamicContentToYourWebsite = function(req, res) { + res.render('challenge/add-dynamic-content-to-your-website', { + name: 'Add dynamic content to your website' + }); +}; + +exports.experimentWithHtmlAndCssInCodepen = function(req, res) { + res.render('challenge/experiment-with-html-and-css-in-codepen', { + name: 'Experiment with HTML and CSS in Codepen' + }); +}; + +exports.startAPairProgrammingSession = function(req, res) { + res.render('challenge/start-a-pair-programming-session', { + name: 'Start a pair programming session' + }); +}; \ No newline at end of file diff --git a/controllers/course.js b/controllers/course.js index 8bdeb20f55..be24e49c27 100644 --- a/controllers/course.js +++ b/controllers/course.js @@ -1,7 +1,7 @@ /** - * GET / - * Home page. - */ +* GET / +* Home page. +*/ var Course = require('./../models/Course') exports.index = function(req, res) { diff --git a/controllers/curriculum.js b/controllers/curriculum.js index e7dc5c299f..03c334ef50 100644 --- a/controllers/curriculum.js +++ b/controllers/curriculum.js @@ -8,8 +8,7 @@ var Course = require('./../models/Course') exports.index = function(req, res) { Course.find(function(err, courses){ res.render('curriculum/curriculum', { - title: 'Curriculum', - courses: courses + title: 'Curriculum' }); }); }; \ No newline at end of file diff --git a/controllers/home.js b/controllers/home.js index a49c486bf1..8458995461 100644 --- a/controllers/home.js +++ b/controllers/home.js @@ -7,4 +7,4 @@ exports.index = function(req, res) { res.render('home', { title: 'Home' }); -}; +}; \ No newline at end of file diff --git a/seed_data/challenges.json b/seed_data/challenges.json index 7d6fa50af3..77eef540e6 100644 --- a/seed_data/challenges.json +++ b/seed_data/challenges.json @@ -1,8 +1,8 @@ [ { - "name": "Build and Deploy Your First Website", + "name": "Create and Deploy a Website", "source": "Free Code Camp", - "link": "http://www.freecodecamp.com/first_website", + "link": "http://www.freecodecamp.com/create-and-deploy-a-website", "image": "http://startbootstrap.com/assets/img/templates/landing-page.jpg", "time": 1, "directions": [ diff --git a/views/challenge/add-dynamic-content-to-your-website.jade b/views/challenge/add-dynamic-content-to-your-website.jade new file mode 100644 index 0000000000..333c5253d6 --- /dev/null +++ b/views/challenge/add-dynamic-content-to-your-website.jade @@ -0,0 +1,9 @@ +extends ../layout +block content + .row + .col-sm-8.col-xs-12 + include ./partials/challenge + .col-sm-4.col-xs-12 + include ./../partials/challenges + .col-sm-4.col-xs-12 + include ./../partials/courses \ No newline at end of file diff --git a/views/challenge/create-and-deploy-a-website.jade b/views/challenge/create-and-deploy-a-website.jade new file mode 100644 index 0000000000..333c5253d6 --- /dev/null +++ b/views/challenge/create-and-deploy-a-website.jade @@ -0,0 +1,9 @@ +extends ../layout +block content + .row + .col-sm-8.col-xs-12 + include ./partials/challenge + .col-sm-4.col-xs-12 + include ./../partials/challenges + .col-sm-4.col-xs-12 + include ./../partials/courses \ No newline at end of file diff --git a/views/challenge/experiment-with-html-and-css-in-codepen.jade b/views/challenge/experiment-with-html-and-css-in-codepen.jade new file mode 100644 index 0000000000..333c5253d6 --- /dev/null +++ b/views/challenge/experiment-with-html-and-css-in-codepen.jade @@ -0,0 +1,9 @@ +extends ../layout +block content + .row + .col-sm-8.col-xs-12 + include ./partials/challenge + .col-sm-4.col-xs-12 + include ./../partials/challenges + .col-sm-4.col-xs-12 + include ./../partials/courses \ No newline at end of file diff --git a/views/challenge/first_pair_programming_session.jade b/views/challenge/first_pair_programming_session.jade deleted file mode 100644 index 25f2dd4774..0000000000 --- a/views/challenge/first_pair_programming_session.jade +++ /dev/null @@ -1,3 +0,0 @@ -extends ../layout -block content - li= challenge.name \ No newline at end of file diff --git a/views/challenge/partials/challenge.jade b/views/challenge/partials/challenge.jade new file mode 100644 index 0000000000..744a32a3b2 --- /dev/null +++ b/views/challenge/partials/challenge.jade @@ -0,0 +1,2 @@ +h1 Challenge +h2= name \ No newline at end of file diff --git a/views/challenge/start-a-pair-programming-session.jade b/views/challenge/start-a-pair-programming-session.jade new file mode 100644 index 0000000000..333c5253d6 --- /dev/null +++ b/views/challenge/start-a-pair-programming-session.jade @@ -0,0 +1,9 @@ +extends ../layout +block content + .row + .col-sm-8.col-xs-12 + include ./partials/challenge + .col-sm-4.col-xs-12 + include ./../partials/challenges + .col-sm-4.col-xs-12 + include ./../partials/courses \ No newline at end of file diff --git a/views/curriculum/curriculum.jade b/views/curriculum/curriculum.jade index 1e23b9ab97..403d25e486 100644 --- a/views/curriculum/curriculum.jade +++ b/views/curriculum/curriculum.jade @@ -1,12 +1,24 @@ extends ../layout - block content - .page-header - h3 Your Curriculum - h1= title - ul - each course in courses - a(href="/courses/#{course.id}") - =course.name - br - + .row + .col-sm-8.col-xs-12 + h1 Welcome to Free Code Camp! + ol + li + a(href="challenges/create-and-deploy-a-website") Learn how to create a website and deploy it to the internet + |   (takes 10 minutes) + li + a(href="challenges/start-a-pair-programming-session") Learn how to start Pair Programming session + |   (takes 10 minutes) + li + a(href="challenges/add-dynamic-content-to-your-website") Learn how to add dynamic content to your website + |   (takes 10 minutes) + li + a(href="challenges/experiment-with-html-and-css-in-codepen") Learn how to experiment with HTML and CSS in Codepen + |   (takes 10 minutes) + li + a(href="challenges") Start the HTML and CSS challenges! + .col-sm-4.col-xs-12 + include ./../partials/challenges + .col-sm-4.col-xs-12 + include ./../partials/courses \ No newline at end of file diff --git a/views/partials/challenges.jade b/views/partials/challenges.jade new file mode 100644 index 0000000000..fa22666777 --- /dev/null +++ b/views/partials/challenges.jade @@ -0,0 +1 @@ +h1 Challenges Partial \ No newline at end of file diff --git a/views/partials/courses.jade b/views/partials/courses.jade new file mode 100644 index 0000000000..d1d50bd92e --- /dev/null +++ b/views/partials/courses.jade @@ -0,0 +1,5 @@ +h1 Courses Partial + +//ul +// li +// a(href="courses/codecademy-html-and-css-track") Codecademy HTML & CSS Track \ No newline at end of file